88
99class AggregateResolverTest extends PHPUnit_Framework_TestCase
1010{
11- public function setUp ()
12- {
13- require_once __DIR__ . '/../../_files/ResolverWithCollect.php ' ;
14- }
15-
1611 public function testResolve ()
1712 {
1813 $ resolver = new AggregateResolver ();
@@ -49,11 +44,10 @@ public function testResolve()
4944 $ this ->assertSame ('second ' , $ resolver ->resolve ('to-be-resolved ' ));
5045 }
5146
52- public function testCollect ()
47+ public function testCollectWithCollectMethod ()
5348 {
54- /* Tests for interfaces that _do_ implement the `collect` method. */
5549 $ resolver = new AggregateResolver ();
56- $ lowPriority = $ this ->getMock ('ResolverWithCollect ' );
50+ $ lowPriority = $ this ->getMock ('AssetManager\Resolver\ResolverInterface ' , array ( ' resolve ' , ' collect ' ) );
5751 $ lowPriority
5852 ->expects ($ this ->exactly (2 ))
5953 ->method ('collect ' )
@@ -62,7 +56,7 @@ public function testCollect()
6256
6357 $ this ->assertContains ('one ' , $ resolver ->collect ());
6458
65- $ highPriority = $ this ->getMock ('ResolverWithCollect ' );
59+ $ highPriority = $ this ->getMock ('AssetManager\Resolver\ResolverInterface ' , array ( ' resolve ' , ' collect ' ) );
6660 $ highPriority
6761 ->expects ($ this ->once ())
6862 ->method ('collect ' )
@@ -74,8 +68,10 @@ public function testCollect()
7468 $ this ->assertContains ('three ' , $ collection );
7569
7670 $ this ->assertCount (3 , $ collection );
71+ }
7772
78- /* Tests for interfaces that _don't_ implement the `collect` method. */
73+ public function testCollectWithoutCollectMethod ()
74+ {
7975 $ resolver = new AggregateResolver ();
8076 $ lowPriority = $ this ->getMock ('AssetManager\Resolver\ResolverInterface ' );
8177
0 commit comments