mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-11 01:32:16 +01:00
Added more imports
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Unit\Service\Import\Importer;
|
||||
|
||||
use App\Models\Organization;
|
||||
use App\Service\Import\Importers\ClockifyProjectsImporter;
|
||||
|
||||
class ClockifyProjectsImporterTest extends ImporterTestAbstract
|
||||
{
|
||||
public function test_import_of_test_file_succeeds(): void
|
||||
{
|
||||
// Arrange
|
||||
$organization = Organization::factory()->create();
|
||||
$importer = new ClockifyProjectsImporter();
|
||||
$importer->init($organization);
|
||||
$data = file_get_contents(storage_path('tests/clockify_projects_import_test_1.csv'));
|
||||
|
||||
// Act
|
||||
$importer->importData($data, []);
|
||||
|
||||
// Assert
|
||||
$this->checkTestScenarioProjectsOnlyAfterImport();
|
||||
}
|
||||
|
||||
public function test_import_of_test_file_twice_succeeds(): void
|
||||
{
|
||||
// Arrange
|
||||
$organization = Organization::factory()->create();
|
||||
$importer = new ClockifyProjectsImporter();
|
||||
$importer->init($organization);
|
||||
$data = file_get_contents(storage_path('tests/clockify_projects_import_test_1.csv'));
|
||||
$importer->importData($data, []);
|
||||
$importer = new ClockifyProjectsImporter();
|
||||
$importer->init($organization);
|
||||
|
||||
// Act
|
||||
$importer->importData($data, []);
|
||||
|
||||
// Assert
|
||||
$this->checkTestScenarioProjectsOnlyAfterImport();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user