oms-Knowledgebase/tests/Models/WikiAppMapperTest.php
Dennis Eichhorn bd21c80155
Some checks failed
Image optimization / general_image_workflow (push) Has been cancelled
CI / general_module_workflow_php (push) Has been cancelled
CI / general_module_workflow_js (push) Has been cancelled
fix version and bugs
2024-05-21 00:09:12 +02:00

43 lines
1.2 KiB
PHP
Executable File

<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package tests
* @copyright Dennis Eichhorn
* @license OMS License 2.2
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\Knowledgebase\tests\Models;
use Modules\Knowledgebase\Models\WikiApp;
use Modules\Knowledgebase\Models\WikiAppMapper;
/**
* @internal
*/
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Knowledgebase\Models\WikiAppMapper::class)]
#[\PHPUnit\Framework\Attributes\TestDox('Modules\tests\Knowledgebase\Models\WikiAppMapperTest: Wiki application mapper')]
final class WikiAppMapperTest extends \PHPUnit\Framework\TestCase
{
#[\PHPUnit\Framework\Attributes\Group('module')]
#[\PHPUnit\Framework\Attributes\TestDox('The model can be created and read from the database')]
public function testCR() : void
{
$app = new WikiApp();
$app->name = 'Test Category';
$id = WikiAppMapper::create()->execute($app);
self::assertGreaterThan(0, $app->id);
self::assertEquals($id, $app->id);
$appR = WikiAppMapper::get()->where('id', $app->id)->execute();
self::assertEquals($app->name, $appR->name);
}
}