fix @covers

This commit is contained in:
Dennis Eichhorn 2020-10-09 00:20:24 +02:00
parent e25201b2fc
commit 6f30040016
3 changed files with 109 additions and 0 deletions

View File

@ -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;
}
}

View 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));
}
}

View 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());
}
}