예제 #1
0
 public function testDatesGetCastToDateTime()
 {
     $dataFromGraph = ['expires_at' => 123, 'issued_at' => 1337];
     $this->responseMock->shouldReceive('getDecodedBody')->once()->andReturn($dataFromGraph);
     $factory = new GraphNodeFactory($this->responseMock);
     $graphNode = $factory->makeGraphSessionInfo();
     $expires = $graphNode->getExpiresAt();
     $issuedAt = $graphNode->getIssuedAt();
     $this->assertInstanceOf('DateTime', $expires);
     $this->assertInstanceOf('DateTime', $issuedAt);
 }
예제 #2
0
 /**
  * Convenience method for creating a GraphSessionInfo collection.
  *
  * @return \Facebook\GraphNodes\GraphSessionInfo
  *
  * @throws FacebookSDKException
  */
 public function getGraphSessionInfo()
 {
     $factory = new GraphNodeFactory($this);
     return $factory->makeGraphSessionInfo();
 }