From 677953067f2bb5502a70f0d004f1ac844b18a128 Mon Sep 17 00:00:00 2001 From: emkael Date: Mon, 16 Jan 2017 22:04:43 +0100 Subject: * Facebook support --- .../tests/GraphNodes/GraphSessionInfoTest.php | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 lib/facebook-graph-sdk/tests/GraphNodes/GraphSessionInfoTest.php (limited to 'lib/facebook-graph-sdk/tests/GraphNodes/GraphSessionInfoTest.php') diff --git a/lib/facebook-graph-sdk/tests/GraphNodes/GraphSessionInfoTest.php b/lib/facebook-graph-sdk/tests/GraphNodes/GraphSessionInfoTest.php new file mode 100644 index 0000000..2960c28 --- /dev/null +++ b/lib/facebook-graph-sdk/tests/GraphNodes/GraphSessionInfoTest.php @@ -0,0 +1,62 @@ +responseMock = m::mock('\\Facebook\\FacebookResponse'); + } + + 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); + } +} -- cgit v1.2.3