8000 [HttpFoundation] Increase test coverage. · symfony/symfony@cbb3e69 · GitHub
[go: up one dir, main page]

Skip to content

Commit cbb3e69

Browse files
author
Drak
committed
[HttpFoundation] Increase test coverage.
1 parent b80951c commit cbb3e69

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

tests/Symfony/Tests/Component/HttpFoundation/Session/Attribute/AttributeBagTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ public function testGetStorageKey()
6464
$this->assertEquals('test', $attributeBag->getStorageKey());
6565
}
6666

67+
public function testGetSetName()
68+
{
69+
$this->assertEquals('attributes', $this->bag->getName());
70+
$this->bag->setName('foo');
71+
$this->assertEquals('foo', $this->bag->getName());
72+
}
73+
6774
/**
6875
* @dataProvider attributesProvider
6976
*/

tests/Symfony/Tests/Component/HttpFoundation/Session/SessionTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@ public function testSet($key, $value)
7070
$this->assertEquals($value, $this->session->get($key));
7171
}
7272

73+
/**
74+
* @dataProvider setProvider
75+
*/
76+
public function testHas($key, $value)
77+
{
78+
$this->session->set($key, $value);
79+
$this->assertTrue($this->session->has($key));
80+
$this->assertFalse($this->session->has($key.'non_value'));
81+
}
82+
7383
public function testReplace()
7484
{
7585
$this->session->replace(array('happiness' => 'be good', 'symfony' => 'awesome'));
@@ -139,13 +149,23 @@ public function testMigrateDestroy()
139149
$this->assertEquals(333, $this->session->get('migrate'));
140150
}
141151

152+
public function testSave()
153+
{
154+
$this->session->save();
155+
}
156+
142157
public function testGetId()
143158
{
144159
$this->assertEquals('', $this->session->getId());
145160
$this->session->start();
146161
$this->assertNotEquals('', $this->session->getId());
147162
}
148163

164+
public function testGetFlashBag()
165+
{
166+
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface', $this->session->getFlashBag());
167+
}
168+
149169
// deprecated since 2.1, will be removed from 2.3
150170

151171
public function testGetSetFlashes()

0 commit comments

Comments
 (0)
0