Test fixes
Some checks failed
Image optimization / general_image_workflow (push) Has been cancelled
CI / general_module_workflow_php (push) Has been cancelled
CI / general_module_workflow_js (push) Has been cancelled

This commit is contained in:
Dennis Eichhorn 2024-05-16 02:14:55 +00:00
parent 810289c298
commit cf7e83019e
14 changed files with 23 additions and 37 deletions

View File

@ -1,5 +0,0 @@
# Structure
## ER
![ER](Modules/RiskManagement/Docs/Dev/img/er.png)

View File

@ -16,7 +16,7 @@ use Modules\RiskManagement\Models\NullCategory;
use phpOMS\Uri\UriFactory;
$category = $this->data['category'] ?? new NullCategory();
$isNew = $category->id === 0;
$isNew = $category->id === 0;
echo $this->data['nav']->render();
?>

View File

@ -16,7 +16,7 @@ use Modules\RiskManagement\Models\NullProcess;
use phpOMS\Uri\UriFactory;
$process = $this->data['process'] ?? new NullProcess();
$isNew = $process->id === 0;
$isNew = $process->id === 0;
echo $this->data['nav']->render();
?>

View File

@ -12,8 +12,6 @@
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
$projects = $this->data['projects'];
echo $this->data['nav']->render(); ?>

View File

@ -13,10 +13,9 @@
declare(strict_types=1);
use Modules\ProjectManagement\Models\NullProject;
use phpOMS\Uri\UriFactory;
$project = $this->data['project'] ?? new NullProject();
$isNew = $project->id === 0;
$isNew = $project->id === 0;
echo $this->data['nav']->render();
?>

View File

@ -14,7 +14,7 @@ declare(strict_types=1);
use Modules\RiskManagement\Models\NullRisk;
$risk = $this->data['risk'] ?? new NullRisk();
$risk = $this->data['risk'] ?? new NullRisk();
$isNew = $risk->id === 0;
echo $this->data['nav']->render(); ?>

View File

@ -12,7 +12,7 @@
},
"creator": {
"name": "Jingga",
"website": "jingga.app"
"website": "https://jingga.app"
},
"description": "Risk Management module.",
"directory": "RiskManagement",

View File

@ -26,9 +26,9 @@ final class CategoryMapperTest extends \PHPUnit\Framework\TestCase
#[\PHPUnit\Framework\Attributes\Group('module')]
public function testCRUD() : void
{
$obj = new Category();
$obj->responsible = 1;
$obj->deputy = 1;
$obj = new Category();
$obj->responsible = 1;
$obj->deputy = 1;
CategoryMapper::create()->execute($obj);

View File

@ -15,7 +15,6 @@ declare(strict_types=1);
namespace Modules\RiskManagement\tests\Models;
use Modules\Organization\Models\NullDepartment as NullOrgDepartment;
use Modules\Organization\Models\NullUnit;
use Modules\RiskManagement\Models\Category;
use Modules\RiskManagement\Models\Cause;
use Modules\RiskManagement\Models\CauseMapper;
@ -34,7 +33,7 @@ final class CauseMapperTest extends \PHPUnit\Framework\TestCase
$obj->title = 'Cause Test';
$obj->descriptionRaw = 'Description';
$obj->probability = 1;
$obj->department = new NullOrgDepartment(1);
$obj->department = new NullOrgDepartment(1);
$category = new Category();
$category->title = 'Test Cat';

View File

@ -15,7 +15,6 @@ declare(strict_types=1);
namespace Modules\RiskManagement\tests\Models;
use Modules\Organization\Models\NullDepartment;
use Modules\Organization\Models\NullUnit;
use Modules\RiskManagement\Models\Process;
use Modules\RiskManagement\Models\ProcessMapper;
@ -28,12 +27,12 @@ final class ProcessMapperTest extends \PHPUnit\Framework\TestCase
#[\PHPUnit\Framework\Attributes\Group('module')]
public function testCRUD() : void
{
$obj = new Process();
$obj->title = 'Name';
$obj->department = new NullDepartment(1);
$obj->responsible = 1;
$obj->deputy = 1;
$obj->unit = 1;
$obj = new Process();
$obj->title = 'Name';
$obj->department = new NullDepartment(1);
$obj->responsible = 1;
$obj->deputy = 1;
$obj->unit = 1;
ProcessMapper::create()->execute($obj);

View File

@ -40,23 +40,23 @@ final class RiskMapperTest extends \PHPUnit\Framework\TestCase
$obj->descriptionRaw = 'Description';
$obj->unit = 1;
$obj->department = new NullDepartment(1);
$obj->category = new Category();
$obj->process = new Process();
$obj->process->unit = 1;
$obj->category = new Category();
$obj->process = new Process();
$obj->process->unit = 1;
$obj->responsible = new NullAccount(1);
$obj->deputy = new NullAccount(1);
$causeObj = new Cause();
$causeObj->title = 'Risk Test Cause';
$obj->causes[] = $causeObj;
$obj->causes[] = $causeObj;
$solutionObj = new Solution();
$solutionObj->title = 'Risk Test Solution';
$obj->solutions[] = $solutionObj;
$obj->solutions[] = $solutionObj;
$riskObj = new RiskObject();
$riskObj->title = 'Risk Test Object';
$riskObj = new RiskObject();
$riskObj->title = 'Risk Test Object';
$obj->riskObjects[] = $riskObj;
$obj->histScore[] = 2;

View File

@ -14,9 +14,7 @@ declare(strict_types=1);
namespace Modules\RiskManagement\tests\Models;
use Modules\RiskManagement\Models\Cause;
use Modules\RiskManagement\Models\Risk;
use Modules\RiskManagement\Models\Solution;
/**
* @internal

View File

@ -14,9 +14,7 @@ declare(strict_types=1);
namespace Modules\RiskManagement\tests\Models;
use Modules\RiskManagement\Models\Cause;
use Modules\RiskManagement\Models\NullRisk;
use Modules\RiskManagement\Models\Risk;
use Modules\RiskManagement\Models\Solution;
use Modules\RiskManagement\Models\SolutionMapper;

View File

@ -32,7 +32,7 @@ final class SolutionTest extends \PHPUnit\Framework\TestCase
self::assertEquals('', $obj->description);
self::assertEquals('', $obj->descriptionRaw);
self::assertEquals(0, $obj->probability);
self::assertEquals(null, $obj->cause);
self::assertNull($obj->cause);
self::assertEquals(0, $obj->risk->id);
}
}