HttpTest.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Amf
  17. * @subpackage UnitTests
  18. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. if (!defined('PHPUnit_MAIN_METHOD')) {
  23. define('PHPUnit_MAIN_METHOD', 'Zend_Amf_Response_HttpTest::main');
  24. }
  25. /**
  26. * @see Zend_Amf_Response_Http
  27. */
  28. require_once 'Zend/Amf/Response/Http.php';
  29. /**
  30. * Test case for Zend_Amf_Response
  31. *
  32. * @category Zend
  33. * @package Zend_Amf
  34. * @subpackage UnitTests
  35. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  36. * @license http://framework.zend.com/license/new-bsd New BSD License
  37. * @group Zend_Amf
  38. * @group Zend_Amf_Response
  39. */
  40. class Zend_Amf_Response_HttpTest extends PHPUnit_Framework_TestCase
  41. {
  42. /**
  43. * Runs the test methods of this class.
  44. *
  45. * @return void
  46. */
  47. public static function main()
  48. {
  49. $suite = new PHPUnit_Framework_TestSuite("Zend_Amf_Response_HttpTest");
  50. $result = PHPUnit_TextUI_TestRunner::run($suite);
  51. }
  52. /**
  53. * Ensure isIeOverSsl() does not emit a notice when $_SERVER['HTTPS'] not set
  54. * @group ZF-11783
  55. */
  56. public function testDoesNotEmitNoticeWhenHttpsServerKeyNotSet()
  57. {
  58. unset($_SERVER['HTTPS']);
  59. $req = new ZF11783_ExposeIsIeOverSsl();
  60. $this->assertFalse($req->isIeOverSsl());
  61. }
  62. }
  63. /**
  64. * Expose Zend_Amf_Response_Http::isIeOverSsl for testing
  65. * @see ZF-11783
  66. */
  67. class ZF11783_ExposeIsIeOverSsl extends Zend_Amf_Response_Http
  68. {
  69. public function isIeOverSsl() {
  70. return parent::isIeOverSsl();
  71. }
  72. }
  73. if (PHPUnit_MAIN_METHOD == 'Zend_Amf_Response_HttpTest::main') {
  74. Zend_Amf_Response_HttpTest::main();
  75. }