From 130831248deb5e0a18666bfc04e9498388498c5b Mon Sep 17 00:00:00 2001 From: Drak Date: Sat, 3 Mar 2012 08:49:40 +0545 Subject: [PATCH] [HttpFoundation] Add and relocate tests. --- .../MemcacheSessionHandlerTest.php} | 0 .../MemcachedSessionHandlerTest.php} | 0 .../NativeFileSessionHandlerTest.php} | 0 .../NativeMemcacheSessionHandlerTest.php} | 0 .../NativeMemcachedSessionHandlerTest.php} | 0 .../NativeSqliteSessionHandlerTest.php} | 0 .../NullSessionHandlerTest.php} | 0 .../Storage/Proxy/AbstractProxyTest.php | 69 ++++++++++++++++++ .../Storage/Proxy/NativeProxyPHP53Test.php | 34 +++++++++ .../Storage/Proxy/NativeProxyPHP54Test.php | 30 ++++++++ .../Storage/Proxy/SessionHandlerProxyTest.php | 70 +++++++++++++++++++ ...StorageTest.php => SessionStorageTest.php} | 0 12 files changed, 203 insertions(+) rename tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/{MemcacheSessionStorageTest.php => Handler/MemcacheSessionHandlerTest.php} (100%) rename tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/{MemcachedSessionStorageTest.php => Handler/MemcachedSessionHandlerTest.php} (100%) rename tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/{NativeFileSessionStorageTest.php => Handler/NativeFileSessionHandlerTest.php} (100%) rename tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/{NativeMemcacheSessionStorageTest.php => Handler/NativeMemcacheSessionHandlerTest.php} (100%) rename tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/{NativeMemcachedSessionStorageTest.php => Handler/NativeMemcachedSessionHandlerTest.php} (100%) rename tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/{NativeSqliteSessionStorageTest.php => Handler/NativeSqliteSessionHandlerTest.php} (100%) rename tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/{NullSessionStorageTest.php => Handler/NullSessionHandlerTest.php} (100%) create mode 100644 tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxyTest.php create mode 100644 tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Proxy/NativeProxyPHP53Test.php create mode 100644 tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Proxy/NativeProxyPHP54Test.php create mode 100644 tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxyTest.php rename tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/{AbstractSessionStorageTest.php => SessionStorageTest.php} (100%) diff --git a/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/MemcacheSessionStorageTest.php b/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandlerTest.php similarity index 100% rename from tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/MemcacheSessionStorageTest.php rename to tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandlerTest.php diff --git a/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/MemcachedSessionStorageTest.php b/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandlerTest.php similarity index 100% rename from tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/MemcachedSessionStorageTest.php rename to tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandlerTest.php diff --git a/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/NativeFileSessionStorageTest.php b/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandlerTest.php similarity index 100% rename from tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/NativeFileSessionStorageTest.php rename to tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandlerTest.php diff --git a/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/NativeMemcacheSessionStorageTest.php b/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Handler/NativeMemcacheSessionHandlerTest.php similarity index 100% rename from tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/NativeMemcacheSessionStorageTest.php rename to tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Handler/NativeMemcacheSessionHandlerTest.php diff --git a/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/NativeMemcachedSessionStorageTest.php b/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Handler/NativeMemcachedSessionHandlerTest.php similarity index 100% rename from tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/NativeMemcachedSessionStorageTest.php rename to tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Handler/NativeMemcachedSessionHandlerTest.php diff --git a/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/NativeSqliteSessionStorageTest.php b/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Handler/NativeSqliteSessionHandlerTest.php similarity index 100% rename from tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/NativeSqliteSessionStorageTest.php rename to tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Handler/NativeSqliteSessionHandlerTest.php diff --git a/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/NullSessionStorageTest.php b/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandlerTest.php similarity index 100% rename from tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/NullSessionStorageTest.php rename to tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandlerTest.php diff --git a/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxyTest.php b/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxyTest.php new file mode 100644 index 0000000000..a968e2e0a3 --- /dev/null +++ b/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxyTest.php @@ -0,0 +1,69 @@ +proxy = new ConcreteProxy; + } + + protected function tearDown() + { + $this->proxy = null; + } + + public function testGetSaveHandlerName() + { + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + public function testIsSessionHandlerInterface() + { + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + public function testIsWrapper() + { + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + public function testIsActive() + { + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + public function testSetActive() + { + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + +} diff --git a/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Proxy/NativeProxyPHP53Test.php b/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Proxy/NativeProxyPHP53Test.php new file mode 100644 index 0000000000..b62ce8192b --- /dev/null +++ b/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Proxy/NativeProxyPHP53Test.php @@ -0,0 +1,34 @@ +=')) { + $this->markTestSkipped('Test skipped, only for PHP 5.3'); + } + } + + public function testIsWrapper() + { + $proxy = new NativeProxy(new NativeFileSessionHandler()); + $this->assertFalse($proxy->isWrapper()); + } + + public function testGetSaveHandlerName() + { + $name = ini_get('session.save_handler'); + $proxy = new NativeProxy(new NativeFileSessionHandler()); + $this->assertEquals($name, $proxy->getSaveHandlerName()); + } +} diff --git a/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Proxy/NativeProxyPHP54Test.php b/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Proxy/NativeProxyPHP54Test.php new file mode 100644 index 0000000000..f6c3d7aa75 --- /dev/null +++ b/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Proxy/NativeProxyPHP54Test.php @@ -0,0 +1,30 @@ +markTestSkipped('Test skipped, only for PHP 5.4'); + } + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testConstructor() + { + $proxy = new NativeProxy(new NativeFileSessionHandler()); + $this->assertTrue($proxy->isWrapper()); + } +} diff --git a/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxyTest.php b/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxyTest.php new file mode 100644 index 0000000000..fb7d36adda --- /dev/null +++ b/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxyTest.php @@ -0,0 +1,70 @@ +proxy = new SessionHandlerProxy(new NullSessionHandler()); + } + + protected function tearDown() + { + $this->proxy = null; + } + + public function testOpen() + { + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + public function testClose() + { + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + public function testRead() + { + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + public function testWrite() + { + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + public function testDestroy() + { + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + public function testGc() + { + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + +} diff --git a/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/AbstractSessionStorageTest.php b/tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/SessionStorageTest.php similarity index 100% rename from tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/AbstractSessionStorageTest.php rename to tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/SessionStorageTest.php