SmsValidationTest.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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_Service_DeveloperGarden
  17. * @subpackage UnitTests
  18. * @copyright Copyright (c) 2005-2010 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_Service_DeveloperGarden_SmsValidationTest::main');
  24. }
  25. /**
  26. * Test helper
  27. */
  28. require_once dirname(__FILE__) . '/../../../TestHelper.php';
  29. /**
  30. * @see Zend_Service_DeveloperGarden_SmsValidation
  31. */
  32. require_once 'Zend/Service/DeveloperGarden/SmsValidation.php';
  33. /**
  34. * Zend_Service_DeveloperGarden test case
  35. *
  36. * @category Zend
  37. * @package Zend_Service_DeveloperGarden
  38. * @subpackage UnitTests
  39. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  40. * @license http://framework.zend.com/license/new-bsd New BSD License
  41. * @version $Id$
  42. */
  43. class Zend_Service_DeveloperGarden_SmsValidationTest extends PHPUnit_Framework_TestCase
  44. {
  45. /**
  46. * @var Zend_Service_DeveloperGarden_SmsValidation_Mock
  47. */
  48. protected $_service = null;
  49. public static function main()
  50. {
  51. $suite = new PHPUnit_Framework_TestSuite(__CLASS__);
  52. PHPUnit_TextUI_TestRunner::run($suite);
  53. }
  54. public function setUp()
  55. {
  56. if (!defined('TESTS_ZEND_SERVICE_DEVELOPERGARDEN_ONLINE_ENABLED') ||
  57. TESTS_ZEND_SERVICE_DEVELOPERGARDEN_ONLINE_ENABLED !== true) {
  58. $this->markTestSkipped('TESTS_ZEND_SERVICE_DEVELOPERGARDEN_ONLINE_ENABLED is not enabled');
  59. }
  60. if (!defined('TESTS_ZEND_SERVICE_DEVELOPERGARDEN_ONLINE_LOGIN')) {
  61. define('TESTS_ZEND_SERVICE_DEVELOPERGARDEN_ONLINE_LOGIN', 'Unknown');
  62. }
  63. if (!defined('TESTS_ZEND_SERVICE_DEVELOPERGARDEN_ONLINE_PASSWORD')) {
  64. define('TESTS_ZEND_SERVICE_DEVELOPERGARDEN_ONLINE_PASSWORD', 'Unknown');
  65. }
  66. $config = array(
  67. 'username' => TESTS_ZEND_SERVICE_DEVELOPERGARDEN_ONLINE_LOGIN,
  68. 'password' => TESTS_ZEND_SERVICE_DEVELOPERGARDEN_ONLINE_PASSWORD,
  69. );
  70. $this->service = new Zend_Service_DeveloperGarden_SmsValidation_Mock($config);
  71. }
  72. public function testSmsValidation()
  73. {
  74. $this->markTestSkipped(
  75. 'This API isnt testable. It generates interaction with user and also SMS costs.'
  76. );
  77. }
  78. }
  79. class Zend_Service_DeveloperGarden_SmsValidation_Mock
  80. extends Zend_Service_DeveloperGarden_SmsValidation
  81. {
  82. }
  83. if (PHPUnit_MAIN_METHOD == 'Zend_Service_DeveloperGarden_SmsValidationTest::main') {
  84. Zend_Service_DeveloperGarden_SmsValidationTest::main();
  85. }