2026-02-27 16:31:55 +07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Tests\Feature\Organization;
|
|
|
|
|
|
|
|
|
|
use CodeIgniter\Test\FeatureTestTrait;
|
|
|
|
|
use CodeIgniter\Test\CIUnitTestCase;
|
|
|
|
|
|
|
|
|
|
class HostAppControllerTest extends CIUnitTestCase
|
|
|
|
|
{
|
|
|
|
|
use FeatureTestTrait;
|
|
|
|
|
|
|
|
|
|
protected $endpoint = 'api/organization/hostapp';
|
|
|
|
|
|
2026-03-16 15:58:56 +07:00
|
|
|
protected function setUp(): void
|
|
|
|
|
{
|
|
|
|
|
parent::setUp();
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-27 16:31:55 +07:00
|
|
|
public function testIndexHostApp()
|
|
|
|
|
{
|
|
|
|
|
$result = $this->get($this->endpoint);
|
|
|
|
|
$result->assertStatus(200);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testCreateHostApp()
|
|
|
|
|
{
|
|
|
|
|
$payload = [
|
|
|
|
|
'HostAppID' => 'TEST1',
|
|
|
|
|
'HostAppName' => 'Test Host Application',
|
|
|
|
|
'SiteID' => null
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
$result = $this->withBodyFormat('json')->post($this->endpoint, $payload);
|
|
|
|
|
$result->assertStatus(201);
|
|
|
|
|
}
|
|
|
|
|
}
|