mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-29 04:52:54 +03:00
Merge pull request #783 from acelaya-forks/feature/extended-mutation-checks
Feature/extended mutation checks
This commit is contained in:
commit
3706d6c82d
6 changed files with 37 additions and 20 deletions
23
CHANGELOG.md
23
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).
|
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
|
## 2.2.2 - 2020-06-08
|
||||||
|
|
||||||
#### Added
|
#### Added
|
||||||
|
|
|
@ -115,27 +115,31 @@
|
||||||
"@test:db"
|
"@test:db"
|
||||||
],
|
],
|
||||||
"test:unit": "phpdbg -qrr vendor/bin/phpunit --order-by=random --colors=always --coverage-php build/coverage-unit.cov --testdox",
|
"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": [
|
||||||
"@test:db:sqlite",
|
"@test:db:sqlite:ci",
|
||||||
"@test:db:mysql",
|
"@test:db:mysql",
|
||||||
"@test:db:maria",
|
"@test:db:maria",
|
||||||
"@test:db:postgres",
|
"@test:db:postgres",
|
||||||
"@test:db:ms"
|
"@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:mysql": "DB_DRIVER=mysql composer test:db:sqlite",
|
||||||
"test:db:maria": "DB_DRIVER=maria 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:postgres": "DB_DRIVER=postgres composer test:db:sqlite",
|
||||||
"test:db:ms": "DB_DRIVER=mssql composer test:db:sqlite",
|
"test:db:ms": "DB_DRIVER=mssql composer test:db:sqlite",
|
||||||
"test:api": "bin/test/run-api-tests.sh",
|
"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",
|
"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": "infection --threads=4 --min-msi=80 --log-verbosity=default --only-covered",
|
||||||
"infect:ci": "@infect --coverage=build --skip-initial-tests",
|
"infect:ci:base": "@infect --skip-initial-tests",
|
||||||
"infect:show": "@infect --show-mutations",
|
"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": [
|
"infect:test": [
|
||||||
"@test:unit:ci",
|
"@test:unit:ci",
|
||||||
|
"@test:db:sqlite:ci",
|
||||||
"@infect:ci"
|
"@infect:ci"
|
||||||
],
|
],
|
||||||
"clean:dev": "rm -f data/database.sqlite && rm -f config/params/generated_config.php"
|
"clean:dev": "rm -f data/database.sqlite && rm -f config/params/generated_config.php"
|
||||||
|
@ -158,7 +162,6 @@
|
||||||
"test:unit:pretty": "<fg=blue;options=bold>Runs unit test suites and generates an HTML code coverage report</>",
|
"test:unit:pretty": "<fg=blue;options=bold>Runs unit test suites and generates an HTML code coverage report</>",
|
||||||
"infect": "<fg=blue;options=bold>Checks unit tests quality applying mutation testing</>",
|
"infect": "<fg=blue;options=bold>Checks unit tests quality applying mutation testing</>",
|
||||||
"infect:ci": "<fg=blue;options=bold>Checks unit tests quality applying mutation testing with existing reports and logs</>",
|
"infect:ci": "<fg=blue;options=bold>Checks unit tests quality applying mutation testing with existing reports and logs</>",
|
||||||
"infect:show": "<fg=blue;options=bold>Checks unit tests quality applying mutation testing and shows applied mutators</>",
|
|
||||||
"infect:test": "<fg=blue;options=bold>Checks unit tests quality applying mutation testing</>",
|
"infect:test": "<fg=blue;options=bold>Checks unit tests quality applying mutation testing</>",
|
||||||
"clean:dev": "<fg=blue;options=bold>Deletes artifacts which are gitignored and could affect dev env</>"
|
"clean:dev": "<fg=blue;options=bold>Deletes artifacts which are gitignored and could affect dev env</>"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php $this->layout('ShlinkCore::layout/default') ?>
|
<?php $this->layout('ShlinkCore::layout/default') ?>
|
||||||
|
|
||||||
<?php $this->start('title') ?>
|
<?php $this->start('title') ?>
|
||||||
URL Not Found
|
Not Found
|
||||||
<?php $this->end() ?>
|
<?php $this->end() ?>
|
||||||
|
|
||||||
<?php $this->start('stylesheets') ?>
|
<?php $this->start('stylesheets') ?>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php $this->layout('ShlinkCore::layout/default') ?>
|
<?php $this->layout('ShlinkCore::layout/default') ?>
|
||||||
|
|
||||||
<?php $this->start('title') ?>
|
<?php $this->start('title') ?>
|
||||||
Invalid URL
|
Invalid Short URL
|
||||||
<?php $this->end() ?>
|
<?php $this->end() ?>
|
||||||
|
|
||||||
<?php $this->start('stylesheets') ?>
|
<?php $this->start('stylesheets') ?>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title><?= $this->section('title', '') ?> | URL shortener</title>
|
<title><?= $this->section('title', '') ?> | Shlink</title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
|
@ -19,12 +19,6 @@ use function trim;
|
||||||
|
|
||||||
class BodyParserMiddleware implements MiddlewareInterface, RequestMethodInterface
|
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
|
public function process(Request $request, RequestHandlerInterface $handler): Response
|
||||||
{
|
{
|
||||||
$method = $request->getMethod();
|
$method = $request->getMethod();
|
||||||
|
@ -51,8 +45,6 @@ class BodyParserMiddleware implements MiddlewareInterface, RequestMethodInterfac
|
||||||
return $handler->handle($this->parseFromUrlEncoded($request));
|
return $handler->handle($this->parseFromUrlEncoded($request));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private function getRequestContentType(Request $request): string
|
private function getRequestContentType(Request $request): string
|
||||||
{
|
{
|
||||||
$contentType = $request->getHeaderLine('Content-type');
|
$contentType = $request->getHeaderLine('Content-type');
|
||||||
|
@ -60,8 +52,6 @@ class BodyParserMiddleware implements MiddlewareInterface, RequestMethodInterfac
|
||||||
return trim(array_shift($contentTypes));
|
return trim(array_shift($contentTypes));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private function parseFromJson(Request $request): Request
|
private function parseFromJson(Request $request): Request
|
||||||
{
|
{
|
||||||
$rawBody = (string) $request->getBody();
|
$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
|
private function parseFromUrlEncoded(Request $request): Request
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue