Skip to content

Commit

Permalink
Support for Lumen 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkaOnLine committed Sep 16, 2019
1 parent 49d80c3 commit 8cb3ab5
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 27 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea
.phpunit.result.cache
/tests/config
/tests/public
/tests/resources
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
9 changes: 3 additions & 6 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false">
stopOnFailure="false">
<testsuite name="SwaggerLume TestSuite">
<directory>tests/</directory>
</testsuite>
Expand All @@ -18,12 +17,10 @@
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="./tests/storage/logs/test-reports" charset="UTF-8"
yui="true" highlight="true"
lowUpperBound="50" highLowerBound="80" />
<log type="coverage-html" target="./tests/storage/logs/test-reports" lowUpperBound="50" highLowerBound="80" />
<log type="coverage-clover" target="./tests/storage/logs/test-reports/clover.xml"/>
<log type="coverage-php" target="./tests/storage/logs/test-reports/coverage.cov"/>
<log type="junit" target="./tests/storage/logs/test-reports/junit.xml" logIncompleteSkipped="false"/>
<log type="junit" target="./tests/storage/logs/test-reports/junit.xml"/>
</logging>
<php>
<env name="APP_ENV" value="testing"/>
Expand Down
6 changes: 3 additions & 3 deletions tests/CommandsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
10 changes: 5 additions & 5 deletions tests/GeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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 */
Expand Down Expand Up @@ -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()));
}
Expand Down
8 changes: 4 additions & 4 deletions tests/RoutesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -47,7 +47,7 @@ public function itCanServeAssets()

$this->assertResponseOk();

$this->assertContains('.swagger-ui', $response->response->getContent());
$this->assertStringContainsString('.swagger-ui', $response->response->getContent());
}

/** @test */
Expand All @@ -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());
}
}
6 changes: 3 additions & 3 deletions tests/SecurityDefinitionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}
}

0 comments on commit 8cb3ab5

Please sign in to comment.