public function testPicturePropertiesWillGetCastAsGraphPictureObjects() { $dataFromGraph = ['id' => '123', 'name' => 'Foo User', 'picture' => ['is_silhouette' => true, 'url' => 'http://foo.bar', 'width' => 200, 'height' => 200]]; $this->responseMock->shouldReceive('getDecodedBody')->once()->andReturn($dataFromGraph); $factory = new GraphNodeFactory($this->responseMock); $graphNode = $factory->makeGraphUser(); $Picture = $graphNode->getPicture(); $this->assertInstanceOf('\\Facebook\\GraphNodes\\GraphPicture', $Picture); $this->assertTrue($Picture->isSilhouette()); $this->assertEquals(200, $Picture->getWidth()); $this->assertEquals(200, $Picture->getHeight()); $this->assertEquals('http://foo.bar', $Picture->getUrl()); }
/** * Convenience method for creating a GraphUser collection. * * @return \Facebook\GraphNodes\GraphUser * * @throws FacebookSDKException */ public function getGraphUser() { $factory = new GraphNodeFactory($this); return $factory->makeGraphUser(); }