コード例 #1
0
 public function testUserPropertiesWillGetCastAsGraphUserObjects()
 {
     $dataFromGraph = ['id' => '123', 'name' => 'Foo User', 'significant_other' => ['id' => '1337', 'name' => 'Bar User']];
     $this->responseMock->shouldReceive('getDecodedBody')->once()->andReturn($dataFromGraph);
     $factory = new GraphObjectFactory($this->responseMock);
     $graphObject = $factory->makeGraphUser();
     $significantOther = $graphObject->getSignificantOther();
     $this->assertInstanceOf('\\Facebook\\GraphNodes\\GraphUser', $significantOther);
 }
コード例 #2
0
 /**
  * Convenience method for creating a GraphUser collection.
  *
  * @return \Facebook\GraphNodes\GraphUser
  *
  * @throws FacebookSDKException
  */
 public function getGraphUser()
 {
     $factory = new GraphObjectFactory($this);
     return $factory->makeGraphUser();
 }