52 lines
1.2 KiB
PHP
52 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Tests\Unit;
|
|
|
|
use Tests\TestCase;
|
|
use Modules\ModulesProvider;
|
|
|
|
class TasksTest extends TestCase
|
|
{
|
|
/**
|
|
* A basic unit test example.
|
|
*/
|
|
public function test_example(): void
|
|
{
|
|
$this->assertTrue(true);
|
|
}
|
|
|
|
public function test_insert(): void
|
|
{
|
|
$mp = new ModulesProvider;
|
|
$api = $mp->getTasksModule()->getApplicationFactory()->getApi();
|
|
$data = [
|
|
'title' => 'test_task',
|
|
];
|
|
$success = $api->insert($data);
|
|
$this->assertTrue($success);
|
|
}
|
|
|
|
public function test_get_by_id(): void
|
|
{
|
|
$mp = new ModulesProvider;
|
|
$api = $mp->getTasksModule()->getApplicationFactory()->getApi();
|
|
$data = [
|
|
'id' => 'fake_id',
|
|
];
|
|
$success = $api->getById($data);
|
|
$this->assertTrue($success);
|
|
}
|
|
|
|
public function test_get_list(): void
|
|
{
|
|
$mp = new ModulesProvider;
|
|
$api = $mp->getTasksModule()->getApplicationFactory()->getApi();
|
|
$data = [
|
|
'limit' => 10,
|
|
'offset' => 0,
|
|
];
|
|
$success = $api->getList($data);
|
|
$this->assertTrue($success);
|
|
}
|
|
}
|