clqms-be/tests/feature/Organization/HostAppControllerTest.php

32 lines
717 B
PHP

<?php
namespace Tests\Feature\Organization;
use CodeIgniter\Test\FeatureTestTrait;
use CodeIgniter\Test\CIUnitTestCase;
class HostAppControllerTest extends CIUnitTestCase
{
use FeatureTestTrait;
protected $endpoint = 'api/organization/hostapp';
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);
}
}