2021-05-13 05:57:18 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
|
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
|
|
|
*
|
2022-06-21 11:57:17 +02:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2021-05-13 05:57:18 +02:00
|
|
|
*/
|
2022-06-21 11:57:17 +02:00
|
|
|
|
2021-05-13 05:57:18 +02:00
|
|
|
namespace Tests\Feature\Export;
|
|
|
|
|
|
|
|
use App\Jobs\Company\CompanyExport;
|
|
|
|
use App\Utils\Traits\MakesHash;
|
|
|
|
use Illuminate\Routing\Middleware\ThrottleRequests;
|
|
|
|
use Tests\MockAccountData;
|
|
|
|
use Tests\TestCase;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
class ExportCompanyTest extends TestCase
|
|
|
|
{
|
|
|
|
use MakesHash;
|
|
|
|
use MockAccountData;
|
|
|
|
|
2022-06-24 13:15:14 +02:00
|
|
|
protected function setUp(): void
|
2021-05-13 05:57:18 +02:00
|
|
|
{
|
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
$this->withoutMiddleware(
|
|
|
|
ThrottleRequests::class
|
|
|
|
);
|
|
|
|
|
|
|
|
// $this->faker = \Faker\Factory::create();
|
|
|
|
|
|
|
|
$this->makeTestData();
|
|
|
|
|
|
|
|
$this->withoutExceptionHandling();
|
2021-05-27 01:16:41 +02:00
|
|
|
|
2022-06-24 13:15:14 +02:00
|
|
|
if (!config('ninja.testvars.stripe')) {
|
2021-05-27 01:16:41 +02:00
|
|
|
$this->markTestSkipped('Cannot write to TMP - skipping');
|
|
|
|
}
|
2021-05-13 05:57:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testCompanyExport()
|
|
|
|
{
|
2023-07-14 09:09:23 +02:00
|
|
|
$res = (new CompanyExport($this->company, $this->company->users->first(), '123'))->handle();
|
2021-05-13 12:18:30 +02:00
|
|
|
|
2021-05-14 05:32:37 +02:00
|
|
|
$this->assertTrue($res);
|
2021-05-13 05:57:18 +02:00
|
|
|
}
|
|
|
|
}
|