Jyxo\Input\ValidatorTest::testStringLengthGreaterThan PHP Метод

testStringLengthGreaterThan() публичный Метод

Tests StringLengthGraterThan validator.
    public function testStringLengthGreaterThan()
    {
        $good = ['test-test-test', 'ěščřžýáíéíáýž'];
        $wrong = ['žlutý', 'test'];
        $length = 10;
        $validator = new Validator\StringLengthGreaterThan($length);
        $this->executeTests($validator, $good, $wrong);
        $this->assertEquals($length, $validator->getMin());
        try {
            $validator->setMin(-10);
            $this->fail(sprintf('Expected exception %s.', \InvalidArgumentException::class));
        } catch (\PHPUnit_Framework_AssertionFailedError $e) {
            throw $e;
        } catch (\Exception $e) {
            // Correctly thrown exception
            $this->assertInstanceOf(\InvalidArgumentException::class, $e);
        }
    }