summaryrefslogtreecommitdiff
path: root/server/vendor/php-opencloud/common/tests/unit/Common/Api/OperationTest.php
diff options
context:
space:
mode:
authorEoleDev <EoleDev@outlook.fr>2016-04-14 16:28:25 +0200
committerEoleDev <EoleDev@outlook.fr>2016-04-14 16:28:25 +0200
commit31d2d0c158ad4daa3dde7a905f3c2e312c194f2e (patch)
tree43d761d2aec8265a22c0fdedcc365bacc10dc814 /server/vendor/php-opencloud/common/tests/unit/Common/Api/OperationTest.php
parent27730911d8c9253a4f5aa90450c57cdeca9d5d26 (diff)
parentb348dbc2266a3e8070a3951fb0bd8c19b852ec47 (diff)
Merge branch 'compute'
Conflicts: server/core/LibOverride/genTokenOptions.php
Diffstat (limited to 'server/vendor/php-opencloud/common/tests/unit/Common/Api/OperationTest.php')
-rwxr-xr-xserver/vendor/php-opencloud/common/tests/unit/Common/Api/OperationTest.php74
1 files changed, 0 insertions, 74 deletions
diff --git a/server/vendor/php-opencloud/common/tests/unit/Common/Api/OperationTest.php b/server/vendor/php-opencloud/common/tests/unit/Common/Api/OperationTest.php
deleted file mode 100755
index ea0f7c8..0000000
--- a/server/vendor/php-opencloud/common/tests/unit/Common/Api/OperationTest.php
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-
-namespace OpenCloud\Test\Common\Api;
-
-use OpenCloud\Common\Api\Operation;
-use OpenCloud\Common\Api\Parameter;
-use OpenCloud\Test\Fixtures\ComputeV2Api;
-
-class OperationTest extends \PHPUnit_Framework_TestCase
-{
- private $operation;
-
- public function setUp()
- {
- $def = (new ComputeV2Api())->postServer();
-
- $this->operation = new Operation($def);
- }
-
- public function test_it_reveals_whether_params_are_set_or_not()
- {
- $this->assertFalse($this->operation->hasParam('foo'));
- $this->assertTrue($this->operation->hasParam('name'));
- }
-
- public function test_it_gets_params()
- {
- $this->assertInstanceOf(Parameter::class, $this->operation->getParam('name'));
- }
-
- public function test_it_validates_params()
- {
- $this->assertTrue($this->operation->validate([
- 'name' => 'foo',
- 'imageId' => 'bar',
- 'flavorId' => 'baz',
- ]));
- }
-
- /**
- * @expectedException \Exception
- */
- public function test_exceptions_are_propagated()
- {
- $this->assertFalse($this->operation->validate([
- 'name' => true,
- 'imageId' => 'bar',
- 'flavorId' => 'baz',
- ]));
- }
-
- /**
- * @expectedException \Exception
- */
- public function test_an_exception_is_thrown_when_user_does_not_provide_required_options()
- {
- $this->operation->validate([]);
- }
-
- /**
- * @expectedException \Exception
- */
- public function test_it_throws_exception_when_user_provides_undefined_options()
- {
- $userData = ['name' => 'new_server', 'undefined_opt' => 'bah'];
-
- $this->operation->validate($userData);
- }
-
- public function test_it_gets_json_key()
- {
- $this->assertEquals('server', $this->operation->getJsonKey());
- }
-}