mirror of
https://github.com/Karaka-Management/oms-ContractManagement.git
synced 2026-01-11 17:48:40 +00:00
fix tests
This commit is contained in:
parent
be8cebf359
commit
0c132806c3
|
|
@ -1,72 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package tests
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\ContractManagement\tests\Models;
|
||||
|
||||
use Modules\ContractManagement\Models\ContractType;
|
||||
use phpOMS\Localization\BaseStringL11n;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class ContractTypeTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
private ContractType $type;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() : void
|
||||
{
|
||||
$this->type = new ContractType();
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Modules\ContractManagement\Models\ContractType
|
||||
* @group module
|
||||
*/
|
||||
public function testDefault() : void
|
||||
{
|
||||
self::assertEquals(0, $this->type->id);
|
||||
self::assertEquals('', $this->type->getL11n());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Modules\ContractManagement\Models\ContractType
|
||||
* @group module
|
||||
*/
|
||||
public function testL11nInputOutput() : void
|
||||
{
|
||||
$this->type->setL11n('Test');
|
||||
self::assertEquals('Test', $this->type->getL11n());
|
||||
|
||||
$this->type->setL11n(new BaseStringL11n('NewTest'));
|
||||
self::assertEquals('NewTest', $this->type->getL11n());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Modules\ContractManagement\Models\ContractType
|
||||
* @group module
|
||||
*/
|
||||
public function testSerialize() : void
|
||||
{
|
||||
self::assertEquals(
|
||||
[
|
||||
'id' => 0,
|
||||
'l11n' => new BaseStringL11n(),
|
||||
],
|
||||
$this->type->jsonSerialize()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package tests
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\ContractManagement\tests\Models;
|
||||
|
||||
use Modules\ContractManagement\Models\NullContractType;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class NullContractTypeTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Modules\ContractManagement\Models\NullContractType
|
||||
* @group framework
|
||||
*/
|
||||
public function testNull() : void
|
||||
{
|
||||
self::assertInstanceOf('\Modules\ContractManagement\Models\ContractType', new NullContractType());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Modules\ContractManagement\Models\NullContractType
|
||||
* @group framework
|
||||
*/
|
||||
public function testId() : void
|
||||
{
|
||||
$null = new NullContractType(2);
|
||||
self::assertEquals(2, $null->id);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user