@@ -58,6 +58,48 @@ public function shouldPaginateFoundRepositories()
58
58
$ this ->assertEquals ($ expectedArray , $ api ->find ('php ' , array ('start_page ' => 2 )));
59
59
}
60
60
61
+ /**
62
+ * @test
63
+ */
64
+ public function shouldGetAllRepositories ()
65
+ {
66
+ $ expectedArray = array (
67
+ array ('id ' => 1 , 'name ' => 'dummy project ' ),
68
+ array ('id ' => 2 , 'name ' => 'awesome another project ' ),
69
+ array ('id ' => 3 , 'name ' => 'fork of php ' ),
70
+ array ('id ' => 4 , 'name ' => 'fork of php-cs ' ),
71
+ );
72
+
73
+ $ api = $ this ->getApiMock ();
74
+ $ api ->expects ($ this ->once ())
75
+ ->method ('get ' )
76
+ ->with ('repositories ' )
77
+ ->will ($ this ->returnValue ($ expectedArray ));
78
+
79
+ $ this ->assertEquals ($ expectedArray , $ api ->all ());
80
+ }
81
+
82
+ /**
83
+ * @test
84
+ */
85
+ public function shouldGetAllRepositoriesStartingIndex ()
86
+ {
87
+ $ expectedArray = array (
88
+ array ('id ' => 1 , 'name ' => 'dummy project ' ),
89
+ array ('id ' => 2 , 'name ' => 'awesome another project ' ),
90
+ array ('id ' => 3 , 'name ' => 'fork of php ' ),
91
+ array ('id ' => 4 , 'name ' => 'fork of php-cs ' ),
92
+ );
93
+
94
+ $ api = $ this ->getApiMock ();
95
+ $ api ->expects ($ this ->once ())
96
+ ->method ('get ' )
97
+ ->with ('repositories?since=2 ' )
98
+ ->will ($ this ->returnValue ($ expectedArray ));
99
+
100
+ $ this ->assertEquals ($ expectedArray , $ api ->all (2 ));
101
+ }
102
+
61
103
/**
62
104
* @test
63
105
*/
0 commit comments