| Total Complexity | 5 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | trait UserTrait |
||
| 6 | { |
||
| 7 | public $user; |
||
| 8 | |||
| 9 | public function getAUser() |
||
| 10 | { |
||
| 11 | return $this->user = \DB::table('users')->first(); |
||
| 12 | } |
||
| 13 | |||
| 14 | public function seedUsers() |
||
| 15 | { |
||
| 16 | $now = \Carbon\Carbon::now(); |
||
| 17 | \DB::table('users')->insert([ |
||
| 18 | 'name' => 'PHPUnit', |
||
| 19 | 'email' => '[email protected]', |
||
| 20 | 'password' => \Hash::make('456'), |
||
| 21 | 'created_at' => $now, |
||
| 22 | 'updated_at' => $now, |
||
| 23 | ]); |
||
| 24 | |||
| 25 | \DB::table('users')->insert([ |
||
| 26 | 'name' => 'PHPUnit', |
||
| 27 | 'email' => '[email protected]', |
||
| 28 | 'password' => \Hash::make('456'), |
||
| 29 | 'created_at' => $now, |
||
| 30 | 'updated_at' => $now, |
||
| 31 | ]); |
||
| 32 | } |
||
| 33 | |||
| 34 | public function truncateUsersTable() |
||
| 35 | { |
||
| 36 | \DB::table('users')->truncate(); |
||
| 37 | } |
||
| 38 | |||
| 39 | public function reseedUsers() |
||
| 44 | } |
||
| 45 | |||
| 46 | /** @test */ |
||
| 47 | public function it_has_users() |
||
| 59 | } |
||
| 60 | } |
||
| 61 |