diff --git a/composer.json b/composer.json index a9cfacac..3c675a1f 100755 --- a/composer.json +++ b/composer.json @@ -9,24 +9,24 @@ "homepage": "http://www.phpvms.net", "require": { "php": ">=7.0", - "laravel/framework": "v5.5.25", + "laravel/framework": "5.5.25", "symfony/lts": "v3", - "php-http/httplug": "v1.1.0", + "php-http/httplug": "1.1.0", "laravelcollective/html": "5.5.1", - "doctrine/annotations": "v1.4.0", - "doctrine/cache": "v1.6.2", - "doctrine/collections": "v1.4.0", - "doctrine/common": "v2.7.3", - "doctrine/dbal": "v2.5.12", - "doctrine/inflector": "v1.1.0", - "doctrine/instantiator": "v1.0.5", + "doctrine/annotations": "1.4.0", + "doctrine/cache": "1.6.2", + "doctrine/collections": "1.4.0", + "doctrine/common": "2.7.3", + "doctrine/dbal": "2.5.12", + "doctrine/inflector": "1.1.0", + "doctrine/instantiator": "1.0.5", "prettus/l5-repository": "2.6.28", "spatie/laravel-pjax": "1.3.1", - "symfony/inflector": "v3.4.2", - "symfony/event-dispatcher": "v3.4.2", - "symfony/yaml": "v3.4.2", - "symfony/css-selector": "v3.4.2", - "symfony/dom-crawler": "v3.4.2", + "symfony/inflector": "3.4.2", + "symfony/event-dispatcher": "3.4.2", + "symfony/yaml": "3.4.2", + "symfony/css-selector": "3.4.2", + "symfony/dom-crawler": "3.4.2", "league/geotools": "0.7.0", "toin0u/geotools-laravel": "^1.0", "webpatser/laravel-uuid": "3.0.1", @@ -48,13 +48,14 @@ }, "require-dev": { "phpunit/phpunit": "6.4.0", - "barryvdh/laravel-ide-helper": "v2.4.x", + "barryvdh/laravel-ide-helper": "2.4.x", "fzaninotto/faker": "~1.4", "mockery/mockery": "0.9.*", "filp/whoops": "~2.0", - "orchestra/testbench": "v3.5.2", + "orchestra/testbench": "3.5.2", "bpocallaghan/generators": "5.0.1", - "scriptfusion/phpunit-immediate-exception-printer": "1.3.0" + "scriptfusion/phpunit-immediate-exception-printer": "1.3.0", + "zircote/swagger-php": "2.0.13" }, "autoload": { "classmap": [ diff --git a/composer.lock b/composer.lock index 3fd49aff..0fd02edc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "86e1301e51023af9f403b4c63209dae7", + "content-hash": "b928532e473b59b1b6905f9c109fcb2e", "packages": [ { "name": "composer/semver", @@ -6808,6 +6808,68 @@ "validate" ], "time": "2016-11-23T20:04:58+00:00" + }, + { + "name": "zircote/swagger-php", + "version": "2.0.13", + "source": { + "type": "git", + "url": "https://github.com/zircote/swagger-php.git", + "reference": "8b42fdc3d8c5a5e0d1f8d344aa359822c9f085e0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zircote/swagger-php/zipball/8b42fdc3d8c5a5e0d1f8d344aa359822c9f085e0", + "reference": "8b42fdc3d8c5a5e0d1f8d344aa359822c9f085e0", + "shasum": "" + }, + "require": { + "doctrine/annotations": "*", + "php": ">=5.6", + "symfony/finder": ">=2.2" + }, + "require-dev": { + "phpunit/phpunit": ">=4.8.35 <=5.6", + "squizlabs/php_codesniffer": ">=2.7", + "zendframework/zend-form": "<2.8" + }, + "bin": [ + "bin/swagger" + ], + "type": "library", + "autoload": { + "psr-4": { + "Swagger\\": "src" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache2" + ], + "authors": [ + { + "name": "Robert Allen", + "email": "zircote@gmail.com", + "homepage": "http://www.zircote.com" + }, + { + "name": "Bob Fanger", + "email": "bfanger@gmail.com", + "homepage": "http://bfanger.nl" + } + ], + "description": "Swagger-PHP - Generate interactive documentation for your RESTful API using phpdoc annotations", + "homepage": "https://github.com/zircote/swagger-php/", + "keywords": [ + "api", + "json", + "rest", + "service discovery" + ], + "time": "2017-12-01T09:22:05+00:00" } ], "aliases": [], diff --git a/tests/ApiTest.php b/tests/ApiTest.php index 34efb444..8b963501 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -1,5 +1,7 @@ create(); - $this->withHeaders($this->apiHeaders())->get('/api/airports/' . $airport->icao) - ->assertStatus(200) - ->assertJson(['icao' => $airport->icao], true); + $response = $this->withHeaders($this->apiHeaders())->get('/api/airports/' . $airport->icao); + $response->assertStatus(200); + $response->assertJson(['icao' => $airport->icao], true); + + /*$body = $response->json(); + $serializer = new Serializer(); + $swagger = $serializer->deserialize(\json_encode($body)); + echo $swagger;*/ $this->withHeaders($this->apiHeaders())->get('/api/airports/UNK') ->assertStatus(404);