Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[HttpFoundation] Increase test coverage.

  • Loading branch information...
commit cbb3e69b36a46c13590bb89c29b3b3f60f7e73b5 1 parent b80951c
Drak authored
View
7 tests/Symfony/Tests/Component/HttpFoundation/Session/Attribute/AttributeBagTest.php
@@ -64,6 +64,13 @@ public function testGetStorageKey()
$this->assertEquals('test', $attributeBag->getStorageKey());
}
+ public function testGetSetName()
+ {
+ $this->assertEquals('attributes', $this->bag->getName());
+ $this->bag->setName('foo');
+ $this->assertEquals('foo', $this->bag->getName());
+ }
+
/**
* @dataProvider attributesProvider
*/
View
20 tests/Symfony/Tests/Component/HttpFoundation/Session/SessionTest.php
@@ -70,6 +70,16 @@ public function testSet($key, $value)
$this->assertEquals($value, $this->session->get($key));
}
+ /**
+ * @dataProvider setProvider
+ */
+ public function testHas($key, $value)
+ {
+ $this->session->set($key, $value);
+ $this->assertTrue($this->session->has($key));
+ $this->assertFalse($this->session->has($key.'non_value'));
+ }
+
public function testReplace()
{
$this->session->replace(array('happiness' => 'be good', 'symfony' => 'awesome'));
@@ -139,6 +149,11 @@ public function testMigrateDestroy()
$this->assertEquals(333, $this->session->get('migrate'));
}
+ public function testSave()
+ {
+ $this->session->save();
+ }
+
public function testGetId()
{
$this->assertEquals('', $this->session->getId());
@@ -146,6 +161,11 @@ public function testGetId()
$this->assertNotEquals('', $this->session->getId());
}
+ public function testGetFlashBag()
+ {
+ $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface', $this->session->getFlashBag());
+ }
+
// deprecated since 2.1, will be removed from 2.3
public function testGetSetFlashes()
Please sign in to comment.
Something went wrong with that request. Please try again.