@@ -10,33 +10,35 @@ class SrcTest extends Tests\TestCase
1010 public function testListRepoSrc ()
1111 {
1212 $ endpoint = 'repositories/gentle/eof/src/1e10ffe//lib ' ;
13- $ expectedResult = json_encode ( 'dummy ' );
13+ $ expectedResult = $ this -> fakeResponse ( array ( 'dummy ' ) );
1414
15- $ src = $ this ->getApiMock ( ' Bitbucket\API\Repositories\Src ' );
16- $ src ->expects ($ this ->once ())
17- ->method ('requestGet ' )
15+ $ client = $ this ->getHttpClientMock ( );
16+ $ client ->expects ($ this ->once ())
17+ ->method ('get ' )
1818 ->with ($ endpoint )
1919 ->will ( $ this ->returnValue ($ expectedResult ) );
2020
2121 /** @var $src \Bitbucket\API\Repositories\Src */
22+ $ src = $ this ->getClassMock ('Bitbucket\API\Repositories\Src ' , $ client );
2223 $ actual = $ src ->get ('gentle ' , 'eof ' , '1e10ffe ' , '/lib ' );
2324
2425 $ this ->assertEquals ($ expectedResult , $ actual );
2526 }
2627
2728 public function testSrcGetRawContent ()
2829 {
29- $ endpoint = 'repositories/gentle/eof/raw /1e10ffe/lib/Gentle/Bitbucket/API/Repositories/Services.php ' ;
30- $ expectedResult = json_encode ( 'dummy ' );
30+ $ endpoint = 'repositories/gentle/eof/src /1e10ffe/lib/Gentle/Bitbucket/API/Repositories/Services.php ' ;
31+ $ expectedResult = $ this -> fakeResponse ( array ( 'dummy ' ) );
3132
32- $ src = $ this ->getApiMock ( ' Bitbucket\API\Repositories\Src ' );
33- $ src ->expects ($ this ->once ())
34- ->method ('requestGet ' )
33+ $ client = $ this ->getHttpClientMock ( );
34+ $ client ->expects ($ this ->once ())
35+ ->method ('get ' )
3536 ->with ($ endpoint )
3637 ->will ( $ this ->returnValue ($ expectedResult ) );
3738
3839 /** @var $src \Bitbucket\API\Repositories\Src */
39- $ actual = $ src ->raw ('gentle ' , 'eof ' , '1e10ffe ' , 'lib/Gentle/Bitbucket/API/Repositories/Services.php ' );
40+ $ src = $ this ->getClassMock ('Bitbucket\API\Repositories\Src ' , $ client );
41+ $ actual = $ src ->get ('gentle ' , 'eof ' , '1e10ffe ' , 'lib/Gentle/Bitbucket/API/Repositories/Services.php ' );
4042
4143 $ this ->assertEquals ($ expectedResult , $ actual );
4244 }
@@ -92,4 +94,4 @@ public function testSrcCreateBranch()
9294
9395 $ src ->create ('gentle ' , 'eof ' , $ params );
9496 }
95- }
97+ }
0 commit comments