Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 16 additions & 33 deletions tests/SwooleClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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');

Expand All @@ -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);
Expand All @@ -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');
Expand All @@ -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();
Expand All @@ -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();
Expand Down