mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
unit test fixes
This commit is contained in:
parent
0d83f2a22b
commit
9d6e431c3b
|
|
@ -95,14 +95,14 @@ abstract class StatusAbstract
|
|||
*/
|
||||
protected static function installRoutesHooks(string $destRoutePath, string $srcRoutePath) : void
|
||||
{
|
||||
if (!\is_file($destRoutePath)) {
|
||||
\file_put_contents($destRoutePath, '<?php return [];');
|
||||
}
|
||||
|
||||
if (!\is_file($srcRoutePath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!\is_file($destRoutePath)) {
|
||||
\file_put_contents($destRoutePath, '<?php return [];');
|
||||
}
|
||||
|
||||
if (!\is_file($destRoutePath)) {
|
||||
throw new PathException($destRoutePath);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,14 +105,14 @@ abstract class StatusAbstract
|
|||
*/
|
||||
protected static function installRoutesHooks(string $destRoutePath, string $srcRoutePath) : void
|
||||
{
|
||||
if (!\is_file($destRoutePath)) {
|
||||
\file_put_contents($destRoutePath, '<?php return [];');
|
||||
}
|
||||
|
||||
if (!\is_file($srcRoutePath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!\is_file($destRoutePath)) {
|
||||
\file_put_contents($destRoutePath, '<?php return [];');
|
||||
}
|
||||
|
||||
if (!\is_file($destRoutePath)) {
|
||||
throw new PathException($destRoutePath);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -428,8 +428,10 @@ class ModuleAbstractTest extends \PHPUnit\Framework\TestCase
|
|||
BaseModelMapper::clearCache();
|
||||
|
||||
$model = BaseModelMapper::get(1);
|
||||
self::assertCount(0, $model->hasManyRelations);
|
||||
|
||||
// count = 2 because the moduel automatically initializes 2 hasMany relationships in the __construct()
|
||||
// This actually means that the delete was successful, otherwise the hasManyRelations would have been overwritten with 1 relation (see above before the delete)
|
||||
self::assertCount(2, $model->hasManyRelations);
|
||||
$this->dbTeardown();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user