mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Tests for company import
This commit is contained in:
parent
8e682f474c
commit
f61ba70b14
@ -149,7 +149,8 @@ class CompanyExport implements ShouldQueue
|
||||
$this->export_data['company_gateways'] = $this->company->company_gateways->map(function ($company_gateway){
|
||||
|
||||
$company_gateway = $this->transformArrayOfKeys($company_gateway, ['company_id', 'user_id']);
|
||||
|
||||
$company_gateway->config = decrypt($company_gateway->config);
|
||||
|
||||
return $company_gateway;
|
||||
|
||||
})->toArray();
|
||||
|
56
tests/Feature/Import/ImportCompanyTest.php
Normal file
56
tests/Feature/Import/ImportCompanyTest.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
namespace Tests\Feature\Import;
|
||||
|
||||
use App\Jobs\Import\CSVImport;
|
||||
use App\Models\Client;
|
||||
use App\Models\Expense;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use App\Models\Product;
|
||||
use App\Models\Vendor;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Illuminate\Routing\Middleware\ThrottleRequests;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Str;
|
||||
use League\Csv\Reader;
|
||||
use League\Csv\Statement;
|
||||
use Tests\MockAccountData;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
*/
|
||||
class ImportCompanyTest extends TestCase
|
||||
{
|
||||
use MakesHash;
|
||||
|
||||
public function setUp() :void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->withoutMiddleware(
|
||||
ThrottleRequests::class
|
||||
);
|
||||
|
||||
|
||||
$this->withoutExceptionHandling();
|
||||
}
|
||||
|
||||
public function testBackupJsonRead()
|
||||
{
|
||||
$backup_json_file = base_path().'/tests/Feature/Import/backup.json';
|
||||
|
||||
$this->assertTrue(is_array(json_decode(file_get_contents($backup_json_file),1)));
|
||||
}
|
||||
|
||||
}
|
1
tests/Feature/Import/backup.json
Normal file
1
tests/Feature/Import/backup.json
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user