You are here

public function AcceptHeaderItemTest::testQuality in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/AcceptHeaderItemTest.php \Symfony\Component\HttpFoundation\Tests\AcceptHeaderItemTest::testQuality()

File

vendor/symfony/http-foundation/Tests/AcceptHeaderItemTest.php, line 85

Class

AcceptHeaderItemTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testQuality() {
  $item = new AcceptHeaderItem('value', array());
  $this
    ->assertEquals(1.0, $item
    ->getQuality());
  $item
    ->setQuality(0.5);
  $this
    ->assertEquals(0.5, $item
    ->getQuality());
  $item
    ->setAttribute('q', 0.75);
  $this
    ->assertEquals(0.75, $item
    ->getQuality());
  $this
    ->assertFalse($item
    ->hasAttribute('q'));
}