fix family card issue
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\App\Views;
|
||||
|
||||
use CodeIgniter\Test\CIUnitTestCase;
|
||||
|
||||
final class FamilyCardLoaderLoopTest extends CIUnitTestCase
|
||||
{
|
||||
public function testFamilyLayoutsDoNotRedirectFamilyPageToItselfAfterCardFailure(): void
|
||||
{
|
||||
foreach (['management_layout.php', 'main_layout.php'] as $layout) {
|
||||
$source = file_get_contents(APPPATH . 'Views/layout/' . $layout) ?: '';
|
||||
|
||||
$this->assertStringContainsString("const familyIndexPath = familyPath + '/index';", $source, $layout);
|
||||
$this->assertStringContainsString(
|
||||
'currentPath !== familyPath && currentPath !== familyIndexPath',
|
||||
$source,
|
||||
$layout
|
||||
);
|
||||
$this->assertStringContainsString('The family card could not be loaded.', $source, $layout);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user