public function AcceptHeaderItemTest::testAttribute in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/http-foundation/Tests/AcceptHeaderItemTest.php \Symfony\Component\HttpFoundation\Tests\AcceptHeaderItemTest::testAttribute()
File
- vendor/
symfony/ http-foundation/ Tests/ AcceptHeaderItemTest.php, line 98
Class
Namespace
Symfony\Component\HttpFoundation\TestsCode
public function testAttribute() {
$item = new AcceptHeaderItem('value', array());
$this
->assertEquals(array(), $item
->getAttributes());
$this
->assertFalse($item
->hasAttribute('test'));
$this
->assertNull($item
->getAttribute('test'));
$this
->assertEquals('default', $item
->getAttribute('test', 'default'));
$item
->setAttribute('test', 'value');
$this
->assertEquals(array(
'test' => 'value',
), $item
->getAttributes());
$this
->assertTrue($item
->hasAttribute('test'));
$this
->assertEquals('value', $item
->getAttribute('test'));
$this
->assertEquals('value', $item
->getAttribute('test', 'default'));
}