mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-11 17:52:15 +01:00
Moved import test files; Added timezone argument to importers
This commit is contained in:
committed by
Constantin Graf
parent
7af77c9357
commit
b5a240cb2f
@@ -6,6 +6,7 @@ namespace Tests\Unit\Service\Import\Importer;
|
||||
|
||||
use App\Models\Organization;
|
||||
use App\Service\Import\Importers\ClockifyProjectsImporter;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class ClockifyProjectsImporterTest extends ImporterTestAbstract
|
||||
{
|
||||
@@ -13,12 +14,13 @@ class ClockifyProjectsImporterTest extends ImporterTestAbstract
|
||||
{
|
||||
// Arrange
|
||||
$organization = Organization::factory()->create();
|
||||
$timezone = 'Europe/Vienna';
|
||||
$importer = new ClockifyProjectsImporter();
|
||||
$importer->init($organization);
|
||||
$data = file_get_contents(storage_path('tests/clockify_projects_import_test_1.csv'));
|
||||
$data = Storage::disk('testfiles')->get('clockify_projects_import_test_1.csv');
|
||||
|
||||
// Act
|
||||
$importer->importData($data);
|
||||
$importer->importData($data, $timezone);
|
||||
|
||||
// Assert
|
||||
$this->checkTestScenarioProjectsOnlyAfterImport();
|
||||
@@ -28,15 +30,16 @@ class ClockifyProjectsImporterTest extends ImporterTestAbstract
|
||||
{
|
||||
// Arrange
|
||||
$organization = Organization::factory()->create();
|
||||
$timezone = 'Europe/Vienna';
|
||||
$importer = new ClockifyProjectsImporter();
|
||||
$importer->init($organization);
|
||||
$data = file_get_contents(storage_path('tests/clockify_projects_import_test_1.csv'));
|
||||
$importer->importData($data);
|
||||
$data = Storage::disk('testfiles')->get('clockify_projects_import_test_1.csv');
|
||||
$importer->importData($data, $timezone);
|
||||
$importer = new ClockifyProjectsImporter();
|
||||
$importer->init($organization);
|
||||
|
||||
// Act
|
||||
$importer->importData($data);
|
||||
$importer->importData($data, $timezone);
|
||||
|
||||
// Assert
|
||||
$this->checkTestScenarioProjectsOnlyAfterImport();
|
||||
|
||||
Reference in New Issue
Block a user