Skip to content

Commit 3f0ec97

Browse files
committed
DX-25 : Deleting tests
1 parent 919fd8b commit 3f0ec97

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+149
-142
lines changed

src/AkeneoPimClientBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
use Akeneo\Pim\ApiClient\Client\CachedResourceClient;
4747
use Akeneo\Pim\ApiClient\Client\HttpClient;
4848
use Akeneo\Pim\ApiClient\Client\Options;
49+
use Akeneo\Pim\ApiClient\Client\ClientInterface;
4950
use Akeneo\Pim\ApiClient\Client\ResourceClient;
5051
use Akeneo\Pim\ApiClient\FileSystem\FileSystemInterface;
5152
use Akeneo\Pim\ApiClient\FileSystem\LocalFileSystem;
@@ -57,7 +58,6 @@
5758
use Akeneo\Pim\ApiClient\Stream\UpsertResourceListResponseFactory;
5859
use Http\Discovery\Psr17FactoryDiscovery;
5960
use Http\Discovery\Psr18ClientDiscovery;
60-
use Psr\Http\Client\ClientInterface;
6161
use Psr\Http\Message\RequestFactoryInterface;
6262
use Psr\Http\Message\StreamFactoryInterface;
6363

@@ -295,7 +295,7 @@ protected function setUp(Authentication $authentication): array
295295
return [$resourceClient, $pageFactory, $cursorFactory, $fileSystem];
296296
}
297297

