mirror of
https://github.com/Karaka-Management/oms-RiskManagement.git
synced 2026-02-04 22:38:40 +00:00
fix tests
This commit is contained in:
parent
8dceb7d7a0
commit
e578c0c84d
|
|
@ -9,21 +9,6 @@
|
||||||
"primary": true,
|
"primary": true,
|
||||||
"autoincrement": true
|
"autoincrement": true
|
||||||
},
|
},
|
||||||
"riskmngmt_category_name": {
|
|
||||||
"name": "riskmngmt_category_name",
|
|
||||||
"type": "VARCHAR(255)",
|
|
||||||
"null": false
|
|
||||||
},
|
|
||||||
"riskmngmt_category_description": {
|
|
||||||
"name": "riskmngmt_category_description",
|
|
||||||
"type": "TEXT",
|
|
||||||
"null": false
|
|
||||||
},
|
|
||||||
"riskmngmt_category_descriptionraw": {
|
|
||||||
"name": "riskmngmt_category_descriptionraw",
|
|
||||||
"type": "TEXT",
|
|
||||||
"null": false
|
|
||||||
},
|
|
||||||
"riskmngmt_category_parent": {
|
"riskmngmt_category_parent": {
|
||||||
"name": "riskmngmt_category_parent",
|
"name": "riskmngmt_category_parent",
|
||||||
"type": "INT",
|
"type": "INT",
|
||||||
|
|
@ -559,12 +544,6 @@
|
||||||
"type": "INT",
|
"type": "INT",
|
||||||
"null": false
|
"null": false
|
||||||
},
|
},
|
||||||
"riskmngmt_solution_effect": {
|
|
||||||
"name": "riskmngmt_solution_effect",
|
|
||||||
"type": "INT",
|
|
||||||
"default": null,
|
|
||||||
"null": true
|
|
||||||
},
|
|
||||||
"riskmngmt_solution_cause": {
|
"riskmngmt_solution_cause": {
|
||||||
"name": "riskmngmt_solution_cause",
|
"name": "riskmngmt_solution_cause",
|
||||||
"type": "INT",
|
"type": "INT",
|
||||||
|
|
|
||||||
|
|
@ -54,5 +54,10 @@ class Solution
|
||||||
|
|
||||||
public ?Cause $cause = null;
|
public ?Cause $cause = null;
|
||||||
|
|
||||||
public ?Risk $risk = null;
|
public Risk $risk;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->risk = new Risk();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,14 +41,8 @@ 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();
|
||||||
$categoryObj = new Category();
|
$obj->process = new Process();
|
||||||
$obj->category = $categoryObj;
|
|
||||||
|
|
||||||
$processObj = new Process();
|
|
||||||
$obj->process = $processObj;
|
|
||||||
|
|
||||||
$obj->project = new NullProject(1);
|
|
||||||
|
|
||||||
$obj->responsible = new NullAccount(1);
|
$obj->responsible = new NullAccount(1);
|
||||||
$obj->deputy = new NullAccount(1);
|
$obj->deputy = new NullAccount(1);
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ declare(strict_types=1);
|
||||||
namespace Modules\RiskManagement\tests\Models;
|
namespace Modules\RiskManagement\tests\Models;
|
||||||
|
|
||||||
use Modules\RiskManagement\Models\Cause;
|
use Modules\RiskManagement\Models\Cause;
|
||||||
|
use Modules\RiskManagement\Models\NullRisk;
|
||||||
use Modules\RiskManagement\Models\Risk;
|
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;
|
||||||
|
|
@ -33,8 +34,7 @@ final class SolutionMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
$obj->title = 'Title';
|
$obj->title = 'Title';
|
||||||
$obj->descriptionRaw = 'Description';
|
$obj->descriptionRaw = 'Description';
|
||||||
$obj->probability = 1;
|
$obj->probability = 1;
|
||||||
$obj->cause = new Cause();
|
$obj->risk = new NullRisk(1);
|
||||||
$obj->risk = new Risk();
|
|
||||||
|
|
||||||
SolutionMapper::create()->execute($obj);
|
SolutionMapper::create()->execute($obj);
|
||||||
self::assertGreaterThan(0, $obj->id);
|
self::assertGreaterThan(0, $obj->id);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user