Ec2Test.php 3.0 KB

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