@@ -101,8 +101,8 @@  | 
                                                    ||
| 101 | 101 | */  | 
                                                        
| 102 | 102 | public function iSetBasicAuthenticationWithAnd($username, $password)  | 
                                                        
| 103 | 103 |      { | 
                                                        
| 104 | - $authorization = base64_encode($username . ':' . $password);  | 
                                                        |
| 105 | -        $this->restApiBrowser->setRequestHeader('Authorization', 'Basic ' . $authorization); | 
                                                        |
| 104 | + $authorization = base64_encode($username.':'.$password);  | 
                                                        |
| 105 | +        $this->restApiBrowser->setRequestHeader('Authorization', 'Basic '.$authorization); | 
                                                        |
| 106 | 106 | }  | 
                                                        
| 107 | 107 | |
| 108 | 108 | /**  | 
                                                        
@@ -6,8 +6,6 @@  | 
                                                    ||
| 6 | 6 | use Behat\Behat\Context\Context;  | 
                                                        
| 7 | 7 | use Behat\Behat\Context\SnippetAcceptingContext;  | 
                                                        
| 8 | 8 | use Behat\Gherkin\Node\PyStringNode;  | 
                                                        
| 9 | -use Behat\Gherkin\Node\TableNode;  | 
                                                        |
| 10 | -use Psr\Http\Message\RequestInterface;  | 
                                                        |
| 11 | 9 | use Psr\Http\Message\ResponseInterface;  | 
                                                        
| 12 | 10 | use Rezzza\RestApiBehatExtension\Rest\RestApiBrowser;  | 
                                                        
| 13 | 11 | |
@@ -16,7 +16,7 @@  | 
                                                    ||
| 16 | 16 |      { | 
                                                        
| 17 | 17 |          $container->setParameter('rezzza.json_api.rest.base_url', $config['rest']['base_url']); | 
                                                        
| 18 | 18 |          $container->setParameter('rezzza.json_api.rest.adaptor_name', $config['rest']['adaptor_name']); | 
                                                        
| 19 | - $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/Resources'));  | 
                                                        |
| 19 | + $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/Resources'));  | 
                                                        |
| 20 | 20 |          $loader->load('services.xml'); | 
                                                        
| 21 | 21 | |
| 22 | 22 |          if (true === $config['rest']['store_response']) { | 
                                                        
@@ -22,14 +22,14 @@  | 
                                                    ||
| 22 | 22 | public function validate(Json $json, Validator $validator)  | 
                                                        
| 23 | 23 |      { | 
                                                        
| 24 | 24 | $refResolver = new RefResolver(new UriRetriever, new UriResolver);  | 
                                                        
| 25 | -        $schema = $refResolver->resolve('file://' . realpath($this->filename)); | 
                                                        |
| 25 | +        $schema = $refResolver->resolve('file://'.realpath($this->filename)); | 
                                                        |
| 26 | 26 | |
| 27 | 27 | $validator->check($json->getRawContent(), $schema);  | 
                                                        
| 28 | 28 | |
| 29 | 29 |          if (!$validator->isValid()) { | 
                                                        
| 30 | - $msg = "JSON does not validate. Violations:" . PHP_EOL;  | 
                                                        |
| 30 | + $msg = "JSON does not validate. Violations:".PHP_EOL;  | 
                                                        |
| 31 | 31 |              foreach ($validator->getErrors() as $error) { | 
                                                        
| 32 | -                $msg .= sprintf("  - [%s] %s" . PHP_EOL, $error['property'], $error['message']); | 
                                                        |
| 32 | +                $msg .= sprintf("  - [%s] %s".PHP_EOL, $error['property'], $error['message']); | 
                                                        |
| 33 | 33 | }  | 
                                                        
| 34 | 34 | throw new \Exception($msg);  | 
                                                        
| 35 | 35 | }  | 
                                                        
@@ -8,7 +8,7 @@ discard block  | 
                                                    ||
| 8 | 8 | use Symfony\Component\HttpFoundation\JsonResponse;  | 
                                                        
| 9 | 9 | use Symfony\Component\HttpFoundation\Request;  | 
                                                        
| 10 | 10 | |
| 11 | -require_once __DIR__ . '/../vendor/autoload.php';  | 
                                                        |
| 11 | +require_once __DIR__.'/../vendor/autoload.php';  | 
                                                        |
| 12 | 12 | |
| 13 | 13 | $app = new Silex\Application();  | 
                                                        
| 14 | 14 | |
@@ -56,15 +56,15 @@ discard block  | 
                                                    ||
| 56 | 56 | );  | 
                                                        
| 57 | 57 | $app->match(  | 
                                                        
| 58 | 58 | 'error_random',  | 
                                                        
| 59 | -    function (Request $request) { | 
                                                        |
| 60 | - $statusCode = time() % 3 <= 0 ? 200 : 502 ;  | 
                                                        |
| 59 | +    function(Request $request) { | 
                                                        |
| 60 | + $statusCode = time() % 3 <= 0 ? 200 : 502;  | 
                                                        |
| 61 | 61 | |
| 62 | 62 | return new JsonResponse([], $statusCode);  | 
                                                        
| 63 | 63 | }  | 
                                                        
| 64 | 64 | );  | 
                                                        
| 65 | 65 | $app->match(  | 
                                                        
| 66 | 66 | 'always_error',  | 
                                                        
| 67 | -    function (Request $request) { | 
                                                        |
| 67 | +    function(Request $request) { | 
                                                        |
| 68 | 68 | return new JsonResponse([], 502);  | 
                                                        
| 69 | 69 | }  | 
                                                        
| 70 | 70 | );  | 
                                                        
@@ -114,7 +114,7 @@  | 
                                                    ||
| 114 | 114 | new ExecutionTimeLimited(new SleepWaiter(), $maxExecutionTime)  | 
                                                        
| 115 | 115 | );  | 
                                                        
| 116 | 116 | $restApiBrowser = $this;  | 
                                                        
| 117 | -        $runner->run(new Callback(function () use ($restApiBrowser, $method, $uri, $body, $assertion) { | 
                                                        |
| 117 | +        $runner->run(new Callback(function() use ($restApiBrowser, $method, $uri, $body, $assertion) { | 
                                                        |
| 118 | 118 | $restApiBrowser->sendRequest($method, $uri, $body);  | 
                                                        
| 119 | 119 | |
| 120 | 120 | return $assertion();  | 
                                                        
@@ -4,6 +4,9 @@  | 
                                                    ||
| 4 | 4 | |
| 5 | 5 | abstract class ExpectationFailed extends \Exception  | 
                                                        
| 6 | 6 |  { | 
                                                        
| 7 | + /**  | 
                                                        |
| 8 | + * @return string  | 
                                                        |
| 9 | + */  | 
                                                        |
