SimpleResponseTest.php 865 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace Dilab\Network;
  3. use Dilab\Network\Response;
  4. /**
  5. * Class SimpleResponseTest
  6. * @package Dilab\Network
  7. * @property $response Response
  8. */
  9. class SimpleResponseTest extends \PHPUnit_Framework_TestCase
  10. {
  11. protected function setUp()
  12. {
  13. $this->response = new SimpleResponse();
  14. }
  15. public function tearDown()
  16. {
  17. unset($this->response);
  18. parent::tearDown();
  19. }
  20. public function headerProvider()
  21. {
  22. return array(
  23. array(404,404),
  24. array(204,204),
  25. array(200,200),
  26. array(500,204),
  27. );
  28. }
  29. /**
  30. * @runInSeparateProcess
  31. * @dataProvider headerProvider
  32. */
  33. public function testHeader($statusCode, $expectd)
  34. {
  35. $this->response->header($statusCode);
  36. $this->assertEquals($expectd, http_response_code());
  37. }
  38. }