Skip to content

Commit 140fb81

Browse files
committed
refact(API-1925): Remove deprecated phpunit annotations
1 parent 29e1e0e commit 140fb81

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

tests/Api/AssetAttribute/GetAssetFamilyAttributeIntegration.php

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

77
use Akeneo\Pim\ApiClient\Api\AssetManager\AssetAttributeApi;
8+
use Akeneo\Pim\ApiClient\Exception\NotFoundHttpException;
89
use Akeneo\Pim\ApiClient\tests\Api\ApiTestCase;
910
use donatj\MockWebServer\RequestInfo;
1011
use donatj\MockWebServer\Response;
@@ -29,10 +30,6 @@ public function test_get_asset_family_attribute()
2930
Assert::assertEquals($familyAttribute, json_decode($this->getPackshotPreviewAttribute(), true));
3031
}
3132

32-
/**
33-
* @expectedException \Akeneo\Pim\ApiClient\Exception\NotFoundHttpException
34-
* @expectedExceptionMessage Resource `foo` does not exist.
35-
*/
3633
public function test_get_unknown_asset_family_attribute()
3734
{
3835
$this->server->setResponseOfPath(
@@ -43,6 +40,10 @@ public function test_get_unknown_asset_family_attribute()
4340
);
4441

4542
$api = $this->createClientByPassword()->getAssetAttributeApi();
43+
44+
$this->expectException(NotFoundHttpException::class);
45+
$this->expectExceptionMessage('Resource `foo` does not exist.');
46+
4647
$api->get('packshot', 'foo');
4748
}
4849

tests/Api/AssetAttributeOption/GetAssetFamilyAttributeOptionIntegration.php

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

77
use Akeneo\Pim\ApiClient\Api\AssetManager\AssetAttributeOptionApi;
8+
use Akeneo\Pim\ApiClient\Exception\NotFoundHttpException;
89
use Akeneo\Pim\ApiClient\tests\Api\ApiTestCase;
910
use donatj\MockWebServer\RequestInfo;
1011
use donatj\MockWebServer\Response;
@@ -29,10 +30,6 @@ public function test_get_asset_family_attribute_option()
2930
Assert::assertEquals($familyAttributeOption, json_decode($this->getPackshotAttributeOption(), true));
3031
}
3132

32-
/**
33-
* @expectedException \Akeneo\Pim\ApiClient\Exception\NotFoundHttpException
34-
* @expectedExceptionMessage Resource `XLS` does not exist.
35-
*/
3633
public function test_get_unknown_asset_family_attribute_option()
3734
{
3835
$this->server->setResponseOfPath(
@@ -43,6 +40,10 @@ public function test_get_unknown_asset_family_attribute_option()
4340
);
4441

4542
$api = $this->createClientByPassword()->getAssetAttributeOptionApi();
43+
44+
$this->expectException(NotFoundHttpException::class);
45+
$this->expectExceptionMessage('Resource `XLS` does not exist.');
46+
4647
$api->get('packshot', 'wearing_model_size', 'XLS');
4748
}
4849

tests/Api/AssetFamily/GetAssetFamilyIntegration.php

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

77
use Akeneo\Pim\ApiClient\Api\AssetManager\AssetFamilyApi;
8+
use Akeneo\Pim\ApiClient\Exception\NotFoundHttpException;
89
use Akeneo\Pim\ApiClient\tests\Api\ApiTestCase;
910
use donatj\MockWebServer\RequestInfo;
1011
use donatj\MockWebServer\Response;
@@ -29,10 +30,6 @@ public function test_get_asset_family()
2930
Assert::assertEquals($product, json_decode($this->getPackshot(), true));
3031
}
3132

32-
/**
33-
* @expectedException \Akeneo\Pim\ApiClient\Exception\NotFoundHttpException
34-
* @expectedExceptionMessage Asset family "foo" does not exist.
35-
*/
3633
public function test_get_unknown_asset_family()
3734
{
3835
$this->server->setResponseOfPath(
@@ -43,6 +40,10 @@ public function test_get_unknown_asset_family()
4340
);
4441

4542
$api = $this->createClientByPassword()->getAssetFamilyApi();
43+
44+
$this->expectException(NotFoundHttpException::class);
45+
$this->expectExceptionMessage('Asset family "foo" does not exist.');
46+
4647
$api->get('foo');
4748
}
4849

0 commit comments

Comments
 (0)