1
0
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:
David Bomba 2021-05-14 16:00:25 +10:00
parent 8e682f474c
commit f61ba70b14
3 changed files with 59 additions and 1 deletions

View File

@ -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();

View 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)));
}
}

File diff suppressed because one or more lines are too long