8000 [HttpFoundation] Add more tests. · symfony/symfony@9a5fc65 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9a5fc65

Browse files
author
Drak
committed
[HttpFoundation] Add more tests.
1 parent 68074a2 commit 9a5fc65

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

tests/Symfony/Tests/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxyTest.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,44 @@ public function testSetActive()
8989
$this->proxy->setActive(false);
9090
$this->assertFalse($this->proxy->isActive());
9191
}
92+
93+
/**
94+
* @runInSeparateProcess
95+
*/
96+
public function testName()
97+
{
98+
$this->assertEquals(session_name(), $this->proxy->getName());
99+
$this->proxy->setName('foo');
100+
$this->assertEquals('foo', $this->proxy->getName());
101+
$this->assertEquals(session_name(), $this->proxy->getName());
102+
}
103+
104+
/**
105+
* @expectedException \LogicException
106+
*/
107+
public function testNameException()
108+
{
109+
$this->proxy->setActive(true);
110+
$this->proxy->setName('foo');
111+
}
112+
113+
/**
114+
* @runInSeparateProcess
115+
*/
116+
public function testId()
117+
{
118+
$this->assertEquals(session_id(), $this->proxy->getId());
119+
$this->proxy->setId('foo');
120+
$this->assertEquals('foo', $this->proxy->getId());
121+
$this->assertEquals(session_id(), $this->proxy->getId());
122+
}
123+
124+
/**
125+
* @expectedException \LogicException
126+
*/
127+
public function testIdException()
128+
{
129+
$this->proxy->setActive(true);
130+
$this->proxy->setId('foo');
131+
}
92132
}

0 commit comments

Comments
 (0)
0