Last active
June 6, 2019 15:09
-
-
Save Zayon/f05dec4983c23a4ba8cb3baa358cebbc to your computer and use it in GitHub Desktop.
RestContext
This file contains hidden or 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
| <?php | |
| declare(strict_types=1); | |
| use Behat\Gherkin\Node\PyStringNode; | |
| use Behatch\Context\RestContext as BehatchRestContext; | |
| class RestContext extends BehatchRestContext | |
| { | |
| use SharedContextTrait; | |
| /** | |
| * @override Given I send a :method request to :url with body: | |
| */ | |
| public function iSendARequestToWithBody($method, $url, PyStringNode $body) | |
| { | |
| $rawBody = $body->getRaw(); | |
| $this->sharingContext->renderTwigTemplate($rawBody); | |
| $newBody = new PyStringNode(explode("\n", $rawBody), $body->getLine()); | |
| return parent::iSendARequestToWithBody($method, $url, $newBody); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment