/** * @covers phpDocumentor\Descriptor\Filter\Filter::filter */ public function testFilter() { $filterableMock = m::mock('phpDocumentor\\Descriptor\\Filter\\Filterable'); $this->filterChainMock->shouldReceive('filter')->with($filterableMock)->andReturn($filterableMock); $this->classFactoryMock->shouldReceive('getChainFor')->with(get_class($filterableMock))->andReturn($this->filterChainMock); $this->assertSame($filterableMock, $this->fixture->filter($filterableMock)); }
/** * Filters the given Descriptor and returns the altered object. * * @param Filterable $descriptor * * @return Filterable|null */ public function filter(Filterable $descriptor) { $chain = $this->factory->getChainFor(get_class($descriptor)); return $chain->filter($descriptor); }
/** * @covers phpDocumentor\Descriptor\Filter\ClassFactory::getChainFor */ public function testGetChainForReturnsInstanceOfFilterChain() { $filterChain = $this->fixture->getChainFor('foo'); $this->assertInstanceOf('Zend\\Filter\\FilterChain', $filterChain); }