mirror of
https://github.com/Karaka-Management/oms-RiskManagement.git
synced 2026-01-11 11:28:41 +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;
|
||||
|
||||
$category = $this->data['category'] ?? new NullCategory();
|
||||
$isNew = $category->id === 0;
|
||||
$isNew = $category->id === 0;
|
||||
|
||||
echo $this->data['nav']->render();
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -12,8 +12,6 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
$projects = $this->data['projects'];
|
||||
echo $this->data['nav']->render(); ?>
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -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(); ?>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"creator": {
|
||||
"name": "Jingga",
|
||||
"website": "jingga.app"
|
||||
"website": "https://jingga.app"
|
||||
},
|
||||
"description": "Risk Management module.",
|
||||
"directory": "RiskManagement",
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user