298-
private function getHttpClient(): ClientInterface
298+
private function getHttpClient(): ClientInterface|\Psr\Http\Client\ClientInterface
299299
{
300300
if (null === $this->httpClient) {
301301
$this->httpClient = Psr18ClientDiscovery::find();

src/Api/AppCatalog/AppCatalogApi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Akeneo\Pim\ApiClient\Pagination\PageInterface;
1111
use Akeneo\Pim\ApiClient\Pagination\ResourceCursorFactoryInterface;
1212
use Akeneo\Pim\ApiClient\Pagination\ResourceCursorInterface;
13-
use GuzzleHttp\Promise\PromiseInterface;
13+
use Http\Promise\Promise;
1414

1515
/**
1616
* @copyright 2022 Akeneo SAS (https://www.akeneo.com)
@@ -62,7 +62,7 @@ public function delete(string $code): int
6262
return $this->resourceClient->deleteResource(static::APP_CATALOG_URI, [$code]);
6363
}
6464

65-
public function upsertAsync(string $code, array $data = [], callable $onSuccess = null, callable $onFail = null): PromiseInterface
65+
public function upsertAsync(string $code, array $data = [], callable $onSuccess = null, callable $onFail = null): Promise
6666
{
6767
return $this->resourceClient->upsertAsyncAndReturnPromise(static::APP_CATALOG_URI, [$code], $data, $onSuccess, $onFail);
6868
}

src/Api/AppCatalog/AppCatalogApiInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Akeneo\Pim\ApiClient\Api\Operation\DeletableResourceInterface;
88
use Akeneo\Pim\ApiClient\Api\Operation\GettableResourceInterface;
99
use Akeneo\Pim\ApiClient\Api\Operation\ListableResourceInterface;
10-
use GuzzleHttp\Promise\PromiseInterface;
10+
use Http\Promise\Promise;
1111

1212
/**
1313
* @copyright 2022 Akeneo SAS (https://www.akeneo.com)
@@ -21,5 +21,5 @@ interface AppCatalogApiInterface extends
2121
public function create(array $data): array;
2222

2323
public function upsert(string $code, array $data = []): array;
24-
public function upsertAsync(string $code, array $data = [], callable $onSuccess = null, callable $onFail = null): PromiseInterface;
24+
public function upsertAsync(string $code, array $data = [], callable $onSuccess = null, callable $onFail = null): Promise;
2525
}

src/Api/AssetApi.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Akeneo\Pim\ApiClient\Pagination\PageInterface;
1111
use Akeneo\Pim\ApiClient\Pagination\ResourceCursorFactoryInterface;
1212
use Akeneo\Pim\ApiClient\Pagination\ResourceCursorInterface;
13-
use GuzzleHttp\Promise\PromiseInterface;
13+
use Http\Promise\Promise;
1414
use Psr\Http\Message\StreamInterface;
1515

1616
/**
@@ -91,7 +91,7 @@ public function upsert(string $code, array $data = []): int
9191
return $this->resourceClient->upsertResource(static::ASSET_URI, [$code], $data);
9292
}
9393

94-
public function upsertAsync (string $code, array $data = [], callable $onSuccess = null, callable $onFail = null): PromiseInterface
94+
public function upsertAsync(string $code, array $data = [], callable $onSuccess = null, callable $onFail = null): Promise
9595
{
9696
return $this->resourceClient->upsertAsyncResource(static::ASSET_URI, [$code], $data, $onSuccess, $onFail);
9797
}
@@ -104,7 +104,7 @@ public function upsertList($resources): \Traversable
104104
return $this->resourceClient->upsertStreamResourceList(static::ASSETS_URI, [], $resources);
105105
}
106106

107-
public function upsertAsyncList (StreamInterface|array $resources, callable $onSuccess = null, callable $onFail = null): PromiseInterface
107+
public function upsertAsyncList(StreamInterface|array $resources, callable $onSuccess = null, callable $onFail = null): Promise
108108
{
109109
return $this->resourceClient->upsertAsyncStreamResourceList(self::ASSETS_URI, [], $resources, $onSuccess, $onFail);
110110
}

src/Api/AssetCategoryApi.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Akeneo\Pim\ApiClient\Pagination\PageInterface;
1111
use Akeneo\Pim\ApiClient\Pagination\ResourceCursorFactoryInterface;
1212
use Akeneo\Pim\ApiClient\Pagination\ResourceCursorInterface;
13-
use GuzzleHttp\Promise\PromiseInterface;
13+
use Http\Promise\Promise;
1414
use Psr\Http\Message\StreamInterface;
1515

1616
/**
@@ -76,7 +76,7 @@ public function upsert(string $code, array $data = []): int
7676
return $this->resourceClient->upsertResource(static::ASSET_CATEGORY_URI, [$code], $data);
7777
}
7878

79-
public function upsertAsync (string $code, array $data = [], callable $onSuccess = null, callable $onFail = null): PromiseInterface
79+
public function upsertAsync(string $code, array $data = [], callable $onSuccess = null, callable $onFail = null): Promise
8080
{
8181
return $this->resourceClient->upsertAsyncResource(static::ASSET_CATEGORY_URI, [$code], $data, $onSuccess, $onFail);
8282
}
@@ -103,7 +103,7 @@ public function create(string $code, array $data = []): int
103103
return $this->resourceClient->createResource(static::ASSET_CATEGORIES_URI, [], $data);
104104
}
105105

106-
public function upsertAsyncList (StreamInterface|array $resources, callable $onSuccess = null, callable $onFail = null): PromiseInterface
106+
public function upsertAsyncList(StreamInterface|array $resources, callable $onSuccess = null, callable $onFail = null): Promise
107107
{
108108
return $this->resourceClient->upsertAsyncStreamResourceList(static::ASSET_CATEGORIES_URI, [], $resources, $onSuccess, $onFail);
109109
}

src/Api/AssetManager/AssetApi.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Akeneo\Pim\ApiClient\Pagination\PageFactoryInterface;
99
use Akeneo\Pim\ApiClient\Pagination\ResourceCursorFactoryInterface;
1010
use Akeneo\Pim\ApiClient\Pagination\ResourceCursorInterface;
11-
use GuzzleHttp\Promise\PromiseInterface;
11+
use Http\Promise\Promise;
1212

1313
class AssetApi implements AssetApiInterface
1414
{
@@ -75,15 +75,15 @@ public function delete(string $assetFamilyCode, string $assetCode): int
7575
/**
7676
* {@inheritdoc}
7777
*/
78-
public function upsertAsync (string $assetFamilyCode, string $assetCode, array $data = [], callable $onSuccess = null, callable $onFail = null): PromiseInterface
78+
public function upsertAsync(string $assetFamilyCode, string $assetCode, array $data = [], callable $onSuccess = null, callable $onFail = null): Promise
7979
{
8080
return $this->resourceClient->upsertAsyncResource(static::ASSET_URI, [$assetFamilyCode, $assetCode], $data, $onSuccess, $onFail);
8181
}
8282

8383
/**
8484
* {@inheritdoc}
8585
*/
86-
public function upsertAsyncList (string $assetFamilyCode, array $assets, callable $onSuccess = null, callable $onFail = null): PromiseInterface
86+
public function upsertAsyncList(string $assetFamilyCode, array $assets, callable $onSuccess = null, callable $onFail = null): Promise
8787
{
8888
return $this->resourceClient->upsertAsyncJsonResourceList(static::ASSETS_URI, [$assetFamilyCode], $assets, $onSuccess, $onFail);
8989
}

src/Api/AssetManager/AssetApiInterface.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Akeneo\Pim\ApiClient\Exception\HttpException;
88
use Akeneo\Pim\ApiClient\Pagination\ResourceCursorInterface;
9-
use GuzzleHttp\Promise\PromiseInterface;
9+
use Http\Promise\Promise;
1010

1111
interface AssetApiInterface
1212
{
@@ -62,9 +62,9 @@ public function upsertList(string $assetFamilyCode, array $assets): array;
6262
*
6363
* @throws HttpException
6464
*
65-
* @return PromiseInterface
65+
* @return Promise
6666
*/
67-
public function upsertAsync(string $assetFamilyCode, string $assetCode, array $data = [], callable $onSuccess = null, callable $onFail = null): PromiseInterface;
67+
public function upsertAsync(string $assetFamilyCode, string $assetCode, array $data = [], callable $onSuccess = null, callable $onFail = null): Promise;
6868

6969
/**
7070
* Updates or creates several assets.
@@ -74,9 +74,9 @@ public function upsertAsync(string $assetFamilyCode, string $assetCode, array $d
7474
*
7575
* @throws HttpException
7676
*
77-
* @return PromiseInterface
77+
* @return Promise
7878
*/
79-
public function upsertAsyncList(string $assetFamilyCode, array $assets, callable $onSuccess = null, callable $onFail = null): PromiseInterface;
79+
public function upsertAsyncList(string $assetFamilyCode, array $assets, callable $onSuccess = null, callable $onFail = null): Promise;
8080

8181
/**
8282
* Deletes an asset.

src/Api/AssetManager/AssetAttributeApi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Akeneo\Pim\ApiClient\Api\AssetManager;
66

77
use Akeneo\Pim\ApiClient\Client\ResourceClientInterface;
8-
use GuzzleHttp\Promise\PromiseInterface;
8+
use Http\Promise\Promise;
99

1010
class AssetAttributeApi implements AssetAttributeApiInterface
1111
{
@@ -44,7 +44,7 @@ public function upsert(string $assetFamilyCode, string $attributeCode, array $da
4444
/**
4545
* {@inheritdoc}
4646
*/
47-
public function upsertAsync (string $assetFamilyCode, string $attributeCode, array $data = [], callable $onSuccess = null, callable $onFail = null): PromiseInterface
47+
public function upsertAsync(string $assetFamilyCode, string $attributeCode, array $data = [], callable $onSuccess = null, callable $onFail = null): Promise
4848
{
4949
return $this->resourceClient->upsertAsyncResource(static::ASSET_ATTRIBUTE_URI, [$assetFamilyCode, $attributeCode], $data, $onSuccess, $onFail);
5050
}

src/Api/AssetManager/AssetAttributeApiInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Akeneo\Pim\ApiClient\Api\AssetManager;
66

77
use Akeneo\Pim\ApiClient\Exception\HttpException;
8-
use GuzzleHttp\Promise\PromiseInterface;
8+
use Http\Promise\Promise;
99

1010
interface AssetAttributeApiInterface
1111
{
@@ -38,7 +38,7 @@ public function upsert(string $assetFamilyCode, string $attributeCode, array $da
3838
*
3939
* @throws HttpException
4040
*
41-
* @return PromiseInterface
41+
* @return Promise
4242
*/
43-
public function upsertAsync(string $assetFamilyCode, string $attributeCode, array $data = [], callable $onSuccess = null, callable $onFail = null): PromiseInterface;
43+
public function upsertAsync(string $assetFamilyCode, string $attributeCode, array $data = [], callable $onSuccess = null, callable $onFail = null): Promise;
4444
}

src/Api/AssetManager/AssetAttributeOptionApi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Akeneo\Pim\ApiClient\Api\AssetManager;
66

77
use Akeneo\Pim\ApiClient\Client\ResourceClientInterface;
8-
use GuzzleHttp\Promise\PromiseInterface;
8+
use Http\Promise\Promise;
99

1010
class AssetAttributeOptionApi implements AssetAttributeOptionApiInterface
1111
{
@@ -51,7 +51,7 @@ public function upsert(string $assetFamilyCode, string $attributeCode, string $a
5151
);
5252
}
5353

54-
public function upsertAsync(string $assetFamilyCode, string $attributeCode, string $attributeOptionCode, array $data = []): PromiseInterface
54+
public function upsertAsync(string $assetFamilyCode, string $attributeCode, string $attributeOptionCode, array $data = [], ?callable $onSuccess = null, ?callable $onFail = null): Promise
5555
{
5656
return $this->resourceClient->upsertAsyncResource(
5757
static::ASSET_ATTRIBUTE_OPTION_URI,

0 commit comments

Comments
 (0)