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