|
@@ 383-394 (lines=12) @@
|
| 380 |
|
$this->assertFalse((new Type('image/png'))->wildcardMatch('image/foo')); |
| 381 |
|
} |
| 382 |
|
|
| 383 |
|
public function testAddParameter() |
| 384 |
|
{ |
| 385 |
|
$mt = new Type('image/png; foo=bar'); |
| 386 |
|
$mt->addParameter('baz', 'val', 'this is a comment'); |
| 387 |
|
$res = $mt->toString(); |
| 388 |
|
$this->assertContains('foo=', $res); |
| 389 |
|
$this->assertContains('bar', $res); |
| 390 |
|
$this->assertContains('baz=', $res); |
| 391 |
|
$this->assertContains('val', $res); |
| 392 |
|
$this->assertContains('(this is a comment)', $res); |
| 393 |
|
$this->assertSame('image/png; foo="bar"; baz="val" (this is a comment)', $res); |
| 394 |
|
} |
| 395 |
|
|
| 396 |
|
public function testRemoveParameter() |
| 397 |
|
{ |
|
@@ 396-406 (lines=11) @@
|
| 393 |
|
$this->assertSame('image/png; foo="bar"; baz="val" (this is a comment)', $res); |
| 394 |
|
} |
| 395 |
|
|
| 396 |
|
public function testRemoveParameter() |
| 397 |
|
{ |
| 398 |
|
$mt = new Type('image/png; foo=bar'); |
| 399 |
|
$mt->addParameter('baz', 'val', 'this is a comment'); |
| 400 |
|
$mt->removeParameter('foo'); |
| 401 |
|
$res = $mt->toString(); |
| 402 |
|
$this->assertNotContains('foo=', $res); |
| 403 |
|
$this->assertNotContains('bar', $res); |
| 404 |
|
$this->assertContains('baz=', $res); |
| 405 |
|
$this->assertSame('image/png; baz="val" (this is a comment)', $res); |
| 406 |
|
} |
| 407 |
|
|
| 408 |
|
public function testGetDefaultExtension() |
| 409 |
|
{ |