Files
animethemes-server/tests/Unit/Actions/ActionResultTest.php
T
paranarimasu 80899b07df Delete video action (#444)
* feat(admin): remove video from storage

* style: fix StyleCI findings
2022-08-23 13:45:40 -05:00

49 lines
1.0 KiB
PHP

<?php
declare(strict_types=1);
namespace Tests\Unit\Actions;
use App\Actions\ActionResult;
use App\Enums\Actions\ActionStatus;
use Tests\TestCase;
/**
* Class ActionResultTest.
*/
class ActionResultTest extends TestCase
{
/**
* The Action Result has failed if the status is Failed.
*
* @return void
*/
public function testHasFailed(): void
{
$result = new ActionResult(ActionStatus::FAILED());
static::assertTrue($result->hasFailed());
}
/**
* The Action Result has not failed if the status is not Failed.
*
* @return void
*/
public function testHasNotFailed(): void
{
$status = null;
while ($status === null) {
$statusCandidate = ActionStatus::getRandomInstance();
if (ActionStatus::FAILED()->isNot($statusCandidate)) {
$status = $statusCandidate;
}
}
$result = new ActionResult($status);
static::assertFalse($result->hasFailed());
}
}