mirror of
https://github.com/Karaka-Management/oms-SupplierManagement.git
synced 2026-01-11 17:28:41 +00:00
64 lines
1.4 KiB
PHP
Executable File
64 lines
1.4 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* Karaka
|
|
*
|
|
* 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\SupplierManagement\tests\Models;
|
|
|
|
use Modules\SupplierManagement\Models\SupplierAttribute;
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
final class SupplierAttributeTest extends \PHPUnit\Framework\TestCase
|
|
{
|
|
private SupplierAttribute $attribute;
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
protected function setUp() : void
|
|
{
|
|
$this->attribute = new SupplierAttribute();
|
|
}
|
|
|
|
/**
|
|
* @covers Modules\SupplierManagement\Models\SupplierAttribute
|
|
* @group module
|
|
*/
|
|
public function testDefault() : void
|
|
{
|
|
self::assertEquals(0, $this->attribute->getId());
|
|
self::assertInstanceOf('\Modules\SupplierManagement\Models\SupplierAttributeType', $this->attribute->type);
|
|
self::assertInstanceOf('\Modules\SupplierManagement\Models\SupplierAttributeValue', $this->attribute->value);
|
|
}
|
|
|
|
/**
|
|
* @covers Modules\SupplierManagement\Models\SupplierAttribute
|
|
* @group module
|
|
*/
|
|
public function testSerialize() : void
|
|
{
|
|
$serialized = $this->attribute->jsonSerialize();
|
|
|
|
self::assertEquals(
|
|
[
|
|
'id',
|
|
'supplier',
|
|
'type',
|
|
'value',
|
|
],
|
|
\array_keys($serialized)
|
|
);
|
|
}
|
|
}
|