update wuerry
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m59s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 17s
Build, Push and Deploy / deploy-staging (push) Successful in 41s
Build, Push and Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-05-14 13:29:43 +07:00
parent 6f9bdff115
commit 1dfc06635d
7 changed files with 372 additions and 235 deletions

View File

@@ -0,0 +1,59 @@
<?php
namespace Tests\Feature;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class PostgresCompatibilityTest extends TestCase
{
/**
* Test compatibility of major reports and dashboards with PostgreSQL.
*/
public function test_reports_and_dashboards_compatibility()
{
$user = User::where('email', 'dapurhoney@honey.com')->first();
if (!$user) {
$this->markTestSkipped('Test user not found.');
}
$this->actingAs($user);
$routes = [
'business.dashboard.index',
'business.dashboard.data',
'business.dashboard.revenue',
'business.vat-reports.index',
'business.loss-profit-history.index',
'business.loss-profit-history-reports.index',
];
foreach ($routes as $routeName) {
$response = $this->get(route($routeName));
// We expect 200, but some might require parameters.
// The main goal is to catch SQLSTATE[42703] or similar Postgres errors (500).
$this->assertNotEquals(500, $response->getStatusCode(), "Route $routeName failed with status " . $response->getStatusCode());
}
}
/**
* Test dueForBranch method on Party model.
*/
public function test_party_due_for_branch_method()
{
$user = User::where('email', 'dapurhoney@honey.com')->first();
if (!$user) $this->markTestSkipped('Test user not found.');
$this->actingAs($user);
// Test the routes that were crashing
$response1 = $this->get(route('business.sales.create'));
$this->assertNotEquals(500, $response1->getStatusCode(), "Sales create crashed.");
$response2 = $this->get(route('business.purchases.create'));
$this->assertNotEquals(500, $response2->getStatusCode(), "Purchases create crashed.");
}
}