public function testUsesMultipleFilters() { $mockFilter1 = $this->getMock('Zend_Filter_Int'); $mockFilter1->expects($this->exactly(3))->method('filter'); $mockFilter2 = $this->getMock('Zend_Filter_Int'); $mockFilter2->expects($this->exactly(3))->method('filter'); $zfb = new Zend_Filter_Builder(); $zfb->add($mockFilter1, array('test1', 'test3', 'test5')); $zfb->add($mockFilter2, array('test2', 'test4', 'test6')); $actual = $zfb->filter($this->_testSet); $this->assertType('array', $actual); $this->assertEquals(6, count($actual)); }
/** * Filter * * Just proxies to the Builder object * * @see Zend_Filter_Builder::filter() */ public function filter($data) { return $this->_builder->filter($data); }
/** * Call magic method * * Maps the method call to a filter name and adds that filter to the * Builder object. * * @param string Base name of the filter * @param array Constructor arguments * @returns Zend_Filter_Builder_FluentAdder * @throws none */ public function __call($name, $args) { $this->_rowIds[] = $this->_builder->add($this->_factory->create($name, $args), $this->_fieldSpec, $this->_flags); return $this; }