mirror of
https://github.com/Karaka-Management/oms-Auditor.git
synced 2026-02-10 11:08:41 +00:00
fix @covers
This commit is contained in:
parent
e25201b2fc
commit
6f30040016
|
|
@ -16,6 +16,7 @@ namespace Modules\Auditor\Models;
|
|||
|
||||
use Modules\Admin\Models\AccountMapper;
|
||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||
use phpOMS\DataStorage\Database\RelationType;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
|
|
@ -91,4 +92,28 @@ final class AuditMapper extends DataMapperAbstract
|
|||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $createdAt = 'auditor_audit_created_at';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function delete($obj, int $relations = RelationType::REFERENCE)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function update($obj, int $relations = RelationType::ALL, int $depth = 3)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function updateArray(array &$obj, int $relations = RelationType::ALL, int $depth = 1)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
52
tests/Models/AuditMapperTest.php
Normal file
52
tests/Models/AuditMapperTest.php
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.4
|
||||
*
|
||||
* @package tests
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https://orange-management.org
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Auditor\tests\Models;
|
||||
|
||||
use Modules\Auditor\Models\Audit;
|
||||
use Modules\Auditor\Models\AuditMapper;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
class AuditMapperTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Modules\Auditor\Models\AuditMapper
|
||||
* @group module
|
||||
*/
|
||||
public function testInvalidDelete() : void
|
||||
{
|
||||
self::assertEquals(-1, AuditMapper::delete(null));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Modules\Auditor\Models\AuditMapper
|
||||
* @group module
|
||||
*/
|
||||
public function testInvalidUpdate() : void
|
||||
{
|
||||
self::assertEquals(-1, AuditMapper::update(null));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Modules\Auditor\Models\AuditMapper
|
||||
* @group module
|
||||
*/
|
||||
public function testInvalidUpdateArray() : void
|
||||
{
|
||||
$arr = [];
|
||||
self::assertEquals(-1, AuditMapper::updateArray($arr));
|
||||
}
|
||||
}
|
||||
32
tests/Models/NullAuditTest.php
Normal file
32
tests/Models/NullAuditTest.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.4
|
||||
*
|
||||
* @package tests
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https://orange-management.org
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Auditor\tests\Models;
|
||||
|
||||
use Modules\Auditor\Models\NullAudit;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class NullAuditTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Modules\Auditor\Models\NullAudit
|
||||
* @group module
|
||||
*/
|
||||
public function testNull() : void
|
||||
{
|
||||
self::assertInstanceOf('\Modules\Auditor\Models\Audit', new NullAudit());
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user