@@ -44,11 +44,10 @@ public function testResolve()
4444 $ this ->assertSame ('second ' , $ resolver ->resolve ('to-be-resolved ' ));
4545 }
4646
47- public function testCollect ()
47+ public function testCollectWithCollectMethod ()
4848 {
49- $ resolver = new AggregateResolver ();
50-
51- $ lowPriority = $ this ->getMock ('AssetManager\Resolver\ResolverInterface ' );
49+ $ resolver = new AggregateResolver ();
50+ $ lowPriority = $ this ->getMock ('AssetManager\Resolver\ResolverInterface ' , array ('resolve ' , 'collect ' ));
5251 $ lowPriority
5352 ->expects ($ this ->exactly (2 ))
5453 ->method ('collect ' )
@@ -57,7 +56,7 @@ public function testCollect()
5756
5857 $ this ->assertContains ('one ' , $ resolver ->collect ());
5958
60- $ highPriority = $ this ->getMock ('AssetManager\Resolver\ResolverInterface ' );
59+ $ highPriority = $ this ->getMock ('AssetManager\Resolver\ResolverInterface ' , array ( ' resolve ' , ' collect ' ) );
6160 $ highPriority
6261 ->expects ($ this ->once ())
6362 ->method ('collect ' )
@@ -70,4 +69,22 @@ public function testCollect()
7069
7170 $ this ->assertCount (3 , $ collection );
7271 }
72+
73+ public function testCollectWithoutCollectMethod ()
74+ {
75+ $ resolver = new AggregateResolver ();
76+ $ lowPriority = $ this ->getMock ('AssetManager\Resolver\ResolverInterface ' );
77+
78+ $ resolver ->attach ($ lowPriority );
79+
80+ $ this ->assertEquals (array (), $ resolver ->collect ());
81+
82+ $ highPriority = $ this ->getMock ('AssetManager\Resolver\ResolverInterface ' );
83+ $ resolver ->attach ($ highPriority , 1000 );
84+
85+ $ collection = $ resolver ->collect ();
86+ $ this ->assertEquals (array (), $ collection );
87+
88+ $ this ->assertCount (0 , $ collection );
89+ }
7390}
0 commit comments