Skip to content

Commit

Permalink
Add more tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Nov 29, 2023
1 parent b992bf9 commit 92aca0e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/Unit/ContactControllerCest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);

namespace App\Tests\Unit;

use App\Tests\Support\UnitTester;
use App\UseCase\Contact\ContactController;
use Yii;
use yii\base\InvalidConfigException;

final class ContactControllerCest
{
public function testIndex(UnitTester $I): void
{
$contactControler = new ContactController('contact', Yii::$app);

$contactControler->formModelClass = '';

$I->expectThrowable(
new InvalidConfigException('The "formModelClass" property must be set.'),
static fn() => $contactControler->runAction('index'),
);
}
}

0 comments on commit 92aca0e

Please sign in to comment.