public function testPlacePropertyWillGetCastAsGraphPageObject() { $dataFromGraph = ['id' => '123', 'name' => 'Foo Album', 'place' => ['id' => '1', 'name' => 'For Bar Place']]; $this->responseMock->shouldReceive('getDecodedBody')->once()->andReturn($dataFromGraph); $factory = new GraphNodeFactory($this->responseMock); $graphNode = $factory->makeGraphAlbum(); $place = $graphNode->getPlace(); $this->assertInstanceOf('\\Facebook\\GraphNodes\\GraphPage', $place); }
/** * Convenience method for creating a GraphAlbum collection. * * @return \Facebook\GraphNodes\GraphAlbum * * @throws FacebookSDKException */ public function getGraphAlbum() { $factory = new GraphNodeFactory($this); return $factory->makeGraphAlbum(); }