예제 #1
0
 public function testASuccessfulJsonResponseWillBeDecodedToAGraphNode()
 {
     $graphResponseJson = '{"id":"123","name":"Foo"}';
     $response = new FacebookResponse($this->request, $graphResponseJson, 200);
     $decodedResponse = $response->getDecodedBody();
     $graphNode = $response->getGraphNode();
     $this->assertFalse($response->isError(), 'Did not expect Response to return an error.');
     $this->assertEquals(['id' => '123', 'name' => 'Foo'], $decodedResponse);
     $this->assertInstanceOf('Facebook\\GraphNodes\\GraphNode', $graphNode);
 }