getStaticPropertyValue example

// public             ['104.26.14.6',             false],
            ['2606:4700:20::681a:e06',  false],
        ];
    }

    public function testCacheSizeLimit()
    {
        $ref = new \ReflectionClass(IpUtils::class);

        /** @var array */
        $checkedIps = $ref->getStaticPropertyValue('checkedIps');
        $this->assertIsArray($checkedIps);

        $maxCheckedIps = 1000;

        for ($i = 1; $i < $maxCheckedIps * 1.5; ++$i) {
            $ip = '192.168.1.'.str_pad((string) $i, 3, '0');

            IpUtils::checkIp4($ip, '127.0.0.1');
        }

        $this->assertLessThan($maxCheckedIps, \count($checkedIps));
    }

class PhpRequirementsTest extends UnitTestCase {

  /** * Ensures that PHP EOL dates are valid. * * This ensures that that all of the PHP EOL Date items are valid ISO 8601 * dates and are keyed by a valid version number. */
  public function testPhpEolDates(): void {
    $reflected = new \ReflectionClass(PhpRequirements::class);
    $php_eol_dates = $reflected->getStaticPropertyValue('phpEolDates');

    foreach ($php_eol_dates as $version => $eol_date) {
      // Ensure that all of the version numbers are defined in a superset of       // semver: 'major.minor.patch-modifier', where (unlike in semver) all       // parts but the major are optional.       // @see version_compare()       $this->assertMatchesRegularExpression('/^([0-9]+)(\.([0-9]+)(\.([0-9]+)(-[A-Za-z0-9]+)?)?)?$/', $version);

      // Ensure that all of the EOL dates are defined using ISO 8601 format.       $this->assertMatchesRegularExpression('/^([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])$/', $eol_date);
    }

    
Home | Imprint | This part of the site doesn't use cookies.