diff --git a/.gitignore b/.gitignore index e304846..34bb744 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea +.phpunit.result.cache /tests/config /tests/public /tests/resources diff --git a/README.md b/README.md index 7614ba2..32b167d 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Installation 5.4.x | 3 | 2.0 | ``` composer require "darkaonline/swagger-lume:~3.0" ``` 5.5.x | 3 | 2.0 | ``` composer require "darkaonline/swagger-lume:5.5.*" ``` 5.6 - 5.7 | 3 | 2.0, 3.0 | ``` composer require "darkaonline/swagger-lume:5.6.*" ``` - + 6.0 | 3 | 2.0, 3.0 | ``` composer require "darkaonline/swagger-lume:6.*" ``` - Open your `bootstrap/app.php` file and: diff --git a/composer.json b/composer.json index 8a2731a..c6d0b26 100644 --- a/composer.json +++ b/composer.json @@ -10,15 +10,15 @@ } ], "require": { - "php": ">=7.1.3", - "laravel/lumen-framework": "~5.6", + "php": ">=7.2", + "laravel/lumen-framework": "~6.0", "zircote/swagger-php": "~2.0|3.*", "swagger-api/swagger-ui": "^3.0" }, "require-dev": { - "fzaninotto/faker": "~1.4", - "phpunit/phpunit": "~7.0", - "mockery/mockery": "~1.0", + "fzaninotto/faker": "~1.8", + "phpunit/phpunit": "8.*", + "mockery/mockery": "1.*", "satooshi/php-coveralls": "^2.0", "vlucas/phpdotenv": "~3.3" }, diff --git a/phpunit.xml b/phpunit.xml index a3ab83f..03f1fae 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -7,8 +7,7 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="false" - syntaxCheck="false"> + stopOnFailure="false"> tests/ @@ -18,12 +17,10 @@ - + - + diff --git a/tests/CommandsTest.php b/tests/CommandsTest.php index cdd0ae3..ccef8f3 100644 --- a/tests/CommandsTest.php +++ b/tests/CommandsTest.php @@ -24,11 +24,11 @@ public function canGenerateJsonDocumentation() $fileContent = file_get_contents($this->jsonDocsFile()); $this->assertJson($fileContent); - $this->assertContains('SwaggerLume', $fileContent); + $this->assertStringContainsString('SwaggerLume', $fileContent); //Check if constants are replaced - $this->assertContains('http://my-default-host.com', $fileContent); - $this->assertNotContains('SWAGGER_LUME_CONST_HOST', $fileContent); + $this->assertStringContainsString('http://my-default-host.com', $fileContent); + $this->assertStringNotContainsString('SWAGGER_LUME_CONST_HOST', $fileContent); } /** @test */ diff --git a/tests/GeneratorTest.php b/tests/GeneratorTest.php index b02c2df..ee3b805 100644 --- a/tests/GeneratorTest.php +++ b/tests/GeneratorTest.php @@ -19,8 +19,8 @@ public function canGenerateApiJsonFile() $this->assertResponseOk(); - $this->assertContains('SwaggerLume', $response->response->getContent()); - $this->assertContains('my-default-host.com', $response->response->getContent()); + $this->assertStringContainsString('SwaggerLume', $response->response->getContent()); + $this->assertStringContainsString('my-default-host.com', $response->response->getContent()); } /** @test */ @@ -44,8 +44,8 @@ public function canGenerateApiJsonFileWithChangedBasePath() $this->assertResponseOk(); - $this->assertContains('SwaggerLume', $response->response->getContent()); - $this->assertContains('new_path', $response->response->getContent()); + $this->assertStringContainsString('SwaggerLume', $response->response->getContent()); + $this->assertStringContainsString('new_path', $response->response->getContent()); } /** @test */ @@ -77,7 +77,7 @@ public function canSetValidatorUrl() $this->assertResponseOk(); - $this->assertContains('validator-url.dev', $response->response->getContent()); + $this->assertStringContainsString('validator-url.dev', $response->response->getContent()); $this->assertTrue(file_exists($this->jsonDocsFile())); } diff --git a/tests/RoutesTest.php b/tests/RoutesTest.php index c4f9fed..5ebd34b 100644 --- a/tests/RoutesTest.php +++ b/tests/RoutesTest.php @@ -37,7 +37,7 @@ public function canAccessDocumentationInterface() $this->assertResponseOk(); - $this->assertContains($this->docs_url, $response->response->getContent()); + $this->assertStringContainsString($this->docs_url, $response->response->getContent()); } /** @test */ @@ -47,7 +47,7 @@ public function itCanServeAssets() $this->assertResponseOk(); - $this->assertContains('.swagger-ui', $response->response->getContent()); + $this->assertStringContainsString('.swagger-ui', $response->response->getContent()); } /** @test */ @@ -57,7 +57,7 @@ public function userCanAccessOauth2Redirect() $this->assertResponseOk(); - $this->assertContains('swaggerUIRedirectOauth2', $response->response->getContent()); - $this->assertContains('oauth2.auth.code', $response->response->getContent()); + $this->assertStringContainsString('swaggerUIRedirectOauth2', $response->response->getContent()); + $this->assertStringContainsString('oauth2.auth.code', $response->response->getContent()); } } diff --git a/tests/SecurityDefinitionsTest.php b/tests/SecurityDefinitionsTest.php index 5462658..389dc29 100644 --- a/tests/SecurityDefinitionsTest.php +++ b/tests/SecurityDefinitionsTest.php @@ -34,7 +34,7 @@ public function canGenerateApiJsonFileWithSecurityDefinition() $this->assertResponseOk(); - $this->assertContains('new_api_key_securitye', $response->response->getContent()); + $this->assertStringContainsString('new_api_key_securitye', $response->response->getContent()); $this->seeJson($security); } @@ -69,8 +69,8 @@ public function canGenerateApiJsonFileWithSecurityDefinitionOpenApi3() $content = $response->response->getContent(); - $this->assertContains('new_api_key_security', $content); - $this->assertContains('oauth2', $content); + $this->assertStringContainsString('new_api_key_security', $content); + $this->assertStringContainsString('oauth2', $content); $this->seeJson($security); } }