[HttpFoundation] Increase test coverage.
This commit is contained in:
parent
b80951c21c
commit
cbb3e69b36
@ -64,6 +64,13 @@ class AttributeBagTest extends \PHPUnit_Framework_TestCase
|
||||
$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
|
||||
*/
|
||||
|
@ -70,6 +70,16 @@ class SessionTest extends \PHPUnit_Framework_TestCase
|
||||
$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 @@ class SessionTest extends \PHPUnit_Framework_TestCase
|
||||
$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 @@ class SessionTest extends \PHPUnit_Framework_TestCase
|
||||
$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()
|
||||
|
Reference in New Issue
Block a user