<?php

namespace Tests\Feature\Organization;

use CodeIgniter\Test\FeatureTestTrait;
use CodeIgniter\Test\CIUnitTestCase;

class HostAppControllerTest extends CIUnitTestCase
{
    use FeatureTestTrait;

    protected $endpoint = 'api/organization/hostapp';

    protected function setUp(): void
    {
        parent::setUp();
    }

    public function testIndexHostApp()
    {
        $result = $this->get($this->endpoint);
        $result->assertStatus(200);
    }

    public function testCreateHostApp()
    {
        $payload = [
            'HostAppName' => 'Test Host Application',
            'SiteID' => null
        ];

        $result = $this->withBodyFormat('json')->post($this->endpoint, $payload);
        $result->assertStatus(201);
    }
}
