12
12
namespace phpDocumentor \Descriptor \Filter ;
13
13
14
14
use \Mockery as m ;
15
- use \ Zend \ Filter \ FilterChain ;
15
+ use phpDocumentor \ SimpleFilter \ Chain ;
16
16
17
17
/**
18
18
* Tests the functionality for the Filter class.
19
- * @group broken
20
19
*/
21
20
class FilterTest extends \PHPUnit_Framework_TestCase
22
21
{
@@ -25,8 +24,8 @@ class FilterTest extends \PHPUnit_Framework_TestCase
25
24
/** @var ClassFactory|m\Mock */
26
25
protected $ classFactoryMock ;
27
26
28
- /** @var FilterChain |m\Mock */
29
- protected $ filterChainMock ;
27
+ /** @var Chain |m\Mock */
28
+ protected $ chainMock ;
30
29
31
30
/** @var Filter $fixture */
32
31
protected $ fixture ;
@@ -37,7 +36,7 @@ class FilterTest extends \PHPUnit_Framework_TestCase
37
36
protected function setUp ()
38
37
{
39
38
$ this ->classFactoryMock = m::mock ('phpDocumentor\Descriptor\Filter\ClassFactory ' );
40
- $ this ->filterChainMock = m::mock (' Zend\Filter\FilterChain ' );
39
+ $ this ->chainMock = m::mock (new Chain () );
41
40
$ this ->fixture = new Filter ($ this ->classFactoryMock );
42
41
}
43
42
@@ -54,10 +53,10 @@ public function testClassFactoryIsSetUponConstruction()
54
53
*/
55
54
public function testAttach ()
56
55
{
57
- $ filterMock = m::mock ('Zend\Filter \FilterInterface ' );
56
+ $ filterMock = m::mock ('phpDocumentor\SimpleFilter \FilterInterface ' );
58
57
59
- $ this ->filterChainMock ->shouldReceive ('attach ' )->with ($ filterMock , FilterChain ::DEFAULT_PRIORITY );
60
- $ this ->classFactoryMock ->shouldReceive ('getChainFor ' )->with (self ::FQCN )->andReturn ($ this ->filterChainMock );
58
+ $ this ->chainMock ->shouldReceive ('attach ' )->with ($ filterMock , Chain ::DEFAULT_PRIORITY );
59
+ $ this ->classFactoryMock ->shouldReceive ('getChainFor ' )->with (self ::FQCN )->andReturn ($ this ->chainMock );
61
60
62
61
$ this ->fixture ->attach (self ::FQCN , $ filterMock );
63
62
}
@@ -69,9 +68,9 @@ public function testFilter()
69
68
{
70
69
$ filterableMock = m::mock ('phpDocumentor\Descriptor\Filter\Filterable ' );
71
70
72
- $ this ->filterChainMock ->shouldReceive ('filter ' )->with ($ filterableMock )->andReturn ($ filterableMock );
71
+ $ this ->chainMock ->shouldReceive ('filter ' )->with ($ filterableMock )->andReturn ($ filterableMock );
73
72
$ this ->classFactoryMock
74
- ->shouldReceive ('getChainFor ' )->with (get_class ($ filterableMock ))->andReturn ($ this ->filterChainMock );
73
+ ->shouldReceive ('getChainFor ' )->with (get_class ($ filterableMock ))->andReturn ($ this ->chainMock );
75
74
76
75
$ this ->assertSame ($ filterableMock , $ this ->fixture ->filter ($ filterableMock ));
77
76
}
0 commit comments