diff --git a/app/Http/Middleware/CheckInstallation.php b/app/Http/Middleware/CheckInstallation.php index 23ed89b2..df003fde 100644 --- a/app/Http/Middleware/CheckInstallation.php +++ b/app/Http/Middleware/CheckInstallation.php @@ -9,7 +9,7 @@ class CheckInstallation public function handle($request, \Closure $next) { if (env('DB_CONNECTION') == 'dummy') { - return $next($request); + return $next($request); // @codeCoverageIgnore } if (SetupController::checkTablesExist()) { diff --git a/app/Http/Middleware/CheckPlayerExist.php b/app/Http/Middleware/CheckPlayerExist.php index 6b669263..bae52876 100644 --- a/app/Http/Middleware/CheckPlayerExist.php +++ b/app/Http/Middleware/CheckPlayerExist.php @@ -32,9 +32,11 @@ class CheckPlayerExist $responses = event(new CheckPlayerExists($player_name)); foreach ($responses as $r) { + // @codeCoverageIgnoreStart if ($r) { return $next($request); - } // @codeCoverageIgnore + } + // @codeCoverageIgnoreEnd } if (! Player::where('name', $player_name)->get()->isEmpty()) { diff --git a/tests/AdminControllerTest.php b/tests/AdminControllerTest.php index ee8f3cd2..8b93e4a8 100644 --- a/tests/AdminControllerTest.php +++ b/tests/AdminControllerTest.php @@ -129,6 +129,8 @@ class AdminControllerTest extends BrowserKitTestCase ->type('/^([0-9]+)$/', 'custom_player_name_regexp') ->select('1', 'api_type') ->check('auto_del_invalid_texture') + ->uncheck('allow_downloading_texture') + ->type('abc', 'texture_name_regexp') ->type('policy', 'content_policy') ->type('code', 'comment_script') ->press('submit_general'); @@ -143,6 +145,8 @@ class AdminControllerTest extends BrowserKitTestCase $this->assertEquals('/^([0-9]+)$/', option('custom_player_name_regexp')); $this->assertEquals('1', option('api_type')); $this->assertTrue(option('auto_del_invalid_texture')); + $this->assertFalse(option('allow_downloading_texture')); + $this->assertEquals('abc', option('texture_name_regexp')); $this->assertEquals('policy', option_localized('content_policy')); $this->assertEquals('code', option('comment_script')); diff --git a/tests/SkinlibControllerTest.php b/tests/SkinlibControllerTest.php index 280997b3..445b2bb3 100644 --- a/tests/SkinlibControllerTest.php +++ b/tests/SkinlibControllerTest.php @@ -358,6 +358,9 @@ class SkinlibControllerTest extends TestCase ->get('/skinlib/upload') ->assertViewHas('user') ->assertViewHas('with_out_filter', true); + + option(['texture_name_regexp' => 'abc']); + $this->get('/skinlib/upload')->assertViewHas('extra'); } public function testHandleUpload()