diff options
Diffstat (limited to 'server/vendor/php-opencloud/common/tests/unit')
5 files changed, 25 insertions, 12 deletions
diff --git a/server/vendor/php-opencloud/common/tests/unit/Common/Api/OperatorTest.php b/server/vendor/php-opencloud/common/tests/unit/Common/Api/OperatorTest.php index 43c5804..e22c25e 100644 --- a/server/vendor/php-opencloud/common/tests/unit/Common/Api/OperatorTest.php +++ b/server/vendor/php-opencloud/common/tests/unit/Common/Api/OperatorTest.php @@ -10,7 +10,6 @@ use GuzzleHttp\Psr7\Uri; use OpenCloud\Common\Api\Operator; use OpenCloud\Common\Resource\AbstractResource; use OpenCloud\Common\Resource\ResourceInterface; -use OpenCloud\Compute\v2\Models\Server; use OpenCloud\Test\Fixtures\ComputeV2Api; use OpenCloud\Test\TestCase; use Prophecy\Argument; @@ -45,7 +44,7 @@ class OperatorTest extends TestCase public function test_it_sends_a_request_when_operations_are_executed() { - $this->client->request('GET', 'test', ['headers' => []])->willReturn(new Request('GET', 'test')); + $this->client->request('GET', 'test', ['headers' => []])->willReturn(new Response()); $this->operator->execute($this->def, []); } diff --git a/server/vendor/php-opencloud/common/tests/unit/Common/Auth/AuthHandlerTest.php b/server/vendor/php-opencloud/common/tests/unit/Common/Auth/AuthHandlerTest.php index 3c77dde..d0d63cf 100644 --- a/server/vendor/php-opencloud/common/tests/unit/Common/Auth/AuthHandlerTest.php +++ b/server/vendor/php-opencloud/common/tests/unit/Common/Auth/AuthHandlerTest.php @@ -53,7 +53,11 @@ class AuthHandlerTest extends TestCase } } -class FakeToken implements Token { - public function getId() {} - public function hasExpired() {} +class FakeToken implements Token +{ + public function getId(): string + {} + + public function hasExpired(): bool + {} }
\ No newline at end of file diff --git a/server/vendor/php-opencloud/common/tests/unit/Common/JsonSchema/SchemaTest.php b/server/vendor/php-opencloud/common/tests/unit/Common/JsonSchema/SchemaTest.php index 22663ef..4aae8e5 100644 --- a/server/vendor/php-opencloud/common/tests/unit/Common/JsonSchema/SchemaTest.php +++ b/server/vendor/php-opencloud/common/tests/unit/Common/JsonSchema/SchemaTest.php @@ -95,8 +95,8 @@ class SchemaTest extends TestCase public function test_it_checks_validity() { - $this->validator->isValid()->shouldBeCalled(); + $this->validator->isValid()->shouldBeCalled()->willReturn(true); $this->schema->isValid(); } -} +}
\ No newline at end of file diff --git a/server/vendor/php-opencloud/common/tests/unit/Common/Transport/JsonSerializerTest.php b/server/vendor/php-opencloud/common/tests/unit/Common/Transport/JsonSerializerTest.php index 9075594..5e21833 100644 --- a/server/vendor/php-opencloud/common/tests/unit/Common/Transport/JsonSerializerTest.php +++ b/server/vendor/php-opencloud/common/tests/unit/Common/Transport/JsonSerializerTest.php @@ -47,8 +47,8 @@ class JsonSerializerTest extends \PHPUnit_Framework_TestCase $itemSchema = $this->prophesize(Parameter::class); $itemSchema->isArray()->shouldBeCalled()->willReturn(false); $itemSchema->isObject()->shouldBeCalled()->willReturn(false); - $itemSchema->getName()->shouldBeCalled()->willReturn(null); - $itemSchema->getPath()->shouldBeCalled()->willReturn(null); + $itemSchema->getName()->shouldBeCalled()->willReturn(''); + $itemSchema->getPath()->shouldBeCalled()->willReturn(''); $param->getItemSchema()->shouldBeCalled()->willReturn($itemSchema); @@ -67,7 +67,7 @@ class JsonSerializerTest extends \PHPUnit_Framework_TestCase $prop->isArray()->shouldBeCalled()->willReturn(false); $prop->isObject()->shouldBeCalled()->willReturn(false); $prop->getName()->shouldBeCalled()->willReturn('foo'); - $prop->getPath()->shouldBeCalled()->willReturn(null); + $prop->getPath()->shouldBeCalled()->willReturn(''); $param = $this->prophesize(Parameter::class); $param->isArray()->shouldBeCalled()->willReturn(false); @@ -78,7 +78,7 @@ class JsonSerializerTest extends \PHPUnit_Framework_TestCase $expected = ['topLevel' => ['foo' => true]]; - $json = $this->serializer->stockJson($param->reveal(), ['foo' => true], []); + $json = $this->serializer->stockJson($param->reveal(), (object) ['foo' => true], []); $this->assertEquals($expected, $json); } diff --git a/server/vendor/php-opencloud/common/tests/unit/Fixtures/ComputeV2Api.php b/server/vendor/php-opencloud/common/tests/unit/Fixtures/ComputeV2Api.php index d395d10..8c6858d 100644 --- a/server/vendor/php-opencloud/common/tests/unit/Fixtures/ComputeV2Api.php +++ b/server/vendor/php-opencloud/common/tests/unit/Fixtures/ComputeV2Api.php @@ -53,7 +53,17 @@ class ComputeV2Api implements ApiInterface ] ], 'name' => ['type' => 'string', 'required' => true], - 'metadata' => ['type' => 'object', 'location' => 'json'], + 'metadata' => [ + 'type' => 'object', + 'location' => 'json', + 'description' => 'An arbitrary key/value pairing that will be used for metadata.', + 'properties' => [ + 'type' => 'string', + 'description' => <<<TYPEOTHER +The value being set for your key. Bear in mind that "key" is just an example, you can name it anything. +TYPEOTHER + ] + ], 'personality' => ['type' => 'string'], 'blockDeviceMapping' => [ 'type' => 'array', |
