Created
February 16, 2020 20:11
-
-
Save devmsh/36c244e28daead53f9819a1a2b27c246 to your computer and use it in GitHub Desktop.
Write better Laravel tests
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 | |
class LoanTest extends TestCase{ | |
public function test_can_log_a_loan() | |
{ | |
// ... | |
$this->passportAs($user) | |
// .. | |
->assertJson([ | |
'id' => 1, | |
'total' => 1000, | |
'payoff_at' => Carbon::today()->addYear(), | |
'user_id' => $user->id, | |
'goal' => [ | |
'total' => 1000, | |
'user_id' => $user->id, | |
'due_date' => Carbon::today()->addYear(), | |
] | |
]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment