Minor fixes for tests

This commit is contained in:
David Bomba 2025-08-15 19:00:03 +10:00
parent d9bafd41b9
commit 2aef51aeb4
2 changed files with 18 additions and 12 deletions

View File

@ -224,9 +224,9 @@ class TemplateTest extends TestCase
try { try {
$twig->parse($twig->tokenize(new \Twig\Source($this->payments_body, ''))); $twig->parse($twig->tokenize(new \Twig\Source($this->payments_body, '')));
$this->assertTrue(true); $this->assertTrue(true);
echo json_encode(['status' => 'ok']); // echo json_encode(['status' => 'ok']);
} catch (\Twig\Error\SyntaxError $e) { } catch (\Twig\Error\SyntaxError $e) {
echo json_encode(['status' => 'error', 'message' => $e->getMessage()]); // echo json_encode(['status' => 'error', 'message' => $e->getMessage()]);
} }
} }
@ -239,10 +239,10 @@ class TemplateTest extends TestCase
try { try {
$twig->parse($twig->tokenize(new \Twig\Source($this->broken_twig_template, ''))); $twig->parse($twig->tokenize(new \Twig\Source($this->broken_twig_template, '')));
echo json_encode(['status' => 'ok']); // echo json_encode(['status' => 'ok']);
} catch (\Twig\Error\SyntaxError $e) { } catch (\Twig\Error\SyntaxError $e) {
$this->assertTrue(true); $this->assertTrue(true);
echo json_encode(['status' => 'error', 'message' => $e->getMessage()]); // echo json_encode(['status' => 'error', 'message' => $e->getMessage()]);
} }
} }
@ -310,7 +310,7 @@ class TemplateTest extends TestCase
$this->assertNotNull($ts); $this->assertNotNull($ts);
$this->assertIsArray($ts->getData()); $this->assertIsArray($ts->getData());
nlog($ts->getData()); // nlog($ts->getData());
} }

View File

@ -12,15 +12,17 @@
namespace Tests\Feature\Vendor; namespace Tests\Feature\Vendor;
use App\Models\Account;
use App\Models\Vendor;
use App\Models\VendorContact;
use App\Models\Company;
use App\Models\User;
use App\Utils\Traits\AppSetup;
use Faker\Factory; use Faker\Factory;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\TestCase; use Tests\TestCase;
use App\Models\User;
use App\Models\Vendor;
use App\Models\Account;
use App\Models\Company;
use App\Models\Country;
use App\Models\VendorContact;
use App\Utils\Traits\AppSetup;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class VendorMergeTest extends TestCase class VendorMergeTest extends TestCase
{ {
@ -44,6 +46,10 @@ class VendorMergeTest extends TestCase
parent::setUp(); parent::setUp();
$this->faker = Factory::create(); $this->faker = Factory::create();
if(Country::count() == 0){
Artisan::call('migrate:fresh', ['--seed' => true]);
}
} }
public function testSearchingForContacts() public function testSearchingForContacts()