diff --git a/app/DataMapper/CompanySettings.php b/app/DataMapper/CompanySettings.php index ac98239df6..36e9aeb865 100644 --- a/app/DataMapper/CompanySettings.php +++ b/app/DataMapper/CompanySettings.php @@ -12,8 +12,9 @@ namespace App\DataMapper; -use App\Utils\Traits\MakesHash; use stdClass; +use App\Utils\Ninja; +use App\Utils\Traits\MakesHash; /** * CompanySettings. diff --git a/tests/Unit/InvitationTest.php b/tests/Unit/InvitationTest.php index 4c9a7fe038..7aa231c363 100644 --- a/tests/Unit/InvitationTest.php +++ b/tests/Unit/InvitationTest.php @@ -22,7 +22,7 @@ use Tests\TestCase; class InvitationTest extends TestCase { use MockAccountData; - use DatabaseTransactions; + // use DatabaseTransactions; use MakesHash; protected function setUp(): void @@ -57,10 +57,13 @@ class InvitationTest extends TestCase $response = null; + $data = $this->invoice->toArray(); + unset($data['hashed_id']); + $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), 'X-API-TOKEN' => $this->token, - ])->putJson('/api/v1/invoices/'.$this->encodePrimaryKey($this->invoice->id), $this->invoice->toArray()); + ])->putJson('/api/v1/invoices/'.$this->invoice->hashed_id, $this->invoice->toArray()); $response->assertStatus(200); diff --git a/tests/Unit/InvoiceMarkPaidTest.php b/tests/Unit/InvoiceMarkPaidTest.php index f7d64b4067..2bcc329a47 100644 --- a/tests/Unit/InvoiceMarkPaidTest.php +++ b/tests/Unit/InvoiceMarkPaidTest.php @@ -26,7 +26,7 @@ use Tests\TestCase; class InvoiceMarkPaidTest extends TestCase { use MockAccountData; - use DatabaseTransactions; + // use DatabaseTransactions; public $invoice; @@ -82,7 +82,6 @@ class InvoiceMarkPaidTest extends TestCase $response->assertStatus(200); - $this->assertEquals(0, $response->json('data.balance')); $this->assertEquals(10, $response->json('data.paid_to_date')); $this->assertEquals(4, $response->json('data.status_id')); @@ -94,6 +93,8 @@ class InvoiceMarkPaidTest extends TestCase $this->assertEquals(4, $i->status_id); + $c->forceDelete(); + } @@ -158,6 +159,7 @@ class InvoiceMarkPaidTest extends TestCase $this->assertEquals(4, $i->status_id); + $c->forceDelete(); } }