mirror of
https://github.com/Karaka-Management/oms-RiskManagement.git
synced 2026-02-08 00:08:40 +00:00
test fixes
This commit is contained in:
parent
b70de50f04
commit
8dceb7d7a0
|
|
@ -28,7 +28,6 @@ final class CategoryMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
$obj = new Category();
|
$obj = new Category();
|
||||||
$obj->title = 'Name';
|
$obj->title = 'Name';
|
||||||
$obj->descriptionRaw = 'Description';
|
|
||||||
$obj->responsible = 1;
|
$obj->responsible = 1;
|
||||||
$obj->deputy = 1;
|
$obj->deputy = 1;
|
||||||
|
|
||||||
|
|
@ -36,7 +35,6 @@ final class CategoryMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|
||||||
$objR = CategoryMapper::get()->where('id', $obj->id)->execute();
|
$objR = CategoryMapper::get()->where('id', $obj->id)->execute();
|
||||||
self::assertEquals($obj->title, $objR->title);
|
self::assertEquals($obj->title, $objR->title);
|
||||||
self::assertEquals($obj->descriptionRaw, $objR->descriptionRaw);
|
|
||||||
self::assertEquals($obj->responsible, $objR->responsible);
|
self::assertEquals($obj->responsible, $objR->responsible);
|
||||||
self::assertEquals($obj->deputy, $objR->deputy);
|
self::assertEquals($obj->deputy, $objR->deputy);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,12 +48,12 @@ final class CauseMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
CauseMapper::create()->execute($obj);
|
CauseMapper::create()->execute($obj);
|
||||||
|
|
||||||
/** @var Cause $objR */
|
/** @var Cause $objR */
|
||||||
$objR = CauseMapper::get()->with('risk')->with('category')->where('id', $obj->id)->execute();
|
$objR = CauseMapper::get()->with('risk')->where('id', $obj->id)->execute();
|
||||||
self::assertGreaterThan(0, $objR->id);
|
self::assertGreaterThan(0, $objR->id);
|
||||||
self::assertEquals($obj->title, $objR->title);
|
self::assertEquals($obj->title, $objR->title);
|
||||||
self::assertEquals($obj->descriptionRaw, $objR->descriptionRaw);
|
self::assertEquals($obj->descriptionRaw, $objR->descriptionRaw);
|
||||||
//self::assertEquals($obj->getDepartment()->department->id, $objR->getDepartment()->department->id);
|
//self::assertEquals($obj->getDepartment()->department->id, $objR->getDepartment()->department->id);
|
||||||
self::assertEquals($obj->category->title, $objR->category->title);
|
self::assertEquals($obj->category->id, $objR->category->id);
|
||||||
self::assertEquals($obj->risk->name, $objR->risk->name);
|
self::assertEquals($obj->risk->name, $objR->risk->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ final class ProcessTest extends \PHPUnit\Framework\TestCase
|
||||||
self::assertEquals('', $obj->description);
|
self::assertEquals('', $obj->description);
|
||||||
self::assertEquals('', $obj->descriptionRaw);
|
self::assertEquals('', $obj->descriptionRaw);
|
||||||
self::assertNull($obj->department);
|
self::assertNull($obj->department);
|
||||||
self::assertNull($obj->unit);
|
self::assertEquals(0, $obj->unit);
|
||||||
self::assertNull($obj->responsible);
|
self::assertNull($obj->responsible);
|
||||||
self::assertNull($obj->deputy);
|
self::assertNull($obj->deputy);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,8 +77,18 @@ final class RiskMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
$obj->files[] = $media;
|
$obj->files[] = $media;
|
||||||
|
|
||||||
RiskMapper::create()->execute($obj);
|
RiskMapper::create()->execute($obj);
|
||||||
|
self::assertGreaterThan(0, $obj->id);
|
||||||
|
|
||||||
$objR = RiskMapper::get()->with('project')->with('project/project')->with('causes')->with('solutions')->with('riskObjects')->with('files')->where('id', $obj->id)->execute();
|
$objR = RiskMapper::get()
|
||||||
|
->with('project')
|
||||||
|
->with('causes')
|
||||||
|
->with('solutions')
|
||||||
|
->with('riskObjects')
|
||||||
|
->with('files')
|
||||||
|
->where('id', $obj->id)
|
||||||
|
->execute();
|
||||||
|
|
||||||
|
self::assertGreaterThan(0, $objR->id);
|
||||||
self::assertEquals($obj->name, $objR->name);
|
self::assertEquals($obj->name, $objR->name);
|
||||||
self::assertEquals($obj->descriptionRaw, $objR->descriptionRaw);
|
self::assertEquals($obj->descriptionRaw, $objR->descriptionRaw);
|
||||||
self::assertEquals($obj->unit, $objR->unit);
|
self::assertEquals($obj->unit, $objR->unit);
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ final class SolutionMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
$obj->risk = new Risk();
|
$obj->risk = new Risk();
|
||||||
|
|
||||||
SolutionMapper::create()->execute($obj);
|
SolutionMapper::create()->execute($obj);
|
||||||
|
self::assertGreaterThan(0, $obj->id);
|
||||||
|
|
||||||
$objR = SolutionMapper::get()->where('id', $obj->id)->execute();
|
$objR = SolutionMapper::get()->where('id', $obj->id)->execute();
|
||||||
self::assertGreaterThan(0, $objR->id);
|
self::assertGreaterThan(0, $objR->id);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user