From 677953067f2bb5502a70f0d004f1ac844b18a128 Mon Sep 17 00:00:00 2001 From: emkael Date: Mon, 16 Jan 2017 22:04:43 +0100 Subject: * Facebook support --- .../FacebookMemoryPersistentDataHandlerTest.php | 46 ++++++++++++++++ .../FacebookSessionPersistentDataHandlerTest.php | 62 ++++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 lib/facebook-graph-sdk/tests/PersistentData/FacebookMemoryPersistentDataHandlerTest.php create mode 100644 lib/facebook-graph-sdk/tests/PersistentData/FacebookSessionPersistentDataHandlerTest.php (limited to 'lib/facebook-graph-sdk/tests/PersistentData') diff --git a/lib/facebook-graph-sdk/tests/PersistentData/FacebookMemoryPersistentDataHandlerTest.php b/lib/facebook-graph-sdk/tests/PersistentData/FacebookMemoryPersistentDataHandlerTest.php new file mode 100644 index 0000000..2b09d29 --- /dev/null +++ b/lib/facebook-graph-sdk/tests/PersistentData/FacebookMemoryPersistentDataHandlerTest.php @@ -0,0 +1,46 @@ +set('foo', 'bar'); + $value = $handler->get('foo'); + + $this->assertEquals('bar', $value); + } + + public function testGettingAValueThatDoesntExistWillReturnNull() + { + $handler = new FacebookMemoryPersistentDataHandler(); + $value = $handler->get('does_not_exist'); + + $this->assertNull($value); + } +} diff --git a/lib/facebook-graph-sdk/tests/PersistentData/FacebookSessionPersistentDataHandlerTest.php b/lib/facebook-graph-sdk/tests/PersistentData/FacebookSessionPersistentDataHandlerTest.php new file mode 100644 index 0000000..e21d366 --- /dev/null +++ b/lib/facebook-graph-sdk/tests/PersistentData/FacebookSessionPersistentDataHandlerTest.php @@ -0,0 +1,62 @@ +set('foo', 'bar'); + + $this->assertEquals('bar', $_SESSION['FBRLH_foo']); + } + + public function testCanGetAValue() + { + $_SESSION['FBRLH_faz'] = 'baz'; + $handler = new FacebookSessionPersistentDataHandler($enableSessionCheck = false); + $value = $handler->get('faz'); + + $this->assertEquals('baz', $value); + } + + public function testGettingAValueThatDoesntExistWillReturnNull() + { + $handler = new FacebookSessionPersistentDataHandler($enableSessionCheck = false); + $value = $handler->get('does_not_exist'); + + $this->assertNull($value); + } +} -- cgit v1.2.3