summaryrefslogtreecommitdiff
path: root/tests/Unit
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2019-04-24 11:01:37 +0200
committermsquare <msquare@notrademark.de>2019-04-25 18:17:19 +0200
commit79c92da8c14de61dccc015f04c3900aac4bd4179 (patch)
tree7b4e0f51d2bd2508905fdc697b31a73810a1b5d5 /tests/Unit
parent7c3a0c70e8d23f47287ead148c6b8682216352c6 (diff)
Formatting
```bash php-cs-fixer fix --allow-risky=yes --rules=@PSR2,psr4,mb_str_functions.php_unit_construct,php_unit_ordered_covers,trailing_comma_in_multiline_array --rules='{"array_syntax": {"syntax":"short"}}' [tests/|src/] ```
Diffstat (limited to 'tests/Unit')
-rw-r--r--tests/Unit/ApplicationTest.php6
-rw-r--r--tests/Unit/Config/ConfigServiceProviderTest.php2
-rw-r--r--tests/Unit/Container/Stub/ServiceProviderImplementation.php1
-rw-r--r--tests/Unit/Controllers/Metrics/ControllerTest.php6
-rw-r--r--tests/Unit/Controllers/Metrics/MetricsEngineTest.php10
-rw-r--r--tests/Unit/Controllers/Metrics/StatsTest.php6
-rw-r--r--tests/Unit/Database/DatabaseServiceProviderTest.php4
-rw-r--r--tests/Unit/Database/DatabaseTest.php5
-rw-r--r--tests/Unit/Database/DbTest.php5
-rw-r--r--tests/Unit/Database/Migration/MigrateTest.php8
-rw-r--r--tests/Unit/Exceptions/ExceptionsServiceProviderTest.php4
-rw-r--r--tests/Unit/Exceptions/HandlerTest.php6
-rw-r--r--tests/Unit/Exceptions/Handlers/LegacyDevelopmentTest.php3
-rw-r--r--tests/Unit/Exceptions/Handlers/LegacyTest.php1
-rw-r--r--tests/Unit/Exceptions/Handlers/WhoopsTest.php1
-rw-r--r--tests/Unit/Helpers/TranslationServiceProviderTest.php4
-rw-r--r--tests/Unit/Helpers/TranslatorTest.php8
-rw-r--r--tests/Unit/HelpersTest.php4
-rw-r--r--tests/Unit/Http/Exceptions/HttpExceptionTest.php2
-rw-r--r--tests/Unit/Http/LegacyUrlGeneratorTest.php2
-rw-r--r--tests/Unit/Http/RequestTest.php2
-rw-r--r--tests/Unit/Http/ResponseTest.php4
-rw-r--r--tests/Unit/Http/SessionHandlers/DatabaseHandlerTest.php4
-rw-r--r--tests/Unit/Http/SessionServiceProviderTest.php6
-rw-r--r--tests/Unit/Mail/EngelsystemMailerTest.php2
-rw-r--r--tests/Unit/Mail/MailerServiceProviderTest.php2
-rw-r--r--tests/Unit/Mail/MailerTest.php2
-rw-r--r--tests/Unit/Mail/Transport/TransportTest.php2
-rw-r--r--tests/Unit/Middleware/CallableHandlerTest.php6
-rw-r--r--tests/Unit/Middleware/RequestHandlerTest.php2
-rw-r--r--tests/Unit/Middleware/ResolvesMiddlewareTraitTest.php2
-rw-r--r--tests/Unit/Middleware/RouteDispatcherTest.php2
-rw-r--r--tests/Unit/Middleware/Stub/HasStaticMethod.php4
-rw-r--r--tests/Unit/Middleware/VerifyCsrfTokenTest.php2
-rw-r--r--tests/Unit/Models/EventConfigTest.php3
-rw-r--r--tests/Unit/Models/User/Stub/HasUserModelImplementation.php1
-rw-r--r--tests/Unit/Models/User/UserTest.php10
-rw-r--r--tests/Unit/Renderer/RendererServiceProviderTest.php2
-rw-r--r--tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php1
-rw-r--r--tests/Unit/Renderer/Twig/Extensions/LegacyTest.php2
-rw-r--r--tests/Unit/ServiceProviderTest.php1
41 files changed, 73 insertions, 77 deletions
diff --git a/tests/Unit/ApplicationTest.php b/tests/Unit/ApplicationTest.php
index a57488d0..e466ecd7 100644
--- a/tests/Unit/ApplicationTest.php
+++ b/tests/Unit/ApplicationTest.php
@@ -34,9 +34,9 @@ class ApplicationTest extends TestCase
}
/**
- * @covers \Engelsystem\Application::setAppPath
- * @covers \Engelsystem\Application::registerPaths
* @covers \Engelsystem\Application::path
+ * @covers \Engelsystem\Application::registerPaths
+ * @covers \Engelsystem\Application::setAppPath
*/
public function testAppPath()
{
@@ -125,8 +125,8 @@ class ApplicationTest extends TestCase
/**
* @covers \Engelsystem\Application::bootstrap
- * @covers \Engelsystem\Application::isBooted
* @covers \Engelsystem\Application::getMiddleware
+ * @covers \Engelsystem\Application::isBooted
*/
public function testBootstrap()
{
diff --git a/tests/Unit/Config/ConfigServiceProviderTest.php b/tests/Unit/Config/ConfigServiceProviderTest.php
index 895496b8..62a662f8 100644
--- a/tests/Unit/Config/ConfigServiceProviderTest.php
+++ b/tests/Unit/Config/ConfigServiceProviderTest.php
@@ -18,8 +18,8 @@ class ConfigServiceProviderTest extends ServiceProviderTest
use ArraySubsetAsserts;
/**
- * @covers \Engelsystem\Config\ConfigServiceProvider::register
* @covers \Engelsystem\Config\ConfigServiceProvider::getConfigPath
+ * @covers \Engelsystem\Config\ConfigServiceProvider::register
*/
public function testRegister()
{
diff --git a/tests/Unit/Container/Stub/ServiceProviderImplementation.php b/tests/Unit/Container/Stub/ServiceProviderImplementation.php
index 36ae2c38..34311003 100644
--- a/tests/Unit/Container/Stub/ServiceProviderImplementation.php
+++ b/tests/Unit/Container/Stub/ServiceProviderImplementation.php
@@ -6,5 +6,4 @@ use Engelsystem\Container\ServiceProvider;
class ServiceProviderImplementation extends ServiceProvider
{
-
}
diff --git a/tests/Unit/Controllers/Metrics/ControllerTest.php b/tests/Unit/Controllers/Metrics/ControllerTest.php
index 56415e23..381e00f2 100644
--- a/tests/Unit/Controllers/Metrics/ControllerTest.php
+++ b/tests/Unit/Controllers/Metrics/ControllerTest.php
@@ -127,8 +127,8 @@ class ControllerTest extends TestCase
}
/**
- * @covers \Engelsystem\Controllers\Metrics\Controller::stats
* @covers \Engelsystem\Controllers\Metrics\Controller::checkAuth
+ * @covers \Engelsystem\Controllers\Metrics\Controller::stats
*/
public function testStats()
{
@@ -149,7 +149,7 @@ class ControllerTest extends TestCase
'user_count' => 13,
'arrived_user_count' => 10,
'done_work_hours' => 99,
- 'users_in_action' => 5
+ 'users_in_action' => 5,
]))
->willReturn($response);
@@ -213,6 +213,6 @@ class ControllerTest extends TestCase
$stats = $this->createMock(Stats::class);
$config = new Config();
- return array($response, $request, $engine, $stats, $config);
+ return [$response, $request, $engine, $stats, $config];
}
}
diff --git a/tests/Unit/Controllers/Metrics/MetricsEngineTest.php b/tests/Unit/Controllers/Metrics/MetricsEngineTest.php
index b810b10a..38817b36 100644
--- a/tests/Unit/Controllers/Metrics/MetricsEngineTest.php
+++ b/tests/Unit/Controllers/Metrics/MetricsEngineTest.php
@@ -8,12 +8,12 @@ use Engelsystem\Test\Unit\TestCase;
class MetricsEngineTest extends TestCase
{
/**
- * @covers \Engelsystem\Controllers\Metrics\MetricsEngine::get
+ * @covers \Engelsystem\Controllers\Metrics\MetricsEngine::escape
* @covers \Engelsystem\Controllers\Metrics\MetricsEngine::formatData
+ * @covers \Engelsystem\Controllers\Metrics\MetricsEngine::formatValue
+ * @covers \Engelsystem\Controllers\Metrics\MetricsEngine::get
* @covers \Engelsystem\Controllers\Metrics\MetricsEngine::renderLabels
* @covers \Engelsystem\Controllers\Metrics\MetricsEngine::renderValue
- * @covers \Engelsystem\Controllers\Metrics\MetricsEngine::formatValue
- * @covers \Engelsystem\Controllers\Metrics\MetricsEngine::escape
*/
public function testGet()
{
@@ -30,13 +30,13 @@ class MetricsEngineTest extends TestCase
$this->assertEquals(
'engelsystem_foo{lorem="ip\\\\sum"} \\"lorem\\n\\\\ipsum\\"',
$engine->get('/metrics', [
- 'foo' => ['labels' => ['lorem' => 'ip\\sum'], 'value' => "\"lorem\n\\ipsum\""]
+ 'foo' => ['labels' => ['lorem' => 'ip\\sum'], 'value' => "\"lorem\n\\ipsum\""],
])
);
$this->assertEquals(
'engelsystem_foo_count{bar="14"} 42',
- $engine->get('/metrics', ['foo_count' => ['labels' => ['bar' => 14], 'value' => 42],])
+ $engine->get('/metrics', ['foo_count' => ['labels' => ['bar' => 14], 'value' => 42]])
);
$this->assertEquals(
diff --git a/tests/Unit/Controllers/Metrics/StatsTest.php b/tests/Unit/Controllers/Metrics/StatsTest.php
index 8dc7459e..9ecd4a66 100644
--- a/tests/Unit/Controllers/Metrics/StatsTest.php
+++ b/tests/Unit/Controllers/Metrics/StatsTest.php
@@ -20,9 +20,9 @@ class StatsTest extends TestCase
use HasDatabase;
/**
- * @covers \Engelsystem\Controllers\Metrics\Stats::newUsers
- * @covers \Engelsystem\Controllers\Metrics\Stats::getQuery
* @covers \Engelsystem\Controllers\Metrics\Stats::__construct
+ * @covers \Engelsystem\Controllers\Metrics\Stats::getQuery
+ * @covers \Engelsystem\Controllers\Metrics\Stats::newUsers
*/
public function testNewUsers()
{
@@ -58,8 +58,8 @@ class StatsTest extends TestCase
}
/**
- * @covers \Engelsystem\Controllers\Metrics\Stats::tshirtSizes
* @covers \Engelsystem\Controllers\Metrics\Stats::raw
+ * @covers \Engelsystem\Controllers\Metrics\Stats::tshirtSizes
*/
public function testTshirtSizes()
{
diff --git a/tests/Unit/Database/DatabaseServiceProviderTest.php b/tests/Unit/Database/DatabaseServiceProviderTest.php
index c9c6f9e3..c3e4c5d0 100644
--- a/tests/Unit/Database/DatabaseServiceProviderTest.php
+++ b/tests/Unit/Database/DatabaseServiceProviderTest.php
@@ -30,7 +30,7 @@ class DatabaseServiceProviderTest extends ServiceProviderTest
list($app, $dbManager, $pdo, $database, $connection) = $this->prepare(
[
'driver' => 'sqlite',
- 'database' => ':memory:'
+ 'database' => ':memory:',
]
);
@@ -51,8 +51,8 @@ class DatabaseServiceProviderTest extends ServiceProviderTest
}
/**
- * @covers \Engelsystem\Database\DatabaseServiceProvider::register()
* @covers \Engelsystem\Database\DatabaseServiceProvider::exitOnError()
+ * @covers \Engelsystem\Database\DatabaseServiceProvider::register()
*/
public function testRegisterError()
{
diff --git a/tests/Unit/Database/DatabaseTest.php b/tests/Unit/Database/DatabaseTest.php
index 7aef51c3..c1f1a717 100644
--- a/tests/Unit/Database/DatabaseTest.php
+++ b/tests/Unit/Database/DatabaseTest.php
@@ -16,8 +16,8 @@ class DatabaseTest extends TestCase
/**
* @covers \Engelsystem\Database\Database::__construct()
- * @covers \Engelsystem\Database\Database::getPdo()
* @covers \Engelsystem\Database\Database::getConnection()
+ * @covers \Engelsystem\Database\Database::getPdo()
*/
public function testInit()
{
@@ -129,7 +129,8 @@ class DatabaseTest extends TestCase
id INT PRIMARY KEY NOT NULL,
data TEXT NOT NULL
);
- ');
+ '
+ );
$connection->statement('CREATE UNIQUE INDEX test_data_id_uindex ON test_data (id);');
$connection->insert("
INSERT INTO test_data (id, data)
diff --git a/tests/Unit/Database/DbTest.php b/tests/Unit/Database/DbTest.php
index a408f78f..09930c4f 100644
--- a/tests/Unit/Database/DbTest.php
+++ b/tests/Unit/Database/DbTest.php
@@ -12,8 +12,8 @@ use PHPUnit\Framework\TestCase;
class DbTest extends TestCase
{
/**
- * @covers \Engelsystem\Database\Db::setDbManager()
* @covers \Engelsystem\Database\Db::connection()
+ * @covers \Engelsystem\Database\Db::setDbManager()
*/
public function testSetDbManager()
{
@@ -132,7 +132,8 @@ class DbTest extends TestCase
id INT PRIMARY KEY NOT NULL,
data TEXT NOT NULL
);
- ');
+ '
+ );
Db::connection()->statement('CREATE UNIQUE INDEX test_data_id_uindex ON test_data (id);');
Db::insert("
INSERT INTO test_data (id, data)
diff --git a/tests/Unit/Database/Migration/MigrateTest.php b/tests/Unit/Database/Migration/MigrateTest.php
index 6dffbe2f..b1954fab 100644
--- a/tests/Unit/Database/Migration/MigrateTest.php
+++ b/tests/Unit/Database/Migration/MigrateTest.php
@@ -15,8 +15,8 @@ class MigrateTest extends TestCase
{
/**
* @covers \Engelsystem\Database\Migration\Migrate::__construct
- * @covers \Engelsystem\Database\Migration\Migrate::run
* @covers \Engelsystem\Database\Migration\Migrate::getMigrations
+ * @covers \Engelsystem\Database\Migration\Migrate::run
* @covers \Engelsystem\Database\Migration\Migrate::setOutput
*/
public function testRun()
@@ -112,11 +112,11 @@ class MigrateTest extends TestCase
/**
* @covers \Engelsystem\Database\Migration\Migrate::getMigrated
- * @covers \Engelsystem\Database\Migration\Migrate::migrate
- * @covers \Engelsystem\Database\Migration\Migrate::setMigrated
* @covers \Engelsystem\Database\Migration\Migrate::getMigrationFiles
- * @covers \Engelsystem\Database\Migration\Migrate::initMigration
* @covers \Engelsystem\Database\Migration\Migrate::getTableQuery
+ * @covers \Engelsystem\Database\Migration\Migrate::initMigration
+ * @covers \Engelsystem\Database\Migration\Migrate::migrate
+ * @covers \Engelsystem\Database\Migration\Migrate::setMigrated
*/
public function testRunIntegration()
{
diff --git a/tests/Unit/Exceptions/ExceptionsServiceProviderTest.php b/tests/Unit/Exceptions/ExceptionsServiceProviderTest.php
index b484f41f..c0569086 100644
--- a/tests/Unit/Exceptions/ExceptionsServiceProviderTest.php
+++ b/tests/Unit/Exceptions/ExceptionsServiceProviderTest.php
@@ -15,9 +15,9 @@ use PHPUnit\Framework\MockObject\MockObject;
class ExceptionsServiceProviderTest extends ServiceProviderTest
{
/**
- * @covers \Engelsystem\Exceptions\ExceptionsServiceProvider::register()
- * @covers \Engelsystem\Exceptions\ExceptionsServiceProvider::addProductionHandler()
* @covers \Engelsystem\Exceptions\ExceptionsServiceProvider::addDevelopmentHandler()
+ * @covers \Engelsystem\Exceptions\ExceptionsServiceProvider::addProductionHandler()
+ * @covers \Engelsystem\Exceptions\ExceptionsServiceProvider::register()
*/
public function testRegister()
{
diff --git a/tests/Unit/Exceptions/HandlerTest.php b/tests/Unit/Exceptions/HandlerTest.php
index af89dae7..baf2de82 100644
--- a/tests/Unit/Exceptions/HandlerTest.php
+++ b/tests/Unit/Exceptions/HandlerTest.php
@@ -99,8 +99,8 @@ class HandlerTest extends TestCase
}
/**
- * @covers \Engelsystem\Exceptions\Handler::setEnvironment()
* @covers \Engelsystem\Exceptions\Handler::getEnvironment()
+ * @covers \Engelsystem\Exceptions\Handler::setEnvironment()
*/
public function testEnvironment()
{
@@ -114,8 +114,8 @@ class HandlerTest extends TestCase
}
/**
- * @covers \Engelsystem\Exceptions\Handler::setHandler()
* @covers \Engelsystem\Exceptions\Handler::getHandler()
+ * @covers \Engelsystem\Exceptions\Handler::setHandler()
*/
public function testHandler()
{
@@ -133,8 +133,8 @@ class HandlerTest extends TestCase
}
/**
- * @covers \Engelsystem\Exceptions\Handler::setRequest()
* @covers \Engelsystem\Exceptions\Handler::getRequest()
+ * @covers \Engelsystem\Exceptions\Handler::setRequest()
*/
public function testRequest()
{
diff --git a/tests/Unit/Exceptions/Handlers/LegacyDevelopmentTest.php b/tests/Unit/Exceptions/Handlers/LegacyDevelopmentTest.php
index bc4625e9..f7355f76 100644
--- a/tests/Unit/Exceptions/Handlers/LegacyDevelopmentTest.php
+++ b/tests/Unit/Exceptions/Handlers/LegacyDevelopmentTest.php
@@ -2,7 +2,6 @@
namespace Engelsystem\Test\Unit\Exceptions\handlers;
-
use Engelsystem\Exceptions\Handlers\LegacyDevelopment;
use Engelsystem\Http\Request;
use ErrorException;
@@ -12,8 +11,8 @@ use PHPUnit\Framework\TestCase;
class LegacyDevelopmentTest extends TestCase
{
/**
- * @covers \Engelsystem\Exceptions\Handlers\LegacyDevelopment::render()
* @covers \Engelsystem\Exceptions\Handlers\LegacyDevelopment::formatStackTrace()
+ * @covers \Engelsystem\Exceptions\Handlers\LegacyDevelopment::render()
*/
public function testRender()
{
diff --git a/tests/Unit/Exceptions/Handlers/LegacyTest.php b/tests/Unit/Exceptions/Handlers/LegacyTest.php
index d7d65daf..d8ab6565 100644
--- a/tests/Unit/Exceptions/Handlers/LegacyTest.php
+++ b/tests/Unit/Exceptions/Handlers/LegacyTest.php
@@ -2,7 +2,6 @@
namespace Engelsystem\Test\Unit\Exceptions\handlers;
-
use Engelsystem\Exceptions\Handlers\Legacy;
use Engelsystem\Http\Request;
use Exception;
diff --git a/tests/Unit/Exceptions/Handlers/WhoopsTest.php b/tests/Unit/Exceptions/Handlers/WhoopsTest.php
index 74bdc457..67029d4d 100644
--- a/tests/Unit/Exceptions/Handlers/WhoopsTest.php
+++ b/tests/Unit/Exceptions/Handlers/WhoopsTest.php
@@ -2,7 +2,6 @@
namespace Engelsystem\Test\Unit\Exceptions\handlers;
-
use Engelsystem\Application;
use Engelsystem\Exceptions\Handlers\Whoops;
use Engelsystem\Helpers\Authenticator;
diff --git a/tests/Unit/Helpers/TranslationServiceProviderTest.php b/tests/Unit/Helpers/TranslationServiceProviderTest.php
index c5ba7386..41c08aa5 100644
--- a/tests/Unit/Helpers/TranslationServiceProviderTest.php
+++ b/tests/Unit/Helpers/TranslationServiceProviderTest.php
@@ -67,7 +67,7 @@ class TranslationServiceProviderTest extends ServiceProviderTest
[
'locale' => $locale,
'locales' => $locales,
- 'localeChangeCallback' => [$serviceProvider, 'setLocale']
+ 'localeChangeCallback' => [$serviceProvider, 'setLocale'],
]
)
->willReturn($translator);
@@ -82,5 +82,3 @@ class TranslationServiceProviderTest extends ServiceProviderTest
$serviceProvider->register();
}
}
-
-
diff --git a/tests/Unit/Helpers/TranslatorTest.php b/tests/Unit/Helpers/TranslatorTest.php
index 34050e42..45ca769b 100644
--- a/tests/Unit/Helpers/TranslatorTest.php
+++ b/tests/Unit/Helpers/TranslatorTest.php
@@ -11,11 +11,11 @@ class TranslatorTest extends ServiceProviderTest
{
/**
* @covers \Engelsystem\Helpers\Translator::__construct
- * @covers \Engelsystem\Helpers\Translator::setLocale
- * @covers \Engelsystem\Helpers\Translator::setLocales
* @covers \Engelsystem\Helpers\Translator::getLocale
* @covers \Engelsystem\Helpers\Translator::getLocales
* @covers \Engelsystem\Helpers\Translator::hasLocale
+ * @covers \Engelsystem\Helpers\Translator::setLocale
+ * @covers \Engelsystem\Helpers\Translator::setLocales
*/
public function testInit()
{
@@ -47,8 +47,8 @@ class TranslatorTest extends ServiceProviderTest
}
/**
- * @covers \Engelsystem\Helpers\Translator::translate
* @covers \Engelsystem\Helpers\Translator::replaceText
+ * @covers \Engelsystem\Helpers\Translator::translate
*/
public function testTranslate()
{
@@ -88,5 +88,3 @@ class TranslatorTest extends ServiceProviderTest
$this->assertEquals('2 Äpfel', $return);
}
}
-
-
diff --git a/tests/Unit/HelpersTest.php b/tests/Unit/HelpersTest.php
index 210e995e..6d182907 100644
--- a/tests/Unit/HelpersTest.php
+++ b/tests/Unit/HelpersTest.php
@@ -174,7 +174,7 @@ class HelpersTest extends TestCase
->withConsecutive(['lor', 'em'], ['foo', 'bar'])
->willReturn($response);
- $this->assertEquals($response, response('Lorem Ipsum?', 501, ['lor' => 'em', 'foo' => 'bar',]));
+ $this->assertEquals($response, response('Lorem Ipsum?', 501, ['lor' => 'em', 'foo' => 'bar']));
}
/**
@@ -285,6 +285,7 @@ class HelpersTest extends TestCase
*/
protected function getAppMock($alias, $object)
{
+ /** @var Application|MockObject $appMock */
$appMock = $this->getMockBuilder(Container::class)
->getMock();
@@ -293,7 +294,6 @@ class HelpersTest extends TestCase
->with($alias)
->willReturn($object);
- /** @var $appMock Application */
Application::setInstance($appMock);
return $appMock;
diff --git a/tests/Unit/Http/Exceptions/HttpExceptionTest.php b/tests/Unit/Http/Exceptions/HttpExceptionTest.php
index ce2b064d..6ab56d62 100644
--- a/tests/Unit/Http/Exceptions/HttpExceptionTest.php
+++ b/tests/Unit/Http/Exceptions/HttpExceptionTest.php
@@ -9,8 +9,8 @@ class HttpExceptionTest extends TestCase
{
/**
* @covers \Engelsystem\Http\Exceptions\HttpException::__construct
- * @covers \Engelsystem\Http\Exceptions\HttpException::getStatusCode
* @covers \Engelsystem\Http\Exceptions\HttpException::getHeaders
+ * @covers \Engelsystem\Http\Exceptions\HttpException::getStatusCode
*/
public function testConstruct()
{
diff --git a/tests/Unit/Http/LegacyUrlGeneratorTest.php b/tests/Unit/Http/LegacyUrlGeneratorTest.php
index 2c087f8f..8caf3c77 100644
--- a/tests/Unit/Http/LegacyUrlGeneratorTest.php
+++ b/tests/Unit/Http/LegacyUrlGeneratorTest.php
@@ -4,8 +4,8 @@ namespace Engelsystem\Test\Unit\Http;
use Engelsystem\Application;
use Engelsystem\Container\Container;
-use Engelsystem\Http\Request;
use Engelsystem\Http\LegacyUrlGenerator;
+use Engelsystem\Http\Request;
use Engelsystem\Http\UrlGeneratorInterface;
use PHPUnit\Framework\TestCase;
diff --git a/tests/Unit/Http/RequestTest.php b/tests/Unit/Http/RequestTest.php
index 26bf0116..4d942311 100644
--- a/tests/Unit/Http/RequestTest.php
+++ b/tests/Unit/Http/RequestTest.php
@@ -163,7 +163,7 @@ class RequestTest extends TestCase
[
'*',
'/foo/bar',
- 'https://lorem.ipsum/test?lor=em'
+ 'https://lorem.ipsum/test?lor=em',
] as $target
) {
$new = $request->withRequestTarget($target);
diff --git a/tests/Unit/Http/ResponseTest.php b/tests/Unit/Http/ResponseTest.php
index 6f57e1db..6f20ff67 100644
--- a/tests/Unit/Http/ResponseTest.php
+++ b/tests/Unit/Http/ResponseTest.php
@@ -26,8 +26,8 @@ class ResponseTest extends TestCase
}
/**
- * @covers \Engelsystem\Http\Response::withStatus
* @covers \Engelsystem\Http\Response::getReasonPhrase
+ * @covers \Engelsystem\Http\Response::withStatus
*/
public function testWithStatus()
{
@@ -85,4 +85,4 @@ class ResponseTest extends TestCase
$response = new Response();
$response->withView('foo');
}
-} \ No newline at end of file
+}
diff --git a/tests/Unit/Http/SessionHandlers/DatabaseHandlerTest.php b/tests/Unit/Http/SessionHandlers/DatabaseHandlerTest.php
index 61ab982d..14f23c00 100644
--- a/tests/Unit/Http/SessionHandlers/DatabaseHandlerTest.php
+++ b/tests/Unit/Http/SessionHandlers/DatabaseHandlerTest.php
@@ -12,8 +12,8 @@ class DatabaseHandlerTest extends TestCase
/**
* @covers \Engelsystem\Http\SessionHandlers\DatabaseHandler::__construct
- * @covers \Engelsystem\Http\SessionHandlers\DatabaseHandler::read
* @covers \Engelsystem\Http\SessionHandlers\DatabaseHandler::getQuery
+ * @covers \Engelsystem\Http\SessionHandlers\DatabaseHandler::read
*/
public function testRead()
{
@@ -25,8 +25,8 @@ class DatabaseHandlerTest extends TestCase
}
/**
- * @covers \Engelsystem\Http\SessionHandlers\DatabaseHandler::write
* @covers \Engelsystem\Http\SessionHandlers\DatabaseHandler::getCurrentTimestamp
+ * @covers \Engelsystem\Http\SessionHandlers\DatabaseHandler::write
*/
public function testWrite()
{
diff --git a/tests/Unit/Http/SessionServiceProviderTest.php b/tests/Unit/Http/SessionServiceProviderTest.php
index 204cfe1e..08f1945a 100644
--- a/tests/Unit/Http/SessionServiceProviderTest.php
+++ b/tests/Unit/Http/SessionServiceProviderTest.php
@@ -17,8 +17,8 @@ use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface as
class SessionServiceProviderTest extends ServiceProviderTest
{
/**
- * @covers \Engelsystem\Http\SessionServiceProvider::register()
* @covers \Engelsystem\Http\SessionServiceProvider::getSessionStorage()
+ * @covers \Engelsystem\Http\SessionServiceProvider::register()
*/
public function testRegister()
{
@@ -53,13 +53,13 @@ class SessionServiceProviderTest extends ServiceProviderTest
[Session::class],
[
NativeSessionStorage::class,
- ['options' => ['cookie_httponly' => true, 'name' => 'session'], 'handler' => null]
+ ['options' => ['cookie_httponly' => true, 'name' => 'session'], 'handler' => null],
],
[Session::class],
[DatabaseHandler::class],
[
NativeSessionStorage::class,
- ['options' => ['cookie_httponly' => true, 'name' => 'foobar'], 'handler' => $databaseHandler]
+ ['options' => ['cookie_httponly' => true, 'name' => 'foobar'], 'handler' => $databaseHandler],
],
[Session::class]
)
diff --git a/tests/Unit/Mail/EngelsystemMailerTest.php b/tests/Unit/Mail/EngelsystemMailerTest.php
index 0f60ff3b..12dc3b0b 100644
--- a/tests/Unit/Mail/EngelsystemMailerTest.php
+++ b/tests/Unit/Mail/EngelsystemMailerTest.php
@@ -40,9 +40,9 @@ class EngelsystemMailerTest extends TestCase
}
/**
+ * @covers \Engelsystem\Mail\EngelsystemMailer::getSubjectPrefix
* @covers \Engelsystem\Mail\EngelsystemMailer::send
* @covers \Engelsystem\Mail\EngelsystemMailer::setSubjectPrefix
- * @covers \Engelsystem\Mail\EngelsystemMailer::getSubjectPrefix
*/
public function testSend()
{
diff --git a/tests/Unit/Mail/MailerServiceProviderTest.php b/tests/Unit/Mail/MailerServiceProviderTest.php
index 793cd1f2..f0e1775f 100644
--- a/tests/Unit/Mail/MailerServiceProviderTest.php
+++ b/tests/Unit/Mail/MailerServiceProviderTest.php
@@ -79,7 +79,7 @@ class MailerServiceProviderTest extends ServiceProviderTest
[SendmailTransport::class, ['email' => ['driver' => 'sendmail']]],
[
SmtpTransport::class,
- $this->smtpConfig
+ $this->smtpConfig,
],
];
}
diff --git a/tests/Unit/Mail/MailerTest.php b/tests/Unit/Mail/MailerTest.php
index 24c6f69a..bfecdd07 100644
--- a/tests/Unit/Mail/MailerTest.php
+++ b/tests/Unit/Mail/MailerTest.php
@@ -13,8 +13,8 @@ class MailerTest extends TestCase
/**
* @covers \Engelsystem\Mail\Mailer::__construct
* @covers \Engelsystem\Mail\Mailer::getFromAddress
- * @covers \Engelsystem\Mail\Mailer::setFromAddress
* @covers \Engelsystem\Mail\Mailer::getFromName
+ * @covers \Engelsystem\Mail\Mailer::setFromAddress
* @covers \Engelsystem\Mail\Mailer::setFromName
*/
public function testInitAndSettersAndGetters()
diff --git a/tests/Unit/Mail/Transport/TransportTest.php b/tests/Unit/Mail/Transport/TransportTest.php
index 5e7b7b9b..ac7735bb 100644
--- a/tests/Unit/Mail/Transport/TransportTest.php
+++ b/tests/Unit/Mail/Transport/TransportTest.php
@@ -70,8 +70,8 @@ class TransportTest extends TestCase
}
/**
- * @covers \Engelsystem\Mail\Transport\Transport::getTo
* @covers \Engelsystem\Mail\Transport\Transport::formatTo
+ * @covers \Engelsystem\Mail\Transport\Transport::getTo
*/
public function testGetTo()
{
diff --git a/tests/Unit/Middleware/CallableHandlerTest.php b/tests/Unit/Middleware/CallableHandlerTest.php
index a0dbfce8..d59be60d 100644
--- a/tests/Unit/Middleware/CallableHandlerTest.php
+++ b/tests/Unit/Middleware/CallableHandlerTest.php
@@ -6,6 +6,7 @@ use Engelsystem\Container\Container;
use Engelsystem\Http\Response;
use Engelsystem\Middleware\CallableHandler;
use Engelsystem\Test\Unit\Middleware\Stub\HasStaticMethod;
+use InvalidArgumentException;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Psr\Http\Message\ResponseInterface;
@@ -18,7 +19,8 @@ class CallableHandlerTest extends TestCase
public function provideCallable()
{
return [
- [function () { }],
+ [function () {
+ }],
[[$this, 'provideCallable']],
[[HasStaticMethod::class, 'foo']],
];
@@ -113,7 +115,7 @@ class CallableHandlerTest extends TestCase
$this->assertEquals($response, $return);
$middleware = new CallableHandler($callable);
- $this->expectException(\InvalidArgumentException::class);
+ $this->expectException(InvalidArgumentException::class);
$middleware->handle($request);
}
diff --git a/tests/Unit/Middleware/RequestHandlerTest.php b/tests/Unit/Middleware/RequestHandlerTest.php
index 7ff803d0..8b943d71 100644
--- a/tests/Unit/Middleware/RequestHandlerTest.php
+++ b/tests/Unit/Middleware/RequestHandlerTest.php
@@ -136,8 +136,8 @@ class RequestHandlerTest extends TestCase
}
/**
- * @covers \Engelsystem\Middleware\RequestHandler::process
* @covers \Engelsystem\Middleware\RequestHandler::checkPermissions
+ * @covers \Engelsystem\Middleware\RequestHandler::process
*/
public function testCheckPermissions()
{
diff --git a/tests/Unit/Middleware/ResolvesMiddlewareTraitTest.php b/tests/Unit/Middleware/ResolvesMiddlewareTraitTest.php
index 320a6d6b..7cd4d9d3 100644
--- a/tests/Unit/Middleware/ResolvesMiddlewareTraitTest.php
+++ b/tests/Unit/Middleware/ResolvesMiddlewareTraitTest.php
@@ -14,8 +14,8 @@ use Psr\Http\Server\MiddlewareInterface;
class ResolvesMiddlewareTraitTest extends TestCase
{
/**
- * @covers \Engelsystem\Middleware\ResolvesMiddlewareTrait::resolveMiddleware
* @covers \Engelsystem\Middleware\ResolvesMiddlewareTrait::isMiddleware
+ * @covers \Engelsystem\Middleware\ResolvesMiddlewareTrait::resolveMiddleware
*/
public function testResolveMiddleware()
{
diff --git a/tests/Unit/Middleware/RouteDispatcherTest.php b/tests/Unit/Middleware/RouteDispatcherTest.php
index d6ed3408..d35c0f6b 100644
--- a/tests/Unit/Middleware/RouteDispatcherTest.php
+++ b/tests/Unit/Middleware/RouteDispatcherTest.php
@@ -16,8 +16,8 @@ use Psr\Http\Server\RequestHandlerInterface;
class RouteDispatcherTest extends TestCase
{
/**
- * @covers \Engelsystem\Middleware\RouteDispatcher::process
* @covers \Engelsystem\Middleware\RouteDispatcher::__construct
+ * @covers \Engelsystem\Middleware\RouteDispatcher::process
*/
public function testProcess()
{
diff --git a/tests/Unit/Middleware/Stub/HasStaticMethod.php b/tests/Unit/Middleware/Stub/HasStaticMethod.php
index 5ca2670e..329e1248 100644
--- a/tests/Unit/Middleware/Stub/HasStaticMethod.php
+++ b/tests/Unit/Middleware/Stub/HasStaticMethod.php
@@ -4,5 +4,7 @@ namespace Engelsystem\Test\Unit\Middleware\Stub;
class HasStaticMethod
{
- public static function foo() { }
+ public static function foo()
+ {
+ }
}
diff --git a/tests/Unit/Middleware/VerifyCsrfTokenTest.php b/tests/Unit/Middleware/VerifyCsrfTokenTest.php
index 636e1f81..cd593106 100644
--- a/tests/Unit/Middleware/VerifyCsrfTokenTest.php
+++ b/tests/Unit/Middleware/VerifyCsrfTokenTest.php
@@ -14,8 +14,8 @@ use Symfony\Component\HttpFoundation\Session\SessionInterface;
class VerifyCsrfTokenTest extends TestCase
{
/**
- * @covers \Engelsystem\Middleware\VerifyCsrfToken::process
* @covers \Engelsystem\Middleware\VerifyCsrfToken::isReading
+ * @covers \Engelsystem\Middleware\VerifyCsrfToken::process
*/
public function testProcess()
{
diff --git a/tests/Unit/Models/EventConfigTest.php b/tests/Unit/Models/EventConfigTest.php
index 5a0286b5..e2ab5d10 100644
--- a/tests/Unit/Models/EventConfigTest.php
+++ b/tests/Unit/Models/EventConfigTest.php
@@ -102,8 +102,7 @@ class EventConfigTest extends TestCase
*/
protected function getEventConfig()
{
- return new class extends EventConfig
- {
+ return new class extends EventConfig {
/**
* @param string $value
* @param string $type
diff --git a/tests/Unit/Models/User/Stub/HasUserModelImplementation.php b/tests/Unit/Models/User/Stub/HasUserModelImplementation.php
index 0456eb6a..6d442bdd 100644
--- a/tests/Unit/Models/User/Stub/HasUserModelImplementation.php
+++ b/tests/Unit/Models/User/Stub/HasUserModelImplementation.php
@@ -6,5 +6,4 @@ use Engelsystem\Models\User\HasUserModel;
class HasUserModelImplementation extends HasUserModel
{
-
}
diff --git a/tests/Unit/Models/User/UserTest.php b/tests/Unit/Models/User/UserTest.php
index 478c02dd..0e17d137 100644
--- a/tests/Unit/Models/User/UserTest.php
+++ b/tests/Unit/Models/User/UserTest.php
@@ -37,14 +37,14 @@ class UserTest extends TestCase
'dect' => '1234567',
'email' => 'foo@bar.batz',
'mobile' => '1234/12341234',
- ]
+ ],
],
[
PersonalData::class,
'personalData',
[
- 'first_name' => 'Foo'
- ]
+ 'first_name' => 'Foo',
+ ],
],
[
Settings::class,
@@ -52,14 +52,14 @@ class UserTest extends TestCase
[
'language' => 'de_DE',
'theme' => 4,
- ]
+ ],
],
[
State::class,
'state',
[
'force_active' => true,
- ]
+ ],
],
];
}
diff --git a/tests/Unit/Renderer/RendererServiceProviderTest.php b/tests/Unit/Renderer/RendererServiceProviderTest.php
index 36263b0c..224e36d4 100644
--- a/tests/Unit/Renderer/RendererServiceProviderTest.php
+++ b/tests/Unit/Renderer/RendererServiceProviderTest.php
@@ -13,8 +13,8 @@ class RendererServiceProviderTest extends ServiceProviderTest
{
/**
* @covers \Engelsystem\Renderer\RendererServiceProvider::register()
- * @covers \Engelsystem\Renderer\RendererServiceProvider::registerRenderer()
* @covers \Engelsystem\Renderer\RendererServiceProvider::registerHtmlEngine()
+ * @covers \Engelsystem\Renderer\RendererServiceProvider::registerRenderer()
*/
public function testRegister()
{
diff --git a/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php b/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php
index eb78e1ab..2f64360e 100644
--- a/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php
+++ b/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php
@@ -39,6 +39,7 @@ abstract class ExtensionTest extends TestCase
* @param string $name
* @param callable $callback
* @param TwigFunction[] $functions
+ * @param array $options
*/
protected function assertExtensionExists($name, $callback, $functions, $options = [])
{
diff --git a/tests/Unit/Renderer/Twig/Extensions/LegacyTest.php b/tests/Unit/Renderer/Twig/Extensions/LegacyTest.php
index 613af0da..b6c19d14 100644
--- a/tests/Unit/Renderer/Twig/Extensions/LegacyTest.php
+++ b/tests/Unit/Renderer/Twig/Extensions/LegacyTest.php
@@ -29,8 +29,8 @@ class LegacyTest extends ExtensionTest
}
/**
- * @covers \Engelsystem\Renderer\Twig\Extensions\Legacy::getPage
* @covers \Engelsystem\Renderer\Twig\Extensions\Legacy::__construct
+ * @covers \Engelsystem\Renderer\Twig\Extensions\Legacy::getPage
*/
public function testIsAuthenticated()
{
diff --git a/tests/Unit/ServiceProviderTest.php b/tests/Unit/ServiceProviderTest.php
index 27929fc7..bf9f5e3f 100644
--- a/tests/Unit/ServiceProviderTest.php
+++ b/tests/Unit/ServiceProviderTest.php
@@ -13,7 +13,6 @@ abstract class ServiceProviderTest extends TestCase
*/
protected function getApp($methods = ['make', 'instance'])
{
- /** @var Application|MockObject $app */
return $this->getMockBuilder(Application::class)
->setMethods($methods)
->getMock();