mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 01:54:35 -04:00
49 lines
1.1 KiB
PHP
49 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Tests\Integration;
|
|
|
|
use App\Events\Invoice\InvoiceWasCreated;
|
|
use App\Events\Invoice\InvoiceWasUpdated;
|
|
use App\Jobs\Invoice\MarkPaid;
|
|
use App\Models\Account;
|
|
use App\Models\Activity;
|
|
use App\Models\Company;
|
|
use App\Models\Invoice;
|
|
use App\Models\Payment;
|
|
use App\Models\User;
|
|
use Illuminate\Foundation\Testing\Concerns\InteractsWithDatabase;
|
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
use Tests\MockAccountData;
|
|
use Tests\TestCase;
|
|
|
|
/**
|
|
* @test
|
|
* @covers App\Jobs\Company\UpdateCompanyLedgerWithInvoice
|
|
*/
|
|
class UpdateCompanyLedgerInvoiceTest extends TestCase
|
|
{
|
|
use MockAccountData;
|
|
use DatabaseTransactions;
|
|
|
|
public function setUp() :void
|
|
{
|
|
parent::setUp();
|
|
|
|
$this->makeTestData();
|
|
}
|
|
|
|
public function testUpdatedInvoiceEventFires()
|
|
{
|
|
|
|
$this->invoice->status_id = Invoice::STATUS_PAID;
|
|
$this->invoice->save();
|
|
|
|
// $this->expectsEvents(InvoiceWasUpdated::class);
|
|
$activities = Activity::whereInvoiceId($this->invoice->id)->get();
|
|
|
|
$this->assertEquals(count($activities), 1);
|
|
|
|
}
|
|
|
|
|
|
} |