예제 #1
0
파일: LengthTest.php 프로젝트: seytar/psx
 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());
 }