Created
May 29, 2021 14:12
-
-
Save CodeAdminDe/9868377a0e11519ebd0522ffe4bc946f to your computer and use it in GitHub Desktop.
Just a simple example of model constant testing via PHPUnit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests\Unit\Models; | |
use App\Models\User; | |
use PHPUnit\Framework\TestCase; | |
class UserConstantsTest extends TestCase | |
{ | |
/** | |
* Test values of very important constants to avoid changes without notion. | |
* | |
* @return void | |
*/ | |
public function test_constants_of_role_ids_not_changed_values() | |
{ | |
$this->assertTrue(1 === User::ROLE_ID_ADMIN); | |
$this->assertTrue(2 === User::ROLE_ID_SUPPORTER); | |
$this->assertTrue(3 === User::ROLE_ID_USER); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment