Fixes for 2 code quality findings in Invoice tests (#3359)

* Apply suggested fix to tests-legacy/modules/Invoice/ServiceTest.php from Copilot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* Apply suggested fix to tests-legacy/modules/Invoice/ServiceTest.php from Copilot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
This commit is contained in:
Adam DaleyandCopilot Autofix powered by AI authored and GitHub committed 2026-03-23 12:15:34 +00:00
1 parent b47ef9d237
commit 786a00f9f1
1 file changed
+6 -2
+6 -2
View File
@@ -157,6 +157,9 @@ final class ServiceTest extends \BBTestCase
$subscriptionServiceMock->expects($this->atLeastOnce())
->method('isSubscribable')
->willReturn(true);
$invoiceItemServiceMock = $this->createMock(\Box\Mod\Invoice\ServiceInvoiceItem::class);
$modelToArrayResult = [
'id' => 1,
'serie' => 'BB',
@@ -213,9 +216,10 @@ final class ServiceTest extends \BBTestCase
$di = $this->getDi();
$di['db'] = $dbMock;
$di['mod_service'] = $di->protect(function ($serviceName, $sub = '') use ($systemService, $subscriptionServiceMock) {
$di['mod_service'] = $di->protect(function ($serviceName, $sub = '') use ($systemService, $subscriptionServiceMock, $invoiceItemServiceMock) {
$service = null;
if ($sub == 'InvoiceItem') {
$service = $invoiceItemServiceMock;
}
if ($serviceName == 'system') {
$service = $systemService;
@@ -537,7 +541,7 @@ final class ServiceTest extends \BBTestCase
'id' => 1,
],
],
'approve',
'approve' => true,
];
$clientModel = new \Model_Client();