Skip to content

Commit

Permalink
fix/main: fixing cs
Browse files Browse the repository at this point in the history
  • Loading branch information
2amjsouza committed Aug 10, 2023
1 parent e8e23b8 commit b808bf4
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 24 deletions.
1 change: 0 additions & 1 deletion app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Providers;

use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Auth;

class AuthServiceProvider extends ServiceProvider
{
Expand Down
2 changes: 0 additions & 2 deletions tests/Unit/CommandsTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?php


use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

class CommandsTest extends TestCase
Expand Down
24 changes: 16 additions & 8 deletions tests/Unit/HttpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ protected function setUp(): void
appSecret: $accessKeyProperties['appSecret'],
timeStamp: $this->timeStamp,
);
}
catch (Exception $exception) {
} catch (Exception $exception) {
$this->fail($exception->getMessage());
}
}
Expand All @@ -49,8 +48,11 @@ public function test_invalid_token(string $token)
->withToken($token)
->postJson('/api/email/send')
->assertStatus(500)
->assertJson(fn (AssertableJson $json) =>
$json->has('error', fn (AssertableJson $error) =>
->assertJson(
fn (AssertableJson $json) =>
$json->has(
'error',
fn (AssertableJson $error) =>
$error->whereType('message', 'string')
->where('message', 'Invalid token.')
->etc()
Expand All @@ -70,8 +72,11 @@ public function test_invalid_access_key(string $accessKey)
->withToken('x')
->postJson('/api/email/send')
->assertStatus(500)
->assertJson(fn (AssertableJson $json) =>
$json->has('error', fn (AssertableJson $error) =>
->assertJson(
fn (AssertableJson $json) =>
$json->has(
'error',
fn (AssertableJson $error) =>
$error->whereType('message', 'string')
->where('message', 'Invalid access token.')
->etc()
Expand All @@ -93,8 +98,11 @@ public function test_expired_token()
->withToken($this->signature)
->postJson('/api/email/send')
->assertStatus(500)
->assertJson(fn (AssertableJson $json) =>
$json->has('error', fn (AssertableJson $error) =>
->assertJson(
fn (AssertableJson $json) =>
$json->has(
'error',
fn (AssertableJson $error) =>
$error->whereType('message', 'string')
->where('message', 'Token expired.')
->etc()
Expand Down
1 change: 0 additions & 1 deletion tests/Unit/JobsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use App\Classes\FilesHandler;
use App\Jobs\EmailDispatcher;
use App\Jobs\FilesCleanup;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Queue;
Expand Down
3 changes: 1 addition & 2 deletions tests/Unit/MailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@


use App\Mail\Message;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Mail\Attachment;
use I7lluminate\Mail\Attachment;
use Illuminate\Support\Facades\Mail;
use Tests\TestCase;
use Illuminate\Support\Facades\Storage;
Expand Down
15 changes: 5 additions & 10 deletions tests/Unit/TokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ protected function setUp(): void

try {
$this->accessKeyProperties = AuthorizationProvider::getTokenProperties('tests');
}
catch (Exception $exception) {
} catch (Exception $exception) {
$this->fail($exception->getMessage());
}
}
Expand All @@ -38,8 +37,7 @@ public function test_sign_token(): string
$this->assertIsString($signature);

return $signature;
}
catch (Exception $exception) {
} catch (Exception $exception) {
$this->fail($exception->getMessage());
}
}
Expand All @@ -65,8 +63,7 @@ public function test_token_time_is_valid()
AuthorizationProvider::checkTokenExpired($this->timeStamp);

$this->expectNotToPerformAssertions();
}
catch (Exception $exception) {
} catch (Exception $exception) {
$this->fail($exception->getMessage());
}
}
Expand All @@ -90,8 +87,7 @@ public function test_get_token_properties(string $accessKey)

$this->assertArrayHasKey('appKey', $tokenProperties);
$this->assertArrayHasKey('appSecret', $tokenProperties);
}
catch (Exception $exception) {
} catch (Exception $exception) {
$this->assertEquals('Invalid access token.', $exception->getMessage());
}
}
Expand All @@ -110,8 +106,7 @@ public function test_check_signature(string $accessKey, string $timeStampCheck,
AuthorizationProvider::checkSignature($accessKey, $signature, $timeStampCheck);

$this->expectNotToPerformAssertions();
}
catch (Exception $exception) {
} catch (Exception $exception) {
$this->assertEquals('Invalid token.', $exception->getMessage());
}
}
Expand Down

0 comments on commit b808bf4

Please sign in to comment.