diff --git a/tests/SwooleClientTest.php b/tests/SwooleClientTest.php index 9adc8cd71..6547357fd 100644 --- a/tests/SwooleClientTest.php +++ b/tests/SwooleClientTest.php @@ -13,7 +13,7 @@ class SwooleClientTest extends TestCase { - public function test_marshal_request_method_marshals_proper_illuminate_request() + public function test_marshal_request_method_marshals_proper_illuminate_request(): void { $client = new SwooleClient; @@ -57,7 +57,7 @@ public function rawContent() $this->assertSame($givenContext, $context); } - public function test_can_serve_static_files_if_configured_to_and_file_is_within_public_directory() + public function test_can_serve_static_files_if_configured_to_and_file_is_within_public_directory(): void { $client = new SwooleClient; @@ -71,7 +71,7 @@ public function test_can_serve_static_files_if_configured_to_and_file_is_within_ $this->assertTrue($client->canServeRequestAsStaticFile($request, $context)); } - public function test_cant_serve_static_files_if_file_is_outside_public_directory() + public function test_cant_serve_static_files_if_file_is_outside_public_directory(): void { $client = new SwooleClient; @@ -85,7 +85,7 @@ public function test_cant_serve_static_files_if_file_is_outside_public_directory $this->assertFalse($client->canServeRequestAsStaticFile($request, $context)); } - public function test_cant_serve_static_files_if_file_has_forbidden_extension() + public function test_cant_serve_static_files_if_file_has_forbidden_extension(): void { $client = new SwooleClient; @@ -100,7 +100,7 @@ public function test_cant_serve_static_files_if_file_has_forbidden_extension() } /** @doesNotPerformAssertions @test */ - public function test_static_file_can_be_served() + public function test_static_file_can_be_served(): void { $client = new SwooleClient; @@ -119,7 +119,8 @@ public function test_static_file_can_be_served() $client->serveStaticFile($request, $context); } - public function test_static_file_headers_can_be_sent() + /** @doesNotPerformAssertions @test */ + public function test_static_file_headers_can_be_sent(): void { $client = new SwooleClient; @@ -145,7 +146,7 @@ public function test_static_file_headers_can_be_sent() $client->serveStaticFile($request, $context); } - public function test_can_serve_static_files_through_symlink() + public function test_can_serve_static_files_through_symlink(): void { $client = new SwooleClient; @@ -159,7 +160,7 @@ public function test_can_serve_static_files_through_symlink() $this->assertTrue($client->canServeRequestAsStaticFile($request, $context)); } - public function test_cant_serve_static_files_through_symlink_using_directory_traversal() + public function test_cant_serve_static_files_through_symlink_using_directory_traversal(): void { $client = new SwooleClient; @@ -174,13 +175,11 @@ public function test_cant_serve_static_files_through_symlink_using_directory_tra } /** @doesNotPerformAssertions @test */ - public function test_respond_method_sends_response_to_swoole() + public function test_respond_method_sends_response_to_swoole(): void { - $client = new SwooleClient; + $this->createApplication(); - if (extension_loaded('openswoole')) { - $this->markTestSkipped('This test is not compatible with Open Swoole'); - } + $client = new SwooleClient; $swooleResponse = Mockery::mock('Swoole\Http\Response'); @@ -203,14 +202,10 @@ public function test_respond_method_sends_response_to_swoole() } /** @doesNotPerformAssertions @test */ - public function test_respond_method_send_streamed_response_to_swoole() + public function test_respond_method_send_streamed_response_to_swoole(): void { $client = new SwooleClient; - if (extension_loaded('openswoole')) { - $this->markTestSkipped('This test is not compatible with Open Swoole'); - } - $swooleResponse = Mockery::mock('Swoole\Http\Response'); $swooleResponse->shouldReceive('status')->once()->with(200); @@ -228,14 +223,10 @@ public function test_respond_method_send_streamed_response_to_swoole() } /** @doesNotPerformAssertions @test */ - public function test_respond_method_with_laravel_specific_status_code_sends_response_to_swoole() + public function test_respond_method_with_laravel_specific_status_code_sends_response_to_swoole(): void { $client = new SwooleClient; - if (extension_loaded('openswoole')) { - $this->markTestSkipped('This test is not compatible with Open Swoole'); - } - $swooleResponse = Mockery::mock('Swoole\Http\Response'); $swooleResponse->shouldReceive('status')->once()->with(419, 'Page Expired'); @@ -251,14 +242,10 @@ public function test_respond_method_with_laravel_specific_status_code_sends_resp } /** @doesNotPerformAssertions @test */ - public function test_error_method_sends_error_response_to_swoole() + public function test_error_method_sends_error_response_to_swoole(): void { $client = new SwooleClient; - if (extension_loaded('openswoole')) { - $this->markTestSkipped('This test is not compatible with Open Swoole'); - } - $swooleResponse = Mockery::spy('Swoole\Http\Response'); $app = $this->createApplication(); @@ -275,14 +262,10 @@ public function test_error_method_sends_error_response_to_swoole() } /** @doesNotPerformAssertions @test */ - public function test_error_method_sends_detailed_error_response_to_swoole_in_debug_mode() + public function test_error_method_sends_detailed_error_response_to_swoole_in_debug_mode(): void { $client = new SwooleClient; - if (extension_loaded('openswoole')) { - $this->markTestSkipped('This test is not compatible with Open Swoole'); - } - $swooleResponse = Mockery::spy('Swoole\Http\Response'); $app = $this->createApplication();