| @@ 132-158 (lines=27) @@ | ||
| 129 | * @param int $added |
|
| 130 | * @param int $replaced |
|
| 131 | */ |
|
| 132 | protected function doImport($strategy, $added, $replaced) |
|
| 133 | { |
|
| 134 | // test import |
|
| 135 | $this->client->followRedirects(false); |
|
| 136 | $this->client->request( |
|
| 137 | 'GET', |
|
| 138 | $this->getUrl( |
|
| 139 | 'oro_importexport_import_process', |
|
| 140 | array( |
|
| 141 | 'processorAlias' => $strategy, |
|
| 142 | '_format' => 'json' |
|
| 143 | ) |
|
| 144 | ) |
|
| 145 | ); |
|
| 146 | ||
| 147 | $data = $this->getJsonResponseContent($this->client->getResponse(), 200); |
|
| 148 | ||
| 149 | $this->assertEquals( |
|
| 150 | [ |
|
| 151 | 'success' => true, |
|
| 152 | 'message' => 'File was successfully imported.', |
|
| 153 | 'errorsUrl' => null, |
|
| 154 | 'importInfo' => sprintf('%s entities were added, %s entities were updated', $added, $replaced) |
|
| 155 | ], |
|
| 156 | $data |
|
| 157 | ); |
|
| 158 | } |
|
| 159 | ||
| 160 | protected function doExport() |
|
| 161 | { |
|
| @@ 148-174 (lines=27) @@ | ||
| 145 | * @param int $added |
|
| 146 | * @param int $replaced |
|
| 147 | */ |
|
| 148 | protected function doImport($strategy, $added, $replaced) |
|
| 149 | { |
|
| 150 | // test import |
|
| 151 | $this->client->followRedirects(false); |
|
| 152 | $this->client->request( |
|
| 153 | 'GET', |
|
| 154 | $this->getUrl( |
|
| 155 | 'oro_importexport_import_process', |
|
| 156 | array( |
|
| 157 | 'processorAlias' => $strategy, |
|
| 158 | '_format' => 'json' |
|
| 159 | ) |
|
| 160 | ) |
|
| 161 | ); |
|
| 162 | ||
| 163 | $data = $this->getJsonResponseContent($this->client->getResponse(), 200); |
|
| 164 | ||
| 165 | $this->assertEquals( |
|
| 166 | [ |
|
| 167 | 'success' => true, |
|
| 168 | 'message' => 'File was successfully imported.', |
|
| 169 | 'errorsUrl' => null, |
|
| 170 | 'importInfo' => sprintf('%s entities were added, %s entities were updated', $added, $replaced) |
|
| 171 | ], |
|
| 172 | $data |
|
| 173 | ); |
|
| 174 | } |
|
| 175 | ||
| 176 | /** |
|
| 177 | * @return EntityManager |
|