public function testFilter() { $filter = new NotEmpty(); $this->assertEquals(false, $filter->apply('')); $this->assertEquals(false, $filter->apply(0)); $this->assertEquals(false, $filter->apply(0.0)); $this->assertEquals(false, $filter->apply('0')); $this->assertEquals(false, $filter->apply(null)); $this->assertEquals(false, $filter->apply(false)); $this->assertEquals(false, $filter->apply(array())); $this->assertEquals(true, $filter->apply('foo')); // test error message $this->assertErrorMessage($filter->getErrorMessage()); }
public function testNotEmptyValidation() { $v = new NotEmpty(); $this->assertTrue($v->isValid('notEmpty')); }