fix financials
Tests / PHPUnit (push) Failing after 1m21s

This commit is contained in:
root
2026-07-18 22:57:40 -04:00
parent 068e739408
commit a30c1398a1
61 changed files with 10908 additions and 1775 deletions
@@ -68,11 +68,28 @@ class FinancialAttachmentServiceTest extends CIUnitTestCase
$file->expects($this->once())
->method('move')
->with($this->stringContains('writable/uploads/payments'), 'proof.pdf');
->with($this->stringContains('writable/uploads/_tmp/payments'), $this->stringContains('proof.pdf'))
->willReturnCallback(static function (string $dir, string $name): bool {
file_put_contents($dir . DIRECTORY_SEPARATOR . $name, 'pdf');
return true;
});
$this->assertSame('proof.pdf', $this->service->saveUploadedFile($file, 'payments'));
}
public function testDiscardStagedFileDeletesTemporaryUpload(): void
{
$tmpDir = $this->service->ensureSubdir('_tmp/checks');
$tmpPath = $tmpDir . DIRECTORY_SEPARATOR . 'pending-test.pdf';
file_put_contents($tmpPath, 'pdf');
$this->service->discardStagedFile([
'temporary_path' => $tmpPath,
]);
$this->assertFileDoesNotExist($tmpPath);
}
public function testResolvePathUsesBasenameAndReturnsNullForMissingFiles(): void
{
$dir = $this->service->ensureSubdir('receipts');