Jyxo\Input\ValidatorTest::testCallStatic PHP Method

testCallStatic() public method

Tests static call usage.
public testCallStatic ( )
    public function testCallStatic()
    {
        static $value = 42;
        $this->assertTrue(Validator::isInt($value));
        $this->assertTrue(Validator::lessThan($value, $value * 2));
        $this->assertTrue(Validator::callback($value, function ($value, $lowerBound) {
            return is_numeric($value) && $value > $lowerBound;
        }, 41));
        // Tests storing in cache - the first on in cached, the second one isn't
        // because it had additional parameters that had been added to the cache ID
        $this->assertNotNull(\Jyxo\Spl\ObjectCache::get(\Jyxo\Input\Validator\IsInt::class));
        $this->assertNull(\Jyxo\Spl\ObjectCache::get(\Jyxo\Input\Validator\LessThan::class));
    }