mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for tests
This commit is contained in:
parent
12efe721d1
commit
e491231090
@ -72,6 +72,9 @@ class TaskStatusRepository extends BaseRepository
|
|||||||
} elseif($ts->status_order >= $task_status->status_order) {
|
} elseif($ts->status_order >= $task_status->status_order) {
|
||||||
$ts->status_order++;
|
$ts->status_order++;
|
||||||
$ts->save();
|
$ts->save();
|
||||||
|
} else {
|
||||||
|
$ts->status_order = 99999;
|
||||||
|
$ts->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -148,7 +148,6 @@ class AutoBillInvoice extends AbstractService
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
nlog("Payment hash created => {$payment_hash->id}");
|
nlog("Payment hash created => {$payment_hash->id}");
|
||||||
$this->invoice->saveQuietly();
|
|
||||||
|
|
||||||
$payment = false;
|
$payment = false;
|
||||||
try {
|
try {
|
||||||
@ -163,7 +162,6 @@ class AutoBillInvoice extends AbstractService
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->invoice = $this->invoice->fresh();
|
|
||||||
$this->invoice->auto_bill_tries += 1;
|
$this->invoice->auto_bill_tries += 1;
|
||||||
|
|
||||||
if ($this->invoice->auto_bill_tries == 3) {
|
if ($this->invoice->auto_bill_tries == 3) {
|
||||||
|
@ -46,11 +46,15 @@ class TaskStatusApiTest extends TestCase
|
|||||||
|
|
||||||
public function testSorting()
|
public function testSorting()
|
||||||
{
|
{
|
||||||
TaskStatus::factory()->count(5)->create([
|
TaskStatus::query()->where('company_id', $this->company->id)->cursor()->each(function ($ts){
|
||||||
'company_id' => $this->company->id,
|
$ts->forceDelete();
|
||||||
'user_id' => $this->user->id
|
});
|
||||||
]);
|
|
||||||
|
|
||||||
|
TaskStatus::factory()->count(10)->create([
|
||||||
|
'company_id' => $this->company->id,
|
||||||
|
'user_id' => $this->user->id,
|
||||||
|
'status_order' => 99999,
|
||||||
|
]);
|
||||||
|
|
||||||
$t = TaskStatus::where('company_id', '=', $this->company->id)->orderBy('id', 'desc');
|
$t = TaskStatus::where('company_id', '=', $this->company->id)->orderBy('id', 'desc');
|
||||||
|
|
||||||
@ -59,7 +63,6 @@ class TaskStatusApiTest extends TestCase
|
|||||||
|
|
||||||
$id = $task_status->id;
|
$id = $task_status->id;
|
||||||
|
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'status_order' => 1,
|
'status_order' => 1,
|
||||||
];
|
];
|
||||||
@ -69,7 +72,10 @@ class TaskStatusApiTest extends TestCase
|
|||||||
'X-API-TOKEN' => $this->token,
|
'X-API-TOKEN' => $this->token,
|
||||||
])->put('/api/v1/task_statuses/'.$task_status->hashed_id, $data);
|
])->put('/api/v1/task_statuses/'.$task_status->hashed_id, $data);
|
||||||
|
|
||||||
$t = TaskStatus::where('company_id', '=', $this->company->id)->orderBy('status_order', 'asc')->first();
|
|
||||||
|
$xx = TaskStatus::where('company_id', $this->company->id)->pluck('status_order');
|
||||||
|
|
||||||
|
$t = TaskStatus::where('company_id', $this->company->id)->orderBy('status_order', 'asc')->first();
|
||||||
|
|
||||||
$this->assertEquals($id, $t->id);
|
$this->assertEquals($id, $t->id);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user