Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"homepage": "https://github.com/php-opencloud/openstack",
"require": {
"php": "^7.2.5 || ^8.0",
"guzzlehttp/guzzle": "^7.0",
"guzzlehttp/psr7": ">=1.7",
"guzzlehttp/guzzle": "^7.5.1",
"guzzlehttp/psr7": "^1.9.1 || ^2.4.5",
"guzzlehttp/uri-template": "^0.2 || ^1.0",
"justinrainbow/json-schema": "^5.2 || ^6.0"
},
Expand Down
4 changes: 1 addition & 3 deletions samples/Images/v2/images/upload_binary_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

$image = $service->getImage('{imageId}');

$stream = function_exists('\GuzzleHttp\Psr7\stream_for')
? \GuzzleHttp\Psr7\stream_for(fopen('{fileName}', 'r'))
: \GuzzleHttp\Psr7\Utils::streamFor(fopen('{fileName}', 'r'));
$stream = \GuzzleHttp\Psr7\Utils::streamFor(fopen('{fileName}', 'r'));

$image->uploadData($stream);
4 changes: 1 addition & 3 deletions tests/unit/Common/Resource/OperatorResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ public function setUp(): void

public function test_it_retrieves_base_http_url()
{
$returnedUri = function_exists('\GuzzleHttp\Psr7\uri_for')
? \GuzzleHttp\Psr7\uri_for('http://foo.com')
: \GuzzleHttp\Psr7\Utils::uriFor('http://foo.com');
$returnedUri = \GuzzleHttp\Psr7\Utils::uriFor('http://foo.com');
$this->client->getConfig('base_uri')->shouldBeCalled()->willReturn($returnedUri);

$uri = $this->resource->testBaseUri();
Expand Down
12 changes: 3 additions & 9 deletions tests/unit/Images/v2/Models/ImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ public function setUp(): void

public function test_it_retrieves()
{
$returnedUri = function_exists('\GuzzleHttp\Psr7\uri_for')
? \GuzzleHttp\Psr7\uri_for('')
: \GuzzleHttp\Psr7\Utils::uriFor('');
$returnedUri = \GuzzleHttp\Psr7\Utils::uriFor('');

$this->client->getConfig('base_uri')->shouldBeCalled()->willReturn($returnedUri);

Expand Down Expand Up @@ -127,9 +125,7 @@ public function test_it_deactivates()

public function test_it_uploads_data_stream()
{
$stream = function_exists('\GuzzleHttp\Psr7\stream_for')
? \GuzzleHttp\Psr7\stream_for('data')
: \GuzzleHttp\Psr7\Utils::streamFor('data');
$stream = \GuzzleHttp\Psr7\Utils::streamFor('data');

$headers = ['Content-Type' => 'application/octet-stream'];

Expand All @@ -140,9 +136,7 @@ public function test_it_uploads_data_stream()

public function test_it_downloads_data()
{
$stream = function_exists('\GuzzleHttp\Psr7\stream_for')
? \GuzzleHttp\Psr7\stream_for('data')
: \GuzzleHttp\Psr7\Utils::streamFor('data');
$stream = \GuzzleHttp\Psr7\Utils::streamFor('data');

$headers = ['Content-Type' => 'application/octet-stream'];
$response = new Response(200, $headers, $stream);
Expand Down
8 changes: 2 additions & 6 deletions tests/unit/Images/v2/ServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ public function setUp(): void

public function test_it_creates_image()
{
$returnedUri = function_exists('\GuzzleHttp\Psr7\uri_for')
? \GuzzleHttp\Psr7\uri_for('')
: \GuzzleHttp\Psr7\Utils::uriFor('');
$returnedUri = \GuzzleHttp\Psr7\Utils::uriFor('');

$this->client
->getConfig('base_uri')
Expand Down Expand Up @@ -62,9 +60,7 @@ public function test_it_creates_image()

public function test_it_lists_images()
{
$returnedUri = function_exists('\GuzzleHttp\Psr7\uri_for')
? \GuzzleHttp\Psr7\uri_for('')
: \GuzzleHttp\Psr7\Utils::uriFor('');
$returnedUri = \GuzzleHttp\Psr7\Utils::uriFor('');

$this->client
->getConfig('base_uri')
Expand Down
4 changes: 1 addition & 3 deletions tests/unit/ObjectStore/v1/Models/ContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,7 @@ public function test_valid_segment_index_format()

public function test_it_chunks_according_to_provided_segment_size()
{
$stream = function_exists('\GuzzleHttp\Psr7\stream_for')
? \GuzzleHttp\Psr7\stream_for(implode('', range('A', 'X')))
: \GuzzleHttp\Psr7\Utils::streamFor(implode('', range('A', 'X')));
$stream = \GuzzleHttp\Psr7\Utils::streamFor(implode('', range('A', 'X')));

$data = [
'name' => 'object',
Expand Down
Loading