StorageTest.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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_WindowsAzure
  17. * @subpackage UnitTests
  18. * @version $Id: StorageTest.php 28585 2009-09-07 12:12:56Z unknown $
  19. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  20. * @license http://framework.zend.com/license/new-bsd New BSD License
  21. */
  22. require_once dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'TestHelper.php';
  23. if (!defined('PHPUnit_MAIN_METHOD')) {
  24. define('PHPUnit_MAIN_METHOD', 'Zend_Service_WindowsAzure_StorageTest::main');
  25. }
  26. require_once 'Zend/Service/WindowsAzure/Storage.php';
  27. /**
  28. * @category Zend
  29. * @package Zend_Service_WindowsAzure
  30. * @subpackage UnitTests
  31. * @group Zend_Service
  32. * @group Zend_Service_WindowsAzure
  33. * @version $Id: StorageTest.php 28585 2009-09-07 12:12:56Z unknown $
  34. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  35. * @license http://framework.zend.com/license/new-bsd New BSD License
  36. */
  37. class Zend_Service_WindowsAzure_StorageTest extends PHPUnit_Framework_TestCase
  38. {
  39. public static function main()
  40. {
  41. $suite = new PHPUnit_Framework_TestSuite("Zend_Service_WindowsAzure_BlobStorageTest");
  42. $result = PHPUnit_TextUI_TestRunner::run($suite);
  43. }
  44. /**
  45. * Test constructor for devstore
  46. */
  47. public function testConstructorForDevstore()
  48. {
  49. $storage = new Zend_Service_WindowsAzure_Storage();
  50. $this->assertEquals('http://127.0.0.1:10000/devstoreaccount1', $storage->getBaseUrl());
  51. }
  52. /**
  53. * Test constructor for production
  54. */
  55. public function testConstructorForProduction()
  56. {
  57. $storage = new Zend_Service_WindowsAzure_Storage(Zend_Service_WindowsAzure_Storage::URL_CLOUD_BLOB, 'testing', '');
  58. $this->assertEquals('http://testing.blob.core.windows.net', $storage->getBaseUrl());
  59. }
  60. }
  61. // Call Zend_Service_WindowsAzure_StorageTest::main() if this source file is executed directly.
  62. if (PHPUnit_MAIN_METHOD == "Zend_Service_WindowsAzure_StorageTest::main") {
  63. Zend_Service_WindowsAzure_StorageTest::main();
  64. }