Ec2Test.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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_Amazon
  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. require_once dirname(__FILE__) . '/../../../../TestHelper.php';
  23. require_once 'Zend/Service/Amazon/Ec2.php';
  24. /**
  25. * Zend_Service_Amazon_Ec2 test case.
  26. *
  27. * @category Zend
  28. * @package Zend_Service_Amazon
  29. * @subpackage UnitTests
  30. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  31. * @license http://framework.zend.com/license/new-bsd New BSD License
  32. * @group Zend_Service
  33. * @group Zend_Service_Amazon
  34. * @group Zend_Service_Amazon_Ec2
  35. */
  36. class Zend_Service_Amazon_Ec2_Ec2Test extends PHPUnit_Framework_TestCase
  37. {
  38. /**
  39. * @var Zend_Service_Amazon_Ec2
  40. */
  41. private $Zend_Service_Amazon_Ec2;
  42. /**
  43. * Prepares the environment before running a test.
  44. */
  45. protected function setUp()
  46. {
  47. parent::setUp();
  48. }
  49. /**
  50. * Cleans up the environment after running a test.
  51. */
  52. protected function tearDown()
  53. {
  54. parent::tearDown();
  55. }
  56. public function testFactoryReturnsKeyPairObject()
  57. {
  58. $object = Zend_Service_Amazon_Ec2::factory('keypair', 'access_key', 'secret_access_key');
  59. $this->assertType('Zend_Service_Amazon_Ec2_Keypair', $object);
  60. }
  61. public function testFactoryReturnsElasticIpObject()
  62. {
  63. $object = Zend_Service_Amazon_Ec2::factory('elasticip', 'access_key', 'secret_access_key');
  64. $this->assertType('Zend_Service_Amazon_Ec2_Elasticip', $object);
  65. }
  66. public function testFactoryReturnsEbsObject()
  67. {
  68. $object = Zend_Service_Amazon_Ec2::factory('ebs', 'access_key', 'secret_access_key');
  69. $this->assertType('Zend_Service_Amazon_Ec2_Ebs', $object);
  70. }
  71. public function testFactoryReturnImageObject()
  72. {
  73. $object = Zend_Service_Amazon_Ec2::factory('image', 'access_key', 'secret_access_key');
  74. $this->assertType('Zend_Service_Amazon_Ec2_Image', $object);
  75. }
  76. public function testFactoryReturnsInstanceObject()
  77. {
  78. $object = Zend_Service_Amazon_Ec2::factory('instance', 'access_key', 'secret_access_key');
  79. $this->assertType('Zend_Service_Amazon_Ec2_Instance', $object);
  80. }
  81. public function testFactoryReturnsSecurityGroupsObject()
  82. {
  83. $object = Zend_Service_Amazon_Ec2::factory('security', 'access_key', 'secret_access_key');
  84. $this->assertType('Zend_Service_Amazon_Ec2_Securitygroups', $object);
  85. }
  86. }