mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-16 04:02:15 +01:00
Updated dependencies; Fixed codeformatting and phpstan
This commit is contained in:
committed by
Constantin Graf
parent
5b7df869ad
commit
d8968399d6
@@ -6,6 +6,4 @@ namespace Tests\Unit\Endpoint\Api\V1;
|
||||
|
||||
use Tests\TestCaseWithDatabase;
|
||||
|
||||
class ApiEndpointTestAbstract extends TestCaseWithDatabase
|
||||
{
|
||||
}
|
||||
class ApiEndpointTestAbstract extends TestCaseWithDatabase {}
|
||||
|
||||
@@ -43,7 +43,7 @@ class ExportEndpointTest extends ApiEndpointTestAbstract
|
||||
->withArgs(function (Organization $organization) use (&$user): bool {
|
||||
return $organization->is($user->organization);
|
||||
})
|
||||
->andThrow(new ExportException())
|
||||
->andThrow(new ExportException)
|
||||
->once();
|
||||
});
|
||||
Passport::actingAs($user->user);
|
||||
|
||||
@@ -6,6 +6,4 @@ namespace Tests\Unit\Endpoint\Web;
|
||||
|
||||
use Tests\TestCaseWithDatabase;
|
||||
|
||||
abstract class EndpointTestAbstract extends TestCaseWithDatabase
|
||||
{
|
||||
}
|
||||
abstract class EndpointTestAbstract extends TestCaseWithDatabase {}
|
||||
|
||||
@@ -32,7 +32,7 @@ class AuditResourceTest extends FilamentTestCase
|
||||
// Arrange
|
||||
$user = $this->createUserWithPermission();
|
||||
$timeEntry = TimeEntry::factory()->forMember($user->member)->create();
|
||||
DB::table((new Audit())->getTable())->delete();
|
||||
DB::table((new Audit)->getTable())->delete();
|
||||
$audits = Audit::factory()->auditFor($timeEntry)->auditUser($user->user)->createMany(5);
|
||||
|
||||
// Act
|
||||
@@ -46,7 +46,7 @@ class AuditResourceTest extends FilamentTestCase
|
||||
public function test_can_see_view_page_of_audit(): void
|
||||
{
|
||||
// Arrange
|
||||
DB::table((new Audit())->getTable())->delete();
|
||||
DB::table((new Audit)->getTable())->delete();
|
||||
$audit = Audit::factory()->create();
|
||||
|
||||
// Act
|
||||
|
||||
@@ -79,7 +79,7 @@ class UserResourceTest extends FilamentTestCase
|
||||
$this->mock(DeletionService::class, function (MockInterface $mock) use ($user): void {
|
||||
$mock->shouldReceive('deleteUser')
|
||||
->withArgs(fn (User $userArg) => $userArg->is($user->user))
|
||||
->andThrow(new CanNotDeleteUserWhoIsOwnerOfOrganizationWithMultipleMembers());
|
||||
->andThrow(new CanNotDeleteUserWhoIsOwnerOfOrganizationWithMultipleMembers);
|
||||
});
|
||||
|
||||
// Act
|
||||
|
||||
@@ -26,6 +26,5 @@ class OrganizationModelTest extends ModelTestAbstract
|
||||
// Assert
|
||||
$this->assertNotNull($membersRel);
|
||||
$this->assertCount(3, $membersRel);
|
||||
$this->assertTrue($membersRel->first()->is($members->first()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ class ColorRuleTest extends TestCase
|
||||
$validator = Validator::make([
|
||||
'color' => '#ef5350',
|
||||
], [
|
||||
'color' => [new ColorRule()],
|
||||
'color' => [new ColorRule],
|
||||
]);
|
||||
|
||||
// Act
|
||||
@@ -38,7 +38,7 @@ class ColorRuleTest extends TestCase
|
||||
$validator = Validator::make([
|
||||
'color' => true,
|
||||
], [
|
||||
'color' => [new ColorRule()],
|
||||
'color' => [new ColorRule],
|
||||
]);
|
||||
|
||||
// Act
|
||||
@@ -56,7 +56,7 @@ class ColorRuleTest extends TestCase
|
||||
$validator = Validator::make([
|
||||
'color' => 'rgb(0,0,0)',
|
||||
], [
|
||||
'color' => [new ColorRule()],
|
||||
'color' => [new ColorRule],
|
||||
]);
|
||||
|
||||
// Act
|
||||
|
||||
@@ -20,7 +20,7 @@ class CurrencyRuleTest extends TestCase
|
||||
$validator = Validator::make([
|
||||
'currency' => 'EUR',
|
||||
], [
|
||||
'currency' => [new CurrencyRule()],
|
||||
'currency' => [new CurrencyRule],
|
||||
]);
|
||||
|
||||
// Act
|
||||
@@ -38,7 +38,7 @@ class CurrencyRuleTest extends TestCase
|
||||
$validator = Validator::make([
|
||||
'currency' => true,
|
||||
], [
|
||||
'currency' => [new CurrencyRule()],
|
||||
'currency' => [new CurrencyRule],
|
||||
]);
|
||||
|
||||
// Act
|
||||
@@ -56,7 +56,7 @@ class CurrencyRuleTest extends TestCase
|
||||
$validator = Validator::make([
|
||||
'currency' => 'XXX',
|
||||
], [
|
||||
'currency' => [new CurrencyRule()],
|
||||
'currency' => [new CurrencyRule],
|
||||
]);
|
||||
|
||||
// Act
|
||||
@@ -74,7 +74,7 @@ class CurrencyRuleTest extends TestCase
|
||||
$validator = Validator::make([
|
||||
'currency' => 'eur',
|
||||
], [
|
||||
'currency' => [new CurrencyRule()],
|
||||
'currency' => [new CurrencyRule],
|
||||
]);
|
||||
|
||||
// Act
|
||||
|
||||
@@ -23,7 +23,7 @@ class ClockifyProjectsImporterTest extends ImporterTestAbstract
|
||||
// Arrange
|
||||
$organization = Organization::factory()->create();
|
||||
$timezone = 'Europe/Vienna';
|
||||
$importer = new ClockifyProjectsImporter();
|
||||
$importer = new ClockifyProjectsImporter;
|
||||
$importer->init($organization);
|
||||
$data = Storage::disk('testfiles')->get('clockify_projects_import_test_1.csv');
|
||||
|
||||
@@ -39,11 +39,11 @@ class ClockifyProjectsImporterTest extends ImporterTestAbstract
|
||||
// Arrange
|
||||
$organization = Organization::factory()->create();
|
||||
$timezone = 'Europe/Vienna';
|
||||
$importer = new ClockifyProjectsImporter();
|
||||
$importer = new ClockifyProjectsImporter;
|
||||
$importer->init($organization);
|
||||
$data = Storage::disk('testfiles')->get('clockify_projects_import_test_1.csv');
|
||||
$importer->importData($data, $timezone);
|
||||
$importer = new ClockifyProjectsImporter();
|
||||
$importer = new ClockifyProjectsImporter;
|
||||
$importer->init($organization);
|
||||
|
||||
// Act
|
||||
|
||||
@@ -23,7 +23,7 @@ class ClockifyTimeEntriesImporterTest extends ImporterTestAbstract
|
||||
// Arrange
|
||||
$organization = Organization::factory()->create();
|
||||
$timezone = 'Europe/Vienna';
|
||||
$importer = new ClockifyTimeEntriesImporter();
|
||||
$importer = new ClockifyTimeEntriesImporter;
|
||||
$importer->init($organization);
|
||||
$data = Storage::disk('testfiles')->get('clockify_time_entries_import_test_1.csv');
|
||||
|
||||
@@ -47,11 +47,11 @@ class ClockifyTimeEntriesImporterTest extends ImporterTestAbstract
|
||||
// Arrange
|
||||
$organization = Organization::factory()->create();
|
||||
$timezone = 'Europe/Vienna';
|
||||
$importer = new ClockifyTimeEntriesImporter();
|
||||
$importer = new ClockifyTimeEntriesImporter;
|
||||
$importer->init($organization);
|
||||
$data = Storage::disk('testfiles')->get('clockify_time_entries_import_test_1.csv');
|
||||
$importer->importData($data, $timezone);
|
||||
$importer = new ClockifyTimeEntriesImporter();
|
||||
$importer = new ClockifyTimeEntriesImporter;
|
||||
$importer->init($organization);
|
||||
|
||||
// Act
|
||||
|
||||
@@ -17,7 +17,7 @@ class ImporterProviderTest extends TestCase
|
||||
public function test_register_importer_can_register_a_new_importer_for_example_in_an_extension(): void
|
||||
{
|
||||
// Arrange
|
||||
$provider = new ImporterProvider();
|
||||
$provider = new ImporterProvider;
|
||||
|
||||
// Act
|
||||
$provider->registerImporter('some_provider_importer', ClockifyProjectsImporter::class);
|
||||
@@ -30,7 +30,7 @@ class ImporterProviderTest extends TestCase
|
||||
public function test_get_importer_keys_return_the_keys_of_the_available_importers(): void
|
||||
{
|
||||
// Arrange
|
||||
$provider = new ImporterProvider();
|
||||
$provider = new ImporterProvider;
|
||||
|
||||
// Act
|
||||
$keys = $provider->getImporterKeys();
|
||||
|
||||
@@ -204,7 +204,7 @@ class ImporterTestAbstract extends TestCase
|
||||
{
|
||||
$tempDir = TemporaryDirectory::make();
|
||||
$zipPath = $tempDir->path('test.zip');
|
||||
$zip = new ZipArchive();
|
||||
$zip = new ZipArchive;
|
||||
$zip->open($zipPath, ZipArchive::CREATE);
|
||||
foreach (Storage::disk('testfiles')->allFiles($folder) as $file) {
|
||||
$zip->addFile(Storage::disk('testfiles')->path($file), Str::of($file)->after($folder.'/')->value());
|
||||
|
||||
@@ -23,7 +23,7 @@ class SolidtimeImporterTest extends ImporterTestAbstract
|
||||
// Arrange
|
||||
$organization = Organization::factory()->create();
|
||||
$timezone = 'Europe/Vienna';
|
||||
$importer = new SolidtimeImporter();
|
||||
$importer = new SolidtimeImporter;
|
||||
$importer->init($organization);
|
||||
|
||||
// Act
|
||||
@@ -44,7 +44,7 @@ class SolidtimeImporterTest extends ImporterTestAbstract
|
||||
$zipPath = $this->createTestZip('solidtime_import_test_1');
|
||||
$timezone = 'Europe/Vienna';
|
||||
$organization = Organization::factory()->create();
|
||||
$importer = new SolidtimeImporter();
|
||||
$importer = new SolidtimeImporter;
|
||||
$importer->init($organization);
|
||||
$data = file_get_contents($zipPath);
|
||||
|
||||
@@ -69,11 +69,11 @@ class SolidtimeImporterTest extends ImporterTestAbstract
|
||||
$zipPath = $this->createTestZip('solidtime_import_test_1');
|
||||
$timezone = 'Europe/Vienna';
|
||||
$organization = Organization::factory()->create();
|
||||
$importer = new SolidtimeImporter();
|
||||
$importer = new SolidtimeImporter;
|
||||
$importer->init($organization);
|
||||
$data = file_get_contents($zipPath);
|
||||
$importer->importData($data, $timezone);
|
||||
$importer = new SolidtimeImporter();
|
||||
$importer = new SolidtimeImporter;
|
||||
$importer->init($organization);
|
||||
|
||||
// Act
|
||||
|
||||
@@ -23,7 +23,7 @@ class TogglDataImporterTest extends ImporterTestAbstract
|
||||
// Arrange
|
||||
$organization = Organization::factory()->create();
|
||||
$timezone = 'Europe/Vienna';
|
||||
$importer = new TogglDataImporter();
|
||||
$importer = new TogglDataImporter;
|
||||
$importer->init($organization);
|
||||
|
||||
// Act
|
||||
@@ -44,7 +44,7 @@ class TogglDataImporterTest extends ImporterTestAbstract
|
||||
$zipPath = $this->createTestZip('toggl_data_import_test_1');
|
||||
$timezone = 'Europe/Vienna';
|
||||
$organization = Organization::factory()->create();
|
||||
$importer = new TogglDataImporter();
|
||||
$importer = new TogglDataImporter;
|
||||
$importer->init($organization);
|
||||
$data = file_get_contents($zipPath);
|
||||
|
||||
@@ -68,11 +68,11 @@ class TogglDataImporterTest extends ImporterTestAbstract
|
||||
$zipPath = $this->createTestZip('toggl_data_import_test_1');
|
||||
$timezone = 'Europe/Vienna';
|
||||
$organization = Organization::factory()->create();
|
||||
$importer = new TogglDataImporter();
|
||||
$importer = new TogglDataImporter;
|
||||
$importer->init($organization);
|
||||
$data = file_get_contents($zipPath);
|
||||
$importer->importData($data, $timezone);
|
||||
$importer = new TogglDataImporter();
|
||||
$importer = new TogglDataImporter;
|
||||
$importer->init($organization);
|
||||
|
||||
// Act
|
||||
|
||||
@@ -24,7 +24,7 @@ class TogglTimeEntriesImporterTest extends ImporterTestAbstract
|
||||
// Arrange
|
||||
$organization = Organization::factory()->create();
|
||||
$timezone = 'Europe/Vienna';
|
||||
$importer = new TogglTimeEntriesImporter();
|
||||
$importer = new TogglTimeEntriesImporter;
|
||||
$importer->init($organization);
|
||||
$data = Storage::disk('testfiles')->get('toggl_time_entries_import_test_1.csv');
|
||||
|
||||
@@ -52,11 +52,11 @@ class TogglTimeEntriesImporterTest extends ImporterTestAbstract
|
||||
// Arrange
|
||||
$organization = Organization::factory()->create();
|
||||
$timezone = 'Europe/Vienna';
|
||||
$importer = new TogglTimeEntriesImporter();
|
||||
$importer = new TogglTimeEntriesImporter;
|
||||
$importer->init($organization);
|
||||
$data = Storage::disk('testfiles')->get('toggl_time_entries_import_test_1.csv');
|
||||
$importer->importData($data, $timezone);
|
||||
$importer = new TogglTimeEntriesImporter();
|
||||
$importer = new TogglTimeEntriesImporter;
|
||||
$importer->init($organization);
|
||||
|
||||
// Act
|
||||
|
||||
@@ -26,7 +26,7 @@ class PermissionStoreTest extends TestCase
|
||||
$organization = Organization::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
$organization->users()->attach($user, ['role' => Role::Employee->value]);
|
||||
$permissionStore = new PermissionStore();
|
||||
$permissionStore = new PermissionStore;
|
||||
|
||||
// Act
|
||||
$result = $permissionStore->has($organization, 'permission');
|
||||
@@ -40,7 +40,7 @@ class PermissionStoreTest extends TestCase
|
||||
// Arrange
|
||||
$organization = Organization::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
$permissionStore = new PermissionStore();
|
||||
$permissionStore = new PermissionStore;
|
||||
$this->actingAs($user);
|
||||
|
||||
// Act
|
||||
@@ -56,7 +56,7 @@ class PermissionStoreTest extends TestCase
|
||||
$organization = Organization::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
$organization->users()->attach($user, ['role' => Role::Employee->value]);
|
||||
$permissionStore = new PermissionStore();
|
||||
$permissionStore = new PermissionStore;
|
||||
$this->actingAs($user);
|
||||
|
||||
// Act
|
||||
@@ -72,7 +72,7 @@ class PermissionStoreTest extends TestCase
|
||||
$organization = Organization::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
$organization->users()->attach($user, ['role' => Role::Employee->value]);
|
||||
$permissionStore = new PermissionStore();
|
||||
$permissionStore = new PermissionStore;
|
||||
$this->actingAs($user);
|
||||
|
||||
// Act
|
||||
@@ -88,7 +88,7 @@ class PermissionStoreTest extends TestCase
|
||||
$organization = Organization::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
$organization->users()->attach($user, ['role' => Role::Employee->value]);
|
||||
$permissionStore = new PermissionStore();
|
||||
$permissionStore = new PermissionStore;
|
||||
|
||||
// Act
|
||||
$result = $permissionStore->getPermissions($organization);
|
||||
@@ -101,7 +101,7 @@ class PermissionStoreTest extends TestCase
|
||||
{
|
||||
$organization = Organization::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
$permissionStore = new PermissionStore();
|
||||
$permissionStore = new PermissionStore;
|
||||
$this->actingAs($user);
|
||||
|
||||
// Act
|
||||
@@ -117,7 +117,7 @@ class PermissionStoreTest extends TestCase
|
||||
$organization = Organization::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
$organization->users()->attach($user, ['role' => Role::Employee->value]);
|
||||
$permissionStore = new PermissionStore();
|
||||
$permissionStore = new PermissionStore;
|
||||
$this->actingAs($user);
|
||||
|
||||
// Act
|
||||
|
||||
Reference in New Issue
Block a user