test(IT): Rework output handler exceptions

Signed-off-by: Rubén D <nuxsmin@syspass.org>
This commit is contained in:
Rubén D
2024-08-04 19:34:43 +02:00
parent 95c98ae2fa
commit c8471a6737
8 changed files with 25 additions and 11 deletions

View File

@@ -130,5 +130,4 @@ final class Bootstrap extends BootstrapBase
return $response;
};
}
}

View File

@@ -94,6 +94,8 @@ abstract class BootstrapBase implements BootstrapInterface
if (defined('TEST_ROOT')) {
$router->response()->body(__($err_msg) . PHP_EOL . $err->getTraceAsString());
throw $err;
} else {
$router->response()->body(__($err_msg));
}

View File

@@ -62,8 +62,10 @@ class IndexControllerTest extends IntegrationTestCase
'//div[contains(@id, \'tabs-\')]//form'
)->extract(['id']);
$this->assertNotEmpty($output);
$this->assertCount(5, $filter);
assert(!empty($output));
assert(count($filter) === 5);
$this->assertTrue(true);
});
$container = $this->buildContainer(

View File

@@ -62,8 +62,10 @@ class CopyControllerTest extends IntegrationTestCase
'//div[@class="data-container"]//form[@name="frmaccount"]|//div[@class="item-actions"]//button'
)->extract(['id']);
$this->assertNotEmpty($output);
$this->assertCount(3, $filter);
assert(!empty($output));
assert(count($filter) === 3);
$this->assertTrue(true);
});
$container = $this->buildContainer(

View File

@@ -61,8 +61,10 @@ class CreateControllerTest extends IntegrationTestCase
'//div[@class="data-container"]//form[@name="frmaccount" and @data-action-route="account/saveCreate"]|//div[@class="item-actions"]//button'
)->extract(['id']);
$this->assertNotEmpty($output);
$this->assertCount(3, $filter);
assert(!empty($output));
assert(count($filter) === 3);
$this->assertTrue(true);
}
);

View File

@@ -65,8 +65,10 @@ class DeleteControllerTest extends IntegrationTestCase
'//div[@class="data-container"]//form[@name="frmaccount" and @data-action-route="account/saveDelete"]|//div[@class="item-actions"]//button'
)->extract(['id']);
$this->assertNotEmpty($output);
$this->assertCount(2, $filter);
assert(!empty($output));
assert(count($filter) === 2);
$this->assertTrue(true);
}
);

View File

@@ -64,8 +64,10 @@ class EditControllerTest extends IntegrationTestCase
'//div[@class="data-container"]//form[@name="frmaccount" and @data-action-route="account/saveEdit"]|//div[@class="item-actions"]//button'
)->extract(['id']);
$this->assertNotEmpty($output);
$this->assertCount(3, $filter);
assert(!empty($output));
assert(count($filter) === 3);
$this->assertTrue(true);
}
);

View File

@@ -67,4 +67,7 @@
<file>../lib/SP/Domain/Config/Adapters/ConfigData.php</file>
</exclude>
</source>
<php>
<ini name="zend.assertions" value="1"/>
</php>
</phpunit>