Skip to content
Permalink
Browse files

Add test for withDownload()

  • Loading branch information...
markstory committed Dec 9, 2016
1 parent 549b65c commit 5be9f45f15e7f14b10b16ac405092bd17d93b33c
Showing with 15 additions and 0 deletions.
  1. +15 −0 tests/TestCase/Network/ResponseTest.php
@@ -666,6 +666,21 @@ public function testDownload()
$this->assertEquals($expected, $response->header());
}
/**
* Tests the withDownload method
*
* @return void
*/
public function testWithDownload()
{
$response = new Response();
$new = $response->withDownload('myfile.mp3');
$this->assertFalse($response->hasHeader('Content-Disposition'), 'No mutation');
$expected = 'attachment; filename="myfile.mp3"';
$this->assertEquals($expected, $new->getHeaderLine('Content-Disposition'));
}
/**
* Tests the mapType method
*

0 comments on commit 5be9f45

Please sign in to comment.
You can’t perform that action at this time.