public function testFilter() { $filter = new Collection(array(new Alnum(), new Alpha())); $this->assertEquals(true, $filter->apply('foo')); $this->assertEquals(false, $filter->apply('foo123')); $filter = new Collection(array(new Alnum(), new Alpha(), new Sha1())); $this->assertEquals('0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', $filter->apply('foo')); $this->assertEquals(false, $filter->apply('foo123')); // test error message $this->assertErrorMessage($filter->getErrorMessage()); }