StompTest.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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_Queue
  17. * @subpackage UnitTests
  18. * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id: AllTests.php 13626 2009-01-14 18:24:57Z matthew $
  21. */
  22. /*
  23. * The adapter test class provides a universal test class for all of the
  24. * abstract methods.
  25. *
  26. * All methods marked not supported are explictly checked for for throwing
  27. * an exception.
  28. */
  29. /** PHPUnit Test Case */
  30. require_once 'PHPUnit/Framework/TestCase.php';
  31. /** TestHelp.php */
  32. require_once dirname(__FILE__) . '/../../../TestHelper.php';
  33. /** Zend_Queue */
  34. require_once 'Zend/Queue.php';
  35. /** Zend_Queue */
  36. require_once 'Zend/Queue/Message.php';
  37. /** Zend_Queue_Message_Test */
  38. require_once 'MessageTestClass.php';
  39. /** Base Adapter test class */
  40. require_once dirname(__FILE__) . '/AdapterTest.php';
  41. class Zend_Queue_Adapter_StompTest extends Zend_Queue_Adapter_AdapterTest
  42. {
  43. /**
  44. * getAdapterName() is an method to help make AdapterTest work with any
  45. * new adapters
  46. *
  47. * You must overload this method
  48. *
  49. * @return string
  50. */
  51. public function getAdapterName()
  52. {
  53. return 'Stomp';
  54. }
  55. /**
  56. * getAdapterName() is an method to help make AdapterTest work with any
  57. * new adapters
  58. *
  59. * You may overload this method. The default return is
  60. * 'Zend_Queue_Adapter_' . $this->getAdapterName()
  61. *
  62. * @return string
  63. */
  64. public function getAdapterFullName()
  65. {
  66. return 'Zend_Queue_Adapter_' . $this->getAdapterName();
  67. }
  68. public function getTestConfig()
  69. {
  70. return array('driverOptions' => array('host' => '127.0.0.1',
  71. 'port' => '61613'));
  72. }
  73. /**
  74. * Stomped requires specific name types
  75. */
  76. public function createQueueName($name)
  77. {
  78. return '/temp-queue/' . $name;
  79. }
  80. public function testConst()
  81. {
  82. /**
  83. * @see Zend_Queue_Adapter_Stomp
  84. */
  85. require_once 'Zend/Queue/Adapter/Stomp.php';
  86. $this->assertTrue(is_string(Zend_Queue_Adapter_Stomp::DEFAULT_SCHEME));
  87. $this->assertTrue(is_string(Zend_Queue_Adapter_Stomp::DEFAULT_HOST));
  88. $this->assertTrue(is_integer(Zend_Queue_Adapter_Stomp::DEFAULT_PORT));
  89. }
  90. }