-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement official API client mock (#20)
- Loading branch information
Showing
7 changed files
with
607 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Webgriffe\SyliusAkeneoPlugin\Integration\TestDouble; | ||
|
||
use Akeneo\Pim\ApiClient\Api\AttributeApiInterface; | ||
use Akeneo\Pim\ApiClient\Pagination\PageInterface; | ||
use Akeneo\Pim\ApiClient\Pagination\ResourceCursorInterface; | ||
|
||
final class AttributeApiMock implements AttributeApiInterface | ||
{ | ||
public function create(string $code, array $data = []): int | ||
{ | ||
// TODO: Implement create() method. | ||
} | ||
|
||
public function get(string $code): array | ||
{ | ||
return OfficialApiClientMock::jsonFileOrHttpNotFoundException( | ||
__DIR__ . '/../DataFixtures/ApiClientMock/Attribute/' . $code . '.json' | ||
); | ||
} | ||
|
||
public function listPerPage(int $limit = 10, bool $withCount = false, array $queryParameters = []): PageInterface | ||
{ | ||
// TODO: Implement listPerPage() method. | ||
} | ||
|
||
public function all(int $pageSize = 10, array $queryParameters = []): ResourceCursorInterface | ||
{ | ||
// TODO: Implement all() method. | ||
} | ||
|
||
public function upsert(string $code, array $data = []): int | ||
{ | ||
// TODO: Implement upsert() method. | ||
} | ||
|
||
public function upsertList($resources): \Traversable | ||
{ | ||
// TODO: Implement upsertList() method. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Webgriffe\SyliusAkeneoPlugin\Integration\TestDouble; | ||
|
||
use Akeneo\Pim\ApiClient\Api\AttributeOptionApiInterface; | ||
use Akeneo\Pim\ApiClient\Pagination\PageInterface; | ||
use Akeneo\Pim\ApiClient\Pagination\ResourceCursorInterface; | ||
|
||
final class AttributeOptionApiMock implements AttributeOptionApiInterface | ||
{ | ||
public function get($attributeCode, $code): array | ||
{ | ||
return OfficialApiClientMock::jsonFileOrHttpNotFoundException( | ||
__DIR__ . '/../DataFixtures/ApiClientMock/AttributeOption/' . $attributeCode . '/' . $code . '.json' | ||
); | ||
} | ||
|
||
public function listPerPage( | ||
$attributeCode, | ||
$limit = 10, | ||
$withCount = false, | ||
array $queryParameters = [] | ||
): PageInterface { | ||
// TODO: Implement listPerPage() method. | ||
} | ||
|
||
public function all($attributeCode, $pageSize = 10, array $queryParameters = []): ResourceCursorInterface | ||
{ | ||
// TODO: Implement all() method. | ||
} | ||
|
||
public function create($attributeCode, $attributeOptionCode, array $data = []): int | ||
{ | ||
// TODO: Implement create() method. | ||
} | ||
|
||
public function upsert($attributeCode, $attributeOptionCode, array $data = []): int | ||
{ | ||
// TODO: Implement upsert() method. | ||
} | ||
|
||
public function upsertList($attributeCode, $attributeOptions): \Traversable | ||
{ | ||
// TODO: Implement upsertList() method. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Webgriffe\SyliusAkeneoPlugin\Integration\TestDouble; | ||
|
||
use Akeneo\Pim\ApiClient\Api\FamilyVariantApiInterface; | ||
use Akeneo\Pim\ApiClient\Pagination\PageInterface; | ||
use Akeneo\Pim\ApiClient\Pagination\ResourceCursorInterface; | ||
|
||
final class FamilyVariantApiMock implements FamilyVariantApiInterface | ||
{ | ||
public function get($familyCode, $familyVariantCode): array | ||
{ | ||
return OfficialApiClientMock::jsonFileOrHttpNotFoundException( | ||
__DIR__ . '/../DataFixtures/ApiClientMock/FamilyVariant/' . $familyCode . '/' . $familyVariantCode . '.json' | ||
); | ||
} | ||
|
||
public function create($familyCode, $familyVariantCode, array $data = []): int | ||
{ | ||
// TODO: Implement create() method. | ||
} | ||
|
||
public function upsert($familyCode, $familyVariantCode, array $data = []): int | ||
{ | ||
// TODO: Implement upsert() method. | ||
} | ||
|
||
public function listPerPage( | ||
$familyCode, | ||
$limit = 10, | ||
$withCount = false, | ||
array $queryParameters = [] | ||
): PageInterface { | ||
// TODO: Implement listPerPage() method. | ||
} | ||
|
||
public function all($familyCode, $pageSize = 10, array $queryParameters = []): ResourceCursorInterface | ||
{ | ||
// TODO: Implement all() method. | ||
} | ||
|
||
public function upsertList($familyCode, $familyVariants): \Traversable | ||
{ | ||
// TODO: Implement upsertList() method. | ||
} | ||
} |
Oops, something went wrong.