diff --git a/CHANGELOG.md b/CHANGELOG.md index 6192481f..6993aeb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,29 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org). +## [Unreleased] + +#### Added + +* *Nothing* + +#### Changed + +* [#508](https://github.com/shlinkio/shlink/issues/508) Added mutation checks to database tests. + +#### Deprecated + +* *Nothing* + +#### Removed + +* *Nothing* + +#### Fixed + +* *Nothing* + + ## 2.2.2 - 2020-06-08 #### Added diff --git a/composer.json b/composer.json index ef9e0e92..777463b2 100644 --- a/composer.json +++ b/composer.json @@ -115,27 +115,31 @@ "@test:db" ], "test:unit": "phpdbg -qrr vendor/bin/phpunit --order-by=random --colors=always --coverage-php build/coverage-unit.cov --testdox", - "test:unit:ci": "@test:unit --coverage-clover=build/clover.xml --coverage-xml=build/coverage-xml --log-junit=build/junit.xml", + "test:unit:ci": "@test:unit --coverage-clover=build/clover.xml --coverage-xml=build/coverage-unit/coverage-xml --log-junit=build/coverage-unit/junit.xml", "test:db": [ - "@test:db:sqlite", + "@test:db:sqlite:ci", "@test:db:mysql", "@test:db:maria", "@test:db:postgres", "@test:db:ms" ], - "test:db:sqlite": "APP_ENV=test phpdbg -qrr vendor/bin/phpunit --order-by=random --colors=always --coverage-php build/coverage-db.cov --testdox -c phpunit-db.xml", + "test:db:sqlite": "APP_ENV=test phpdbg -qrr vendor/bin/phpunit --order-by=random --colors=always --testdox -c phpunit-db.xml", + "test:db:sqlite:ci": "@test:db:sqlite --coverage-php build/coverage-db.cov --coverage-xml=build/coverage-db/coverage-xml --log-junit=build/coverage-db/junit.xml", "test:db:mysql": "DB_DRIVER=mysql composer test:db:sqlite", "test:db:maria": "DB_DRIVER=maria composer test:db:sqlite", "test:db:postgres": "DB_DRIVER=postgres composer test:db:sqlite", "test:db:ms": "DB_DRIVER=mssql composer test:db:sqlite", "test:api": "bin/test/run-api-tests.sh", - "test:api:ci": "@test:api --coverage-php build/coverage-api.cov", "test:unit:pretty": "phpdbg -qrr vendor/bin/phpunit --order-by=random --colors=always --coverage-html build/coverage", "infect": "infection --threads=4 --min-msi=80 --log-verbosity=default --only-covered", - "infect:ci": "@infect --coverage=build --skip-initial-tests", - "infect:show": "@infect --show-mutations", + "infect:ci:base": "@infect --skip-initial-tests", + "infect:ci": [ + "@infect:ci:base --coverage=build/coverage-unit", + "@infect:ci:base --coverage=build/coverage-db --test-framework-options=--configuration=phpunit-db.xml" + ], "infect:test": [ "@test:unit:ci", + "@test:db:sqlite:ci", "@infect:ci" ], "clean:dev": "rm -f data/database.sqlite && rm -f config/params/generated_config.php" @@ -158,7 +162,6 @@ "test:unit:pretty": "Runs unit test suites and generates an HTML code coverage report", "infect": "Checks unit tests quality applying mutation testing", "infect:ci": "Checks unit tests quality applying mutation testing with existing reports and logs", - "infect:show": "Checks unit tests quality applying mutation testing and shows applied mutators", "infect:test": "Checks unit tests quality applying mutation testing", "clean:dev": "Deletes artifacts which are gitignored and could affect dev env" }, diff --git a/module/Core/templates/error/404.phtml b/module/Core/templates/error/404.phtml index bd1b0b6f..20ac4ff8 100644 --- a/module/Core/templates/error/404.phtml +++ b/module/Core/templates/error/404.phtml @@ -1,7 +1,7 @@ layout('ShlinkCore::layout/default') ?> start('title') ?> - URL Not Found + Not Found end() ?> start('stylesheets') ?> diff --git a/module/Core/templates/invalid-short-code.phtml b/module/Core/templates/invalid-short-code.phtml index a435ba0b..47be4a16 100644 --- a/module/Core/templates/invalid-short-code.phtml +++ b/module/Core/templates/invalid-short-code.phtml @@ -1,7 +1,7 @@ layout('ShlinkCore::layout/default') ?> start('title') ?> - Invalid URL + Invalid Short URL end() ?> start('stylesheets') ?> diff --git a/module/Core/templates/layout/default.phtml b/module/Core/templates/layout/default.phtml index b231d48b..fbb78b26 100644 --- a/module/Core/templates/layout/default.phtml +++ b/module/Core/templates/layout/default.phtml @@ -1,7 +1,7 @@ - <?= $this->section('title', '') ?> | URL shortener + <?= $this->section('title', '') ?> | Shlink diff --git a/module/Rest/src/Middleware/BodyParserMiddleware.php b/module/Rest/src/Middleware/BodyParserMiddleware.php index 955041d9..c7e99121 100644 --- a/module/Rest/src/Middleware/BodyParserMiddleware.php +++ b/module/Rest/src/Middleware/BodyParserMiddleware.php @@ -19,12 +19,6 @@ use function trim; class BodyParserMiddleware implements MiddlewareInterface, RequestMethodInterface { - /** - * Process an incoming server request and return a response, optionally delegating - * to the next middleware component to create the response. - * - * - */ public function process(Request $request, RequestHandlerInterface $handler): Response { $method = $request->getMethod(); @@ -51,8 +45,6 @@ class BodyParserMiddleware implements MiddlewareInterface, RequestMethodInterfac return $handler->handle($this->parseFromUrlEncoded($request)); } - /** - */ private function getRequestContentType(Request $request): string { $contentType = $request->getHeaderLine('Content-type'); @@ -60,8 +52,6 @@ class BodyParserMiddleware implements MiddlewareInterface, RequestMethodInterfac return trim(array_shift($contentTypes)); } - /** - */ private function parseFromJson(Request $request): Request { $rawBody = (string) $request->getBody(); @@ -74,6 +64,7 @@ class BodyParserMiddleware implements MiddlewareInterface, RequestMethodInterfac } /** + * @deprecated To be removed on Shlink v3.0.0, supporting only JSON requests. */ private function parseFromUrlEncoded(Request $request): Request {