ApachemqTest.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. class Zend_Queue_Adapter_ApachemqTest extends Zend_Queue_Adapter_AdapterTest
  34. {
  35. /**
  36. * getAdapterName() is an method to help make AdapterTest work with any
  37. * new adapters
  38. *
  39. * You must overload this method
  40. *
  41. * @return string
  42. */
  43. public function getAdapterName()
  44. {
  45. return 'Apachemq';
  46. }
  47. public function getTestConfig()
  48. {
  49. $driverOptions = array();
  50. if (defined('TESTS_ZEND_QUEUE_APACHEMQ_HOST')) {
  51. $driverOptions['host'] = TESTS_ZEND_QUEUE_APACHEMQ_HOST;
  52. }
  53. if (defined('TESTS_ZEND_QUEUE_APACHEMQ_PORT')) {
  54. $driverOptions['port'] = TESTS_ZEND_QUEUE_APACHEMQ_PORT;
  55. }
  56. return array('driverOptions' => $driverOptions);
  57. }
  58. /**
  59. * Stomped requires specific name types
  60. */
  61. public function createQueueName($name)
  62. {
  63. return '/temp-queue/' . $name;
  64. }
  65. public function testConst()
  66. {
  67. /**
  68. * @see Zend_Queue_Adapter_Stomp
  69. */
  70. require_once 'Zend/Queue/Adapter/Apachemq.php';
  71. $this->assertTrue(is_string(Zend_Queue_Adapter_Apachemq::DEFAULT_SCHEME));
  72. $this->assertTrue(is_string(Zend_Queue_Adapter_Apachemq::DEFAULT_HOST));
  73. $this->assertTrue(is_integer(Zend_Queue_Adapter_Apachemq::DEFAULT_PORT));
  74. }
  75. }