public function testFilterStringLength() { $filter = new Length(3, 8); $this->assertEquals(false, $filter->apply('fo')); $this->assertEquals(true, $filter->apply('foo')); $this->assertEquals(true, $filter->apply('foobarte')); $this->assertEquals(false, $filter->apply('foobartes')); // test error message $this->assertErrorMessage($filter->getErrorMessage()); $filter = new Length(8); $this->assertEquals(true, $filter->apply('fo')); $this->assertEquals(true, $filter->apply('foo')); $this->assertEquals(true, $filter->apply('foobarte')); $this->assertEquals(false, $filter->apply('foobartes')); // test error message $this->assertErrorMessage($filter->getErrorMessage()); }