mirror of
https://github.com/Karaka-Management/oms-RiskManagement.git
synced 2026-02-10 01:08:39 +00:00
Test fixes
This commit is contained in:
parent
810289c298
commit
cf7e83019e
|
|
@ -1,5 +0,0 @@
|
||||||
# Structure
|
|
||||||
|
|
||||||
## ER
|
|
||||||
|
|
||||||

|
|
||||||
|
|
@ -16,7 +16,7 @@ use Modules\RiskManagement\Models\NullCategory;
|
||||||
use phpOMS\Uri\UriFactory;
|
use phpOMS\Uri\UriFactory;
|
||||||
|
|
||||||
$category = $this->data['category'] ?? new NullCategory();
|
$category = $this->data['category'] ?? new NullCategory();
|
||||||
$isNew = $category->id === 0;
|
$isNew = $category->id === 0;
|
||||||
|
|
||||||
echo $this->data['nav']->render();
|
echo $this->data['nav']->render();
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ use Modules\RiskManagement\Models\NullProcess;
|
||||||
use phpOMS\Uri\UriFactory;
|
use phpOMS\Uri\UriFactory;
|
||||||
|
|
||||||
$process = $this->data['process'] ?? new NullProcess();
|
$process = $this->data['process'] ?? new NullProcess();
|
||||||
$isNew = $process->id === 0;
|
$isNew = $process->id === 0;
|
||||||
|
|
||||||
echo $this->data['nav']->render();
|
echo $this->data['nav']->render();
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,6 @@
|
||||||
*/
|
*/
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
use phpOMS\Uri\UriFactory;
|
|
||||||
|
|
||||||
$projects = $this->data['projects'];
|
$projects = $this->data['projects'];
|
||||||
echo $this->data['nav']->render(); ?>
|
echo $this->data['nav']->render(); ?>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,9 @@
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
use Modules\ProjectManagement\Models\NullProject;
|
use Modules\ProjectManagement\Models\NullProject;
|
||||||
use phpOMS\Uri\UriFactory;
|
|
||||||
|
|
||||||
$project = $this->data['project'] ?? new NullProject();
|
$project = $this->data['project'] ?? new NullProject();
|
||||||
$isNew = $project->id === 0;
|
$isNew = $project->id === 0;
|
||||||
|
|
||||||
echo $this->data['nav']->render();
|
echo $this->data['nav']->render();
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
use Modules\RiskManagement\Models\NullRisk;
|
use Modules\RiskManagement\Models\NullRisk;
|
||||||
|
|
||||||
$risk = $this->data['risk'] ?? new NullRisk();
|
$risk = $this->data['risk'] ?? new NullRisk();
|
||||||
$isNew = $risk->id === 0;
|
$isNew = $risk->id === 0;
|
||||||
|
|
||||||
echo $this->data['nav']->render(); ?>
|
echo $this->data['nav']->render(); ?>
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
},
|
},
|
||||||
"creator": {
|
"creator": {
|
||||||
"name": "Jingga",
|
"name": "Jingga",
|
||||||
"website": "jingga.app"
|
"website": "https://jingga.app"
|
||||||
},
|
},
|
||||||
"description": "Risk Management module.",
|
"description": "Risk Management module.",
|
||||||
"directory": "RiskManagement",
|
"directory": "RiskManagement",
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,9 @@ final class CategoryMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
public function testCRUD() : void
|
public function testCRUD() : void
|
||||||
{
|
{
|
||||||
$obj = new Category();
|
$obj = new Category();
|
||||||
$obj->responsible = 1;
|
$obj->responsible = 1;
|
||||||
$obj->deputy = 1;
|
$obj->deputy = 1;
|
||||||
|
|
||||||
CategoryMapper::create()->execute($obj);
|
CategoryMapper::create()->execute($obj);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ declare(strict_types=1);
|
||||||
namespace Modules\RiskManagement\tests\Models;
|
namespace Modules\RiskManagement\tests\Models;
|
||||||
|
|
||||||
use Modules\Organization\Models\NullDepartment as NullOrgDepartment;
|
use Modules\Organization\Models\NullDepartment as NullOrgDepartment;
|
||||||
use Modules\Organization\Models\NullUnit;
|
|
||||||
use Modules\RiskManagement\Models\Category;
|
use Modules\RiskManagement\Models\Category;
|
||||||
use Modules\RiskManagement\Models\Cause;
|
use Modules\RiskManagement\Models\Cause;
|
||||||
use Modules\RiskManagement\Models\CauseMapper;
|
use Modules\RiskManagement\Models\CauseMapper;
|
||||||
|
|
@ -34,7 +33,7 @@ final class CauseMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
$obj->title = 'Cause Test';
|
$obj->title = 'Cause Test';
|
||||||
$obj->descriptionRaw = 'Description';
|
$obj->descriptionRaw = 'Description';
|
||||||
$obj->probability = 1;
|
$obj->probability = 1;
|
||||||
$obj->department = new NullOrgDepartment(1);
|
$obj->department = new NullOrgDepartment(1);
|
||||||
|
|
||||||
$category = new Category();
|
$category = new Category();
|
||||||
$category->title = 'Test Cat';
|
$category->title = 'Test Cat';
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ declare(strict_types=1);
|
||||||
namespace Modules\RiskManagement\tests\Models;
|
namespace Modules\RiskManagement\tests\Models;
|
||||||
|
|
||||||
use Modules\Organization\Models\NullDepartment;
|
use Modules\Organization\Models\NullDepartment;
|
||||||
use Modules\Organization\Models\NullUnit;
|
|
||||||
use Modules\RiskManagement\Models\Process;
|
use Modules\RiskManagement\Models\Process;
|
||||||
use Modules\RiskManagement\Models\ProcessMapper;
|
use Modules\RiskManagement\Models\ProcessMapper;
|
||||||
|
|
||||||
|
|
@ -28,12 +27,12 @@ final class ProcessMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
public function testCRUD() : void
|
public function testCRUD() : void
|
||||||
{
|
{
|
||||||
$obj = new Process();
|
$obj = new Process();
|
||||||
$obj->title = 'Name';
|
$obj->title = 'Name';
|
||||||
$obj->department = new NullDepartment(1);
|
$obj->department = new NullDepartment(1);
|
||||||
$obj->responsible = 1;
|
$obj->responsible = 1;
|
||||||
$obj->deputy = 1;
|
$obj->deputy = 1;
|
||||||
$obj->unit = 1;
|
$obj->unit = 1;
|
||||||
|
|
||||||
ProcessMapper::create()->execute($obj);
|
ProcessMapper::create()->execute($obj);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,23 +40,23 @@ final class RiskMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
$obj->descriptionRaw = 'Description';
|
$obj->descriptionRaw = 'Description';
|
||||||
$obj->unit = 1;
|
$obj->unit = 1;
|
||||||
$obj->department = new NullDepartment(1);
|
$obj->department = new NullDepartment(1);
|
||||||
$obj->category = new Category();
|
$obj->category = new Category();
|
||||||
$obj->process = new Process();
|
$obj->process = new Process();
|
||||||
$obj->process->unit = 1;
|
$obj->process->unit = 1;
|
||||||
|
|
||||||
$obj->responsible = new NullAccount(1);
|
$obj->responsible = new NullAccount(1);
|
||||||
$obj->deputy = new NullAccount(1);
|
$obj->deputy = new NullAccount(1);
|
||||||
|
|
||||||
$causeObj = new Cause();
|
$causeObj = new Cause();
|
||||||
$causeObj->title = 'Risk Test Cause';
|
$causeObj->title = 'Risk Test Cause';
|
||||||
$obj->causes[] = $causeObj;
|
$obj->causes[] = $causeObj;
|
||||||
|
|
||||||
$solutionObj = new Solution();
|
$solutionObj = new Solution();
|
||||||
$solutionObj->title = 'Risk Test Solution';
|
$solutionObj->title = 'Risk Test Solution';
|
||||||
$obj->solutions[] = $solutionObj;
|
$obj->solutions[] = $solutionObj;
|
||||||
|
|
||||||
$riskObj = new RiskObject();
|
$riskObj = new RiskObject();
|
||||||
$riskObj->title = 'Risk Test Object';
|
$riskObj->title = 'Risk Test Object';
|
||||||
$obj->riskObjects[] = $riskObj;
|
$obj->riskObjects[] = $riskObj;
|
||||||
|
|
||||||
$obj->histScore[] = 2;
|
$obj->histScore[] = 2;
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\RiskManagement\tests\Models;
|
namespace Modules\RiskManagement\tests\Models;
|
||||||
|
|
||||||
use Modules\RiskManagement\Models\Cause;
|
|
||||||
use Modules\RiskManagement\Models\Risk;
|
use Modules\RiskManagement\Models\Risk;
|
||||||
use Modules\RiskManagement\Models\Solution;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\RiskManagement\tests\Models;
|
namespace Modules\RiskManagement\tests\Models;
|
||||||
|
|
||||||
use Modules\RiskManagement\Models\Cause;
|
|
||||||
use Modules\RiskManagement\Models\NullRisk;
|
use Modules\RiskManagement\Models\NullRisk;
|
||||||
use Modules\RiskManagement\Models\Risk;
|
|
||||||
use Modules\RiskManagement\Models\Solution;
|
use Modules\RiskManagement\Models\Solution;
|
||||||
use Modules\RiskManagement\Models\SolutionMapper;
|
use Modules\RiskManagement\Models\SolutionMapper;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ final class SolutionTest extends \PHPUnit\Framework\TestCase
|
||||||
self::assertEquals('', $obj->description);
|
self::assertEquals('', $obj->description);
|
||||||
self::assertEquals('', $obj->descriptionRaw);
|
self::assertEquals('', $obj->descriptionRaw);
|
||||||
self::assertEquals(0, $obj->probability);
|
self::assertEquals(0, $obj->probability);
|
||||||
self::assertEquals(null, $obj->cause);
|
self::assertNull($obj->cause);
|
||||||
self::assertEquals(0, $obj->risk->id);
|
self::assertEquals(0, $obj->risk->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user