StorageTest.php 2.5 KB

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