| 7 | 10 | abstract function getContextText();  | 
                                                        
| 8 | 11 | |
| 9 | 12 | /**  | 
                                                        
@@ -43,7 +43,7 @@ discard block  | 
                                                    ||
| 43 | 43 | */  | 
                                                        
| 44 | 44 | public function theJsonNodeShouldBeEqualTo($jsonNode, $expectedValue)  | 
                                                        
| 45 | 45 |      { | 
                                                        
| 46 | -        $this->assert(function () use ($jsonNode, $expectedValue) { | 
                                                        |
| 46 | +        $this->assert(function() use ($jsonNode, $expectedValue) { | 
                                                        |
| 47 | 47 | $realValue = $this->evaluateJsonNodeValue($jsonNode);  | 
                                                        
| 48 | 48 | $this->asserter->variable($realValue)->isEqualTo($expectedValue);  | 
                                                        
| 49 | 49 | });  | 
                                                        
@@ -55,7 +55,7 @@ discard block  | 
                                                    ||
| 55 | 55 | */  | 
                                                        
| 56 | 56 | public function theJsonNodeShouldHaveElements($jsonNode, $expectedNth)  | 
                                                        
| 57 | 57 |      { | 
                                                        
| 58 | -        $this->assert(function () use ($jsonNode, $expectedNth) { | 
                                                        |
| 58 | +        $this->assert(function() use ($jsonNode, $expectedNth) { | 
                                                        |
| 59 | 59 | $realValue = $this->evaluateJsonNodeValue($jsonNode);  | 
                                                        
| 60 | 60 | $this->asserter->phpArray($realValue)->hasSize($expectedNth);  | 
                                                        
| 61 | 61 | });  | 
                                                        
@@ -66,7 +66,7 @@ discard block  | 
                                                    ||
| 66 | 66 | */  | 
                                                        
| 67 | 67 | public function theJsonArrayNodeShouldContainElements($jsonNode, $expectedValue)  | 
                                                        
| 68 | 68 |      { | 
                                                        
| 69 | -        $this->assert(function () use ($jsonNode, $expectedValue) { | 
                                                        |
| 69 | +        $this->assert(function() use ($jsonNode, $expectedValue) { | 
                                                        |
| 70 | 70 | $realValue = $this->evaluateJsonNodeValue($jsonNode);  | 
                                                        
| 71 | 71 | $this->asserter->phpArray($realValue)->contains($expectedValue);  | 
                                                        
| 72 | 72 | });  | 
                                                        
@@ -77,7 +77,7 @@ discard block  | 
                                                    ||
| 77 | 77 | */  | 
                                                        
| 78 | 78 | public function theJsonArrayNodeShouldNotContainElements($jsonNode, $expectedValue)  | 
                                                        
| 79 | 79 |      { | 
                                                        
| 80 | -        $this->assert(function () use ($jsonNode, $expectedValue) { | 
                                                        |
| 80 | +        $this->assert(function() use ($jsonNode, $expectedValue) { | 
                                                        |
| 81 | 81 | $realValue = $this->evaluateJsonNodeValue($jsonNode);  | 
                                                        
| 82 | 82 | $this->asserter->phpArray($realValue)->notContains($expectedValue);  | 
                                                        
| 83 | 83 | });  | 
                                                        
@@ -88,7 +88,7 @@ discard block  | 
                                                    ||
| 88 | 88 | */  | 
                                                        
| 89 | 89 | public function theJsonNodeShouldContain($jsonNode, $expectedValue)  | 
                                                        
| 90 | 90 |      { | 
                                                        
| 91 | -        $this->assert(function () use ($jsonNode, $expectedValue) { | 
                                                        |
| 91 | +        $this->assert(function() use ($jsonNode, $expectedValue) { | 
                                                        |
| 92 | 92 | $realValue = $this->evaluateJsonNodeValue($jsonNode);  | 
                                                        
| 93 | 93 | $this->asserter->string((string) $realValue)->contains($expectedValue);  | 
                                                        
| 94 | 94 | });  | 
                                                        
@@ -101,7 +101,7 @@ discard block  | 
                                                    ||
| 101 | 101 | */  | 
                                                        
| 102 | 102 | public function theJsonNodeShouldNotContain($jsonNode, $unexpectedValue)  | 
                                                        
| 103 | 103 |      { | 
                                                        
| 104 | -        $this->assert(function () use ($jsonNode, $unexpectedValue) { | 
                                                        |
| 104 | +        $this->assert(function() use ($jsonNode, $unexpectedValue) { | 
                                                        |
| 105 | 105 | $realValue = $this->evaluateJsonNodeValue($jsonNode);  | 
                                                        
| 106 | 106 | $this->asserter->string((string) $realValue)->notContains($unexpectedValue);  | 
                                                        
| 107 | 107 | });  | 
                                                        
@@ -152,7 +152,7 @@ discard block  | 
                                                    ||
| 152 | 152 |      { | 
                                                        
| 153 | 153 | $tempFilename = tempnam(sys_get_temp_dir(), 'rae');  | 
                                                        
| 154 | 154 | file_put_contents($tempFilename, $jsonSchemaContent);  | 
                                                        
| 155 | -        $this->assert(function () use ($tempFilename) { | 
                                                        |
| 155 | +        $this->assert(function() use ($tempFilename) { | 
                                                        |
| 156 | 156 | $this->jsonInspector->validateJson(  | 
                                                        
| 157 | 157 | new JsonSchema($tempFilename)  | 
                                                        
| 158 | 158 | );  | 
                                                        
@@ -167,7 +167,7 @@ discard block  | 
                                                    ||
| 167 | 167 |      { | 
                                                        
| 168 | 168 | $filename = $this->resolveFilename($filename);  | 
                                                        
| 169 | 169 | |
| 170 | -        $this->assert(function () use ($filename) { | 
                                                        |
| 170 | +        $this->assert(function() use ($filename) { | 
                                                        |
| 171 | 171 | $this->jsonInspector->validateJson(  | 
                                                        
| 172 | 172 | new JsonSchema($filename)  | 
                                                        
| 173 | 173 | );  | 
                                                        
@@ -187,7 +187,7 @@ discard block  | 
                                                    ||
| 187 | 187 |              throw new \Exception('The expected JSON is not a valid'); | 
                                                        
| 188 | 188 | }  | 
                                                        
| 189 | 189 | |
| 190 | -        $this->assert(function () use ($realJsonValue, $expectedJsonValue) { | 
                                                        |
| 190 | +        $this->assert(function() use ($realJsonValue, $expectedJsonValue) { | 
                                                        |
| 191 | 191 | $this->asserter->castToString($realJsonValue)->isEqualTo((string) $expectedJsonValue);  | 
                                                        
| 192 | 192 | });  | 
                                                        
| 193 | 193 | }  | 
                                                        
@@ -215,7 +215,7 @@ discard block  | 
                                                    ||
| 215 | 215 | ));  | 
                                                        
| 216 | 216 | }  | 
                                                        
| 217 | 217 | |
| 218 | - $filename = $this->jsonSchemaBaseUrl . '/' . $filename;  | 
                                                        |
| 218 | + $filename = $this->jsonSchemaBaseUrl.'/'.$filename;  | 
                                                        |
| 219 | 219 | |
| 220 | 220 |          if (false === is_file($filename)) { | 
                                                        
| 221 | 221 | throw new \RuntimeException(sprintf(  |