@@ -43,6 +43,31 @@ public function testMedia()
4343 $ this ->assertCount (20 , $ items );
4444 }
4545
46+ public function testCanAppendParametersToMedia ()
47+ {
48+ $ response = new Response (200 , [], json_encode ([
49+ 'data ' => [],
50+ 'meta ' => [],
51+ ]));
52+
53+ $ client = new Client ();
54+ $ client ->addResponse ($ response );
55+
56+ $ instagram = new Instagram ('jerryseinfeld ' , $ client );
57+ $ instagram ->media ([
58+ 'count ' => 22 ,
59+ 'min_id ' => 'min id ' ,
60+ 'max_id ' => 'max id ' ,
61+ ]);
62+
63+ $ request = $ client ->getLastRequest ();
64+
65+ $ this ->assertSame (
66+ 'access_token=jerryseinfeld&count=22&min_id=min+id&max_id=max+id ' ,
67+ $ request ->getUri ()->getQuery ()
68+ );
69+ }
70+
4671 public function testSelf ()
4772 {
4873 $ response = new Response (200 , [], json_encode ([
@@ -59,29 +84,20 @@ public function testSelf()
5984 $ this ->assertIsObject ($ user );
6085 }
6186
62- public function testCanAppendParametersToMedia ()
87+ public function testComments ()
6388 {
6489 $ response = new Response (200 , [], json_encode ([
65- 'data ' => [] ,
90+ 'data ' => range ( 1 , 5 ) ,
6691 'meta ' => [],
6792 ]));
6893
6994 $ client = new Client ();
7095 $ client ->addResponse ($ response );
7196
7297 $ instagram = new Instagram ('jerryseinfeld ' , $ client );
73- $ instagram ->media ([
74- 'count ' => 22 ,
75- 'min_id ' => 'min id ' ,
76- 'max_id ' => 'max id ' ,
77- ]);
78-
79- $ request = $ client ->getLastRequest ();
98+ $ comments = $ instagram ->comments ('media-id ' );
8099
81- $ this ->assertSame (
82- 'access_token=jerryseinfeld&count=22&min_id=min+id&max_id=max+id ' ,
83- $ request ->getUri ()->getQuery ()
84- );
100+ $ this ->assertIsArray ($ comments );
85101 }
86102
87103 public function testError ()
0 commit comments