ynloultratech /
graphql-bundle
| 1 | <?php |
||
| 2 | /******************************************************************************* |
||
| 3 | * This file is part of the GraphQL Bundle package. |
||
| 4 | * |
||
| 5 | * (c) YnloUltratech <[email protected]> |
||
| 6 | * |
||
| 7 | * For the full copyright and license information, please view the LICENSE |
||
| 8 | * file that was distributed with this source code. |
||
| 9 | ******************************************************************************/ |
||
| 10 | |||
| 11 | namespace Ynlo\GraphQLBundle\Test\Helper; |
||
| 12 | |||
| 13 | use Symfony\Bundle\FrameworkBundle\Client; |
||
| 14 | use Symfony\Component\HttpFoundation\Response; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @method Client getClient() |
||
| 18 | * |
||
| 19 | * @requires JsonHelperTrait |
||
| 20 | * |
||
| 21 | * @deprecated in favor of Behat tests |
||
| 22 | */ |
||
| 23 | trait ResponseHelperTrait |
||
| 24 | { |
||
| 25 | public static function getResponse(): Response |
||
| 26 | { |
||
| 27 | return static::getClient()->getResponse(); |
||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 28 | } |
||
| 29 | |||
| 30 | public static function getResponseJsonArray(): array |
||
| 31 | { |
||
| 32 | return json_decode(static::getResponse()->getContent(), true); |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @param string $path |
||
| 37 | * |
||
| 38 | * @return mixed|null |
||
| 39 | */ |
||
| 40 | public static function getResponseJsonPathValue(string $path) |
||
| 41 | { |
||
| 42 | return static::getJsonPathValue(static::getResponseJsonArray(), $path); |
||
| 43 | } |
||
| 44 | } |
||
| 45 |