@@ -26,8 +26,10 @@ |
||
26 | 26 | $app['log.level'] = Monolog\Logger::DEBUG; //ERROR in prod |
27 | 27 | $app['api.version'] = "v1"; |
28 | 28 | $app['api.endpoint'] = "/api"; |
29 | -if (!defined('ROOT_PATH')) |
|
30 | - define('ROOT_PATH', __DIR__); //solo in dev va bene |
|
29 | +if (!defined('ROOT_PATH')) { |
|
30 | + define('ROOT_PATH', __DIR__); |
|
31 | +} |
|
32 | +//solo in dev va bene |
|
31 | 33 | // @remember: https://{enviroment}.{domain}/{contextPath}/api/v1 |
32 | 34 | |
33 | 35 | // manca il contesto , FIXME: da pensare le ACL di haproxy come saranno da qui si decide come usare come mountpoint |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | return $app; |
21 | 21 | } |
22 | 22 | |
23 | - public function logIn($client){ |
|
23 | + public function logIn($client) { |
|
24 | 24 | $client->request('POST', |
25 | 25 | '/api/v1/security/login', |
26 | 26 | [], |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | return $client; |
31 | 31 | } |
32 | 32 | |
33 | - public function askValidation($data,$schema){ |
|
33 | + public function askValidation($data, $schema) { |
|
34 | 34 | $validator = new \JsonSchema\Validator; |
35 | - $js_schema = (object)['$ref' => 'file://' . $schema]; |
|
35 | + $js_schema = (object)['$ref' => 'file://'.$schema]; |
|
36 | 36 | $validator->check(json_decode($data), $js_schema); |
37 | 37 | return $validator; |
38 | 38 | } |
@@ -9,7 +9,7 @@ |
||
9 | 9 | { |
10 | 10 | use AbstractAppTest; |
11 | 11 | |
12 | - public function testGetWorkspaceList(){ |
|
12 | + public function testGetWorkspaceList() { |
|
13 | 13 | $schema = __DIR__.'/../../../../api/schemas/workspaceList.json'; |
14 | 14 | |
15 | 15 | //$client = $this->createClient(); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | { |
10 | 10 | use AbstractAppTest; |
11 | 11 | |
12 | - public function testGetWorkSpace(){ |
|
12 | + public function testGetWorkSpace() { |
|
13 | 13 | $schema = __DIR__.'/../../../../api/schemas/workspace.json'; |
14 | 14 | |
15 | 15 | $client = $this->createClient(); |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | $crawler = $client->request('GET', '/api/v1/workspace/1'); |
19 | 19 | $response = $client->getResponse(); |
20 | 20 | $data = $client->getResponse()->getContent(); |
21 | - $validator = $this->askValidation($data,$schema); |
|
21 | + $validator = $this->askValidation($data, $schema); |
|
22 | 22 | |
23 | 23 | if ($validator->isValid()) { |
24 | 24 | echo "The supplied JSON validates against the schema.\n"; |
25 | 25 | $this->assertTrue(true); |
26 | - } else { |
|
26 | + }else { |
|
27 | 27 | echo "JSON does not validate. Violations:\n"; |
28 | 28 | foreach ($validator->getErrors() as $error) { |
29 | 29 | echo "[{$error['property']}] {$error['message']}\n"; |