コード例 #1
0
 /**
  * @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));
 }
コード例 #2
0
ファイル: Filter.php プロジェクト: michaelyin1/Modern-Toolkit
 /**
  * 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);
 }
コード例 #3
0
 /**
  * @covers phpDocumentor\Descriptor\Filter\ClassFactory::getChainFor
  */
 public function testGetChainForReturnsInstanceOfFilterChain()
 {
     $filterChain = $this->fixture->getChainFor('foo');
     $this->assertInstanceOf('Zend\\Filter\\FilterChain', $filterChain);
 }