mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
bug #11560 [HOTFIX] Fix build (Tomanhez)
This PR was merged into the 1.7-dev branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | License | MIT Fix build and improve `getError()` more usable Commits -------392982c6fcAdd fix for getError() metchodc659707a30modify chrome travis run command
This commit is contained in:
commit
e18f1b820e
3 changed files with 17 additions and 1 deletions
|
|
@ -7,7 +7,7 @@ prepare_for_behat_with_js() {
|
|||
run_command "$SYLIUS_CACHE_DIR/symfony server:ca:install"
|
||||
|
||||
# Run headless Chrome
|
||||
run_command "google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1 > /dev/null 2>&1 &"
|
||||
run_command "google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --disable-gpu --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1 > /dev/null 2>&1 &"
|
||||
|
||||
# Run webserver
|
||||
run_command "$SYLIUS_CACHE_DIR/symfony server:start --port=8080 --dir=public --daemon"
|
||||
|
|
|
|||
|
|
@ -50,6 +50,10 @@ final class ResponseChecker implements ResponseCheckerInterface
|
|||
|
||||
public function getError(Response $response): string
|
||||
{
|
||||
if ($this->hasKey($response, 'message')) {
|
||||
return $this->getValue($response, 'message');
|
||||
}
|
||||
|
||||
return $this->getResponseContentValue($response, 'hydra:description');
|
||||
}
|
||||
|
||||
|
|
@ -121,6 +125,13 @@ final class ResponseChecker implements ResponseCheckerInterface
|
|||
return false;
|
||||
}
|
||||
|
||||
public function hasKey(Response $response, string $key): bool
|
||||
{
|
||||
$content = json_decode($response->getContent(), true);
|
||||
|
||||
return array_key_exists($key, $content);
|
||||
}
|
||||
|
||||
public function hasTranslation(Response $response, string $locale, string $key, string $translation): bool
|
||||
{
|
||||
$resource = $this->getResponseContent($response);
|
||||
|
|
|
|||
|
|
@ -44,11 +44,16 @@ interface ResponseCheckerInterface
|
|||
/** @param string|int $value */
|
||||
public function hasItemWithValue(Response $response, string $key, $value): bool;
|
||||
|
||||
/** @param string|int $value */
|
||||
public function hasSubResourceWithValue(Response $response, string $subResource, string $key, $value): bool;
|
||||
|
||||
/** @param string|array $value */
|
||||
public function hasItemOnPositionWithValue(Response $response, int $position, string $key, $value): bool;
|
||||
|
||||
public function hasItemWithTranslation(Response $response, string $locale, string $key, string $translation): bool;
|
||||
|
||||
public function hasKey(Response $response, string $key): bool;
|
||||
|
||||
public function hasTranslation(Response $response, string $locale, string $key, string $translation): bool;
|
||||
|
||||
public function hasItemWithValues(Response $response, array $parameters): bool;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue