|
5 | 5 | use Akeneo\Pim\ApiClient\AkeneoPimClientBuilder; |
6 | 6 | use Akeneo\Pim\ApiClient\AkeneoPimClientInterface; |
7 | 7 | use Akeneo\Pim\ApiClient\Api\AuthenticationApi; |
8 | | -use Akeneo\Pim\ApiClient\Api\ProductMediaFileApi; |
9 | | -use Akeneo\Pim\ApiClient\Exception\RuntimeException; |
10 | 8 | use donatj\MockWebServer\MockWebServer; |
11 | 9 | use donatj\MockWebServer\Response; |
12 | 10 | use donatj\MockWebServer\ResponseStack; |
@@ -69,43 +67,4 @@ private function getAuthenticatedJson() |
69 | 67 | } |
70 | 68 | JSON; |
71 | 69 | } |
72 | | - |
73 | | - /** |
74 | | - * Extracts the code of a media-file from a creation response. |
75 | | - * |
76 | | - * @param $response |
77 | | - * |
78 | | - * @throws RuntimeException if unable to extract the code |
79 | | - * |
80 | | - * @return mixed |
81 | | - */ |
82 | | - protected function extractCodeFromCreationResponse($response) |
83 | | - { |
84 | | - $headers = $response->getHeaders(); |
85 | | - |
86 | | - if (!isset($headers['Location'][0])) { |
87 | | - throw new RuntimeException('The response does not contain the URI of the created media-file.'); |
88 | | - } |
89 | | - |
90 | | - $matches = []; |
91 | | - if (1 !== preg_match(ProductMediaFileApi::MEDIA_FILE_URI_CODE_REGEX, $headers['Location'][0], $matches)) { |
92 | | - throw new RuntimeException('Unable to find the code in the URI of the created media-file.'); |
93 | | - } |
94 | | - |
95 | | - return $matches['code']; |
96 | | - } |
97 | | - |
98 | | - /** |
99 | | - * @param CursorInterface $result |
100 | | - * @param array $expected |
101 | | - */ |
102 | | - protected function assertSameResults() |
103 | | - { |
104 | | - $products = []; |
105 | | - foreach ($result as $product) { |
106 | | - $products[] = $product->getIdentifier(); |
107 | | - } |
108 | | - |
109 | | - $this->assertSame($products, $expected); |
110 | | - } |
111 | 70 | } |
0 commit comments