- handle contact PATCH failures by checking model save result and returning HTTP 400 with the model error message - update ContactDetailModel nested updates to enforce active-detail checks and use model update() with explicit failure propagation - extend contact patch assertions and align test-create variants expectations to status=success for POST responses - refresh composer lock metadata/dependency constraints and include generated docs/data/test files updated during normalization - impact: API contract unchanged except clearer 400 error responses on invalid contact detail updates
36 lines
791 B
PHP
Executable File
36 lines
791 B
PHP
Executable File
<?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);
|
|
}
|
|
}
|