MoveToHttpTest.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  4. * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  5. *
  6. * Licensed under The MIT License
  7. * For full copyright and license information, please see the LICENSE.txt
  8. * Redistributions of files must retain the above copyright notice.
  9. *
  10. * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  11. * @link http://cakephp.org CakePHP(tm) Project
  12. * @since 3.4.3
  13. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  14. */
  15. namespace Cake\Test\TestCase\Network;
  16. use Cake\Http\Response as HttpResponse;
  17. use Cake\Http\ServerRequest as HttpRequest;
  18. use Cake\Network\Request as NetworkRequest;
  19. use Cake\Network\Response as NetworkResponse;
  20. use Cake\TestSuite\TestCase;
  21. /**
  22. * ensure that backwards compatibility was ensured for old Cake\Network\* classes
  23. */
  24. class MoveToHttpTest extends TestCase
  25. {
  26. /**
  27. * Tests the Cake\Http\Response loaded from Cake\Network\Response correctly
  28. *
  29. * @return void
  30. */
  31. public function testResponse()
  32. {
  33. $response = new NetworkResponse();
  34. $this->assertInstanceOf('Cake\Http\Response', $response);
  35. $this->assertInstanceOf('Cake\Network\Response', $response);
  36. $response = new HttpResponse();
  37. $this->assertInstanceOf('Cake\Http\Response', $response);
  38. $this->assertInstanceOf('Cake\Network\Response', $response);
  39. }
  40. /**
  41. * Tests the Cake\Http\ServerRequest loaded from Cake\Network\Request correctly
  42. *
  43. * @return void
  44. */
  45. public function testRequest()
  46. {
  47. $request = new NetworkRequest();
  48. $this->assertInstanceOf('Cake\Http\ServerRequest', $request);
  49. $this->assertInstanceOf('Cake\Network\Request', $request);
  50. $request = new HttpRequest();
  51. $this->assertInstanceOf('Cake\Http\ServerRequest', $request);
  52. $this->assertInstanceOf('Cake\Network\Request', $request);
  53. }
  54. }