responsetest.php 888 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Copyright (c) 2015 Lukas Reschke <lukas@owncloud.com>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. namespace OC\Http\Client;
  9. use Guzzle\Stream\Stream;
  10. use GuzzleHttp\Message\Response as GuzzleResponse;
  11. /**
  12. * Class ResponseTest
  13. */
  14. class ResponseTest extends \Test\TestCase {
  15. /** @var Response */
  16. private $response;
  17. /** @var GuzzleResponse */
  18. private $guzzleResponse;
  19. public function setUp() {
  20. parent::setUp();
  21. $this->guzzleResponse = new GuzzleResponse(1337);
  22. $this->response = new Response($this->guzzleResponse);
  23. }
  24. public function testGetStatusCode() {
  25. $this->assertEquals(1337, $this->response->getStatusCode());
  26. }
  27. public function testGetHeader() {
  28. $this->guzzleResponse->setHeader('bar', 'foo');
  29. $this->assertEquals('foo', $this->response->getHeader('bar'));
  30. }
  31. }