We’re big fans of fat models
OK. I won’t torture you anymore. Let’s write our first unit test.
Use the following sample code in your UserFixture.php file.
1 <?php
2 namespace App\Test\Fixture;
3
4 use Cake\TestSuite\Fixture\TestFixture;
5
6 class UsersFixture extends TestFixture
7 {
8
9 public $import = ['model' => 'Users'];
10
11 public $records = [
12 [
13 'id' => 1,
14 'username' => 'rrd',
15 'password' => 'Gouranga',
16 'role' ...