mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-09 21:48: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
|
protected static function installRoutesHooks(string $destRoutePath, string $srcRoutePath) : void
|
||||||
{
|
{
|
||||||
if (!\is_file($destRoutePath)) {
|
|
||||||
\file_put_contents($destRoutePath, '<?php return [];');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!\is_file($srcRoutePath)) {
|
if (!\is_file($srcRoutePath)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!\is_file($destRoutePath)) {
|
||||||
|
\file_put_contents($destRoutePath, '<?php return [];');
|
||||||
|
}
|
||||||
|
|
||||||
if (!\is_file($destRoutePath)) {
|
if (!\is_file($destRoutePath)) {
|
||||||
throw new PathException($destRoutePath);
|
throw new PathException($destRoutePath);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -105,14 +105,14 @@ abstract class StatusAbstract
|
||||||
*/
|
*/
|
||||||
protected static function installRoutesHooks(string $destRoutePath, string $srcRoutePath) : void
|
protected static function installRoutesHooks(string $destRoutePath, string $srcRoutePath) : void
|
||||||
{
|
{
|
||||||
if (!\is_file($destRoutePath)) {
|
|
||||||
\file_put_contents($destRoutePath, '<?php return [];');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!\is_file($srcRoutePath)) {
|
if (!\is_file($srcRoutePath)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!\is_file($destRoutePath)) {
|
||||||
|
\file_put_contents($destRoutePath, '<?php return [];');
|
||||||
|
}
|
||||||
|
|
||||||
if (!\is_file($destRoutePath)) {
|
if (!\is_file($destRoutePath)) {
|
||||||
throw new PathException($destRoutePath);
|
throw new PathException($destRoutePath);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -428,8 +428,10 @@ class ModuleAbstractTest extends \PHPUnit\Framework\TestCase
|
||||||
BaseModelMapper::clearCache();
|
BaseModelMapper::clearCache();
|
||||||
|
|
||||||
$model = BaseModelMapper::get(1);
|
$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();
|
$this->dbTeardown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user