@@ -70,6 +70,18 @@ public function shouldGetOwnedProjects()
7070 $ this ->assertEquals ($ expectedArray , $ api ->all (['owned ' => true ]));
7171 }
7272
73+ /**
74+ * @test
75+ */
76+ public function shouldGetNotArchivedProjects ()
77+ {
78+ $ expectedArray = $ this ->getMultipleProjectsData ();
79+
80+ $ api = $ this ->getMultipleProjectsRequestMock ('projects ' , $ expectedArray , ['archived ' => 'false ' ]);
81+
82+ $ this ->assertEquals ($ expectedArray , $ api ->all (['archived ' => false ]));
83+ }
84+
7385 /**
7486 * @test
7587 */
@@ -228,6 +240,27 @@ public function shouldGetPipelines()
228240 $ this ->assertEquals ($ expectedArray , $ api ->pipelines (1 ));
229241 }
230242
243+ /**
244+ * @test
245+ */
246+ public function shouldGetPipelinesWithBooleanParam ()
247+ {
248+ $ expectedArray = array (
249+ array ('id ' => 1 , 'status ' => 'success ' ,'ref ' => 'new-pipeline ' ),
250+ array ('id ' => 2 , 'status ' => 'failed ' , 'ref ' => 'new-pipeline ' ),
251+ array ('id ' => 3 , 'status ' => 'pending ' , 'ref ' => 'test-pipeline ' )
252+ );
253+
254+ $ api = $ this ->getApiMock ();
255+ $ api ->expects ($ this ->once ())
256+ ->method ('get ' )
257+ ->with ('projects/1/pipelines ' , ['yaml_errors ' => 'false ' ])
258+ ->will ($ this ->returnValue ($ expectedArray ))
259+ ;
260+
261+ $ this ->assertEquals ($ expectedArray , $ api ->pipelines (1 , ['yaml_errors ' => false ]));
262+ }
263+
231264 /**
232265 * @test
233266 */
@@ -660,6 +693,34 @@ public function shouldGetEvents()
660693 $ this ->assertEquals ($ expectedArray , $ api ->events (1 ));
661694 }
662695
696+ /**
697+ * @test
698+ */
699+ public function shouldGetEventsWithDateTimeParams ()
700+ {
701+ $ expectedArray = [
702+ ['id ' => 1 , 'title ' => 'An event ' ],
703+ ['id ' => 2 , 'title ' => 'Another event ' ]
704+ ];
705+
706+ $ after = new \DateTime ('2018-01-01 00:00:00 ' );
707+ $ before = new \DateTime ('2018-01-31 00:00:00 ' );
708+
709+ $ expectedWithArray = [
710+ 'after ' => $ after ->format ('Y-m-d ' ),
711+ 'before ' => $ before ->format ('Y-m-d ' ),
712+ ];
713+
714+ $ api = $ this ->getApiMock ();
715+ $ api ->expects ($ this ->once ())
716+ ->method ('get ' )
717+ ->with ('projects/1/events ' , $ expectedWithArray )
718+ ->will ($ this ->returnValue ($ expectedArray ))
719+ ;
720+
721+ $ this ->assertEquals ($ expectedArray , $ api ->events (1 , ['after ' => $ after , 'before ' => $ before ]));
722+ }
723+
663724 /**
664725 * @test
665726 */
0 commit comments