83 lines
4.5 KiB
YAML
83 lines
4.5 KiB
YAML
name: SessionHandlerProxyTest
|
|
class_comment: '# * Tests for SessionHandlerProxy class.
|
|
|
|
# *
|
|
|
|
# * @author Drak <drak@zikula.org>
|
|
|
|
# *
|
|
|
|
# * @runTestsInSeparateProcesses
|
|
|
|
# *
|
|
|
|
# * @preserveGlobalState disabled'
|
|
dependencies:
|
|
- name: MockObject
|
|
type: class
|
|
source: PHPUnit\Framework\MockObject\MockObject
|
|
- name: TestCase
|
|
type: class
|
|
source: PHPUnit\Framework\TestCase
|
|
- name: StrictSessionHandler
|
|
type: class
|
|
source: Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler
|
|
- name: NativeSessionStorage
|
|
type: class
|
|
source: Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage
|
|
- name: SessionHandlerProxy
|
|
type: class
|
|
source: Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy
|
|
properties: []
|
|
methods:
|
|
- name: testNativeSessionStorageSaveHandlerName
|
|
visibility: public
|
|
parameters:
|
|
- name: handler
|
|
comment: "# * Tests for SessionHandlerProxy class.\n# *\n# * @author Drak <drak@zikula.org>\n\
|
|
# *\n# * @runTestsInSeparateProcesses\n# *\n# * @preserveGlobalState disabled\n\
|
|
# */\n# class SessionHandlerProxyTest extends TestCase\n# {\n# private MockObject&\\\
|
|
SessionHandlerInterface $mock;\n# \n# private SessionHandlerProxy $proxy;\n# \n\
|
|
# protected function setUp(): void\n# {\n# $this->mock = $this->createMock(\\\
|
|
SessionHandlerInterface::class);\n# $this->proxy = new SessionHandlerProxy($this->mock);\n\
|
|
# }\n# \n# public function testOpenTrue()\n# {\n# $this->mock->expects($this->once())\n\
|
|
# ->method('open')\n# ->willReturn(true);\n# \n# $this->assertFalse($this->proxy->isActive());\n\
|
|
# $this->proxy->open('name', 'id');\n# $this->assertFalse($this->proxy->isActive());\n\
|
|
# }\n# \n# public function testOpenFalse()\n# {\n# $this->mock->expects($this->once())\n\
|
|
# ->method('open')\n# ->willReturn(false);\n# \n# $this->assertFalse($this->proxy->isActive());\n\
|
|
# $this->proxy->open('name', 'id');\n# $this->assertFalse($this->proxy->isActive());\n\
|
|
# }\n# \n# public function testClose()\n# {\n# $this->mock->expects($this->once())\n\
|
|
# ->method('close')\n# ->willReturn(true);\n# \n# $this->assertFalse($this->proxy->isActive());\n\
|
|
# $this->proxy->close();\n# $this->assertFalse($this->proxy->isActive());\n# }\n\
|
|
# \n# public function testCloseFalse()\n# {\n# $this->mock->expects($this->once())\n\
|
|
# ->method('close')\n# ->willReturn(false);\n# \n# $this->assertFalse($this->proxy->isActive());\n\
|
|
# $this->proxy->close();\n# $this->assertFalse($this->proxy->isActive());\n# }\n\
|
|
# \n# public function testRead()\n# {\n# $this->mock->expects($this->once())\n\
|
|
# ->method('read')\n# ->willReturn('foo')\n# ;\n# \n# $this->proxy->read('id');\n\
|
|
# }\n# \n# public function testWrite()\n# {\n# $this->mock->expects($this->once())\n\
|
|
# ->method('write')\n# ->willReturn(true)\n# ;\n# \n# $this->assertTrue($this->proxy->write('id',\
|
|
\ 'data'));\n# }\n# \n# public function testDestroy()\n# {\n# $this->mock->expects($this->once())\n\
|
|
# ->method('destroy')\n# ->willReturn(true)\n# ;\n# \n# $this->assertTrue($this->proxy->destroy('id'));\n\
|
|
# }\n# \n# public function testGc()\n# {\n# $this->mock->expects($this->once())\n\
|
|
# ->method('gc')\n# ->willReturn(1)\n# ;\n# \n# $this->proxy->gc(86400);\n# }\n\
|
|
# \n# public function testValidateId()\n# {\n# $mock = $this->createMock(TestSessionHandler::class);\n\
|
|
# $mock->expects($this->once())\n# ->method('validateId');\n# \n# $proxy = new\
|
|
\ SessionHandlerProxy($mock);\n# $proxy->validateId('id');\n# \n# $this->assertTrue($this->proxy->validateId('id'));\n\
|
|
# }\n# \n# public function testUpdateTimestamp()\n# {\n# $mock = $this->createMock(TestSessionHandler::class);\n\
|
|
# $mock->expects($this->once())\n# ->method('updateTimestamp')\n# ->willReturn(false);\n\
|
|
# \n# $proxy = new SessionHandlerProxy($mock);\n# $proxy->updateTimestamp('id',\
|
|
\ 'data');\n# \n# $this->mock->expects($this->once())\n# ->method('write')\n#\
|
|
\ ->willReturn(true)\n# ;\n# \n# $this->proxy->updateTimestamp('id', 'data');\n\
|
|
# }\n# \n# /**\n# * @dataProvider provideNativeSessionStorageHandler"
|
|
- name: provideNativeSessionStorageHandler
|
|
visibility: public
|
|
parameters: []
|
|
comment: null
|
|
traits:
|
|
- PHPUnit\Framework\MockObject\MockObject
|
|
- PHPUnit\Framework\TestCase
|
|
- Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler
|
|
- Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage
|
|
- Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy
|
|
interfaces:
|
|
- \SessionHandlerInterface
|