Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel assertions full list

PHP Laravel framework provides assertion methods like ->assertTrue(), ->assertFalse() for unit testing. However, I cannot find a full list of them. Are they documented somewhere? If not, where can I find them in Laravel source?

like image 234
user3702861 Avatar asked Jan 17 '15 10:01

user3702861


1 Answers

Sure. Your test cases all should extend Illuminate\Foundation\Testing\TestCase. This class uses the Illuminate\Foundation\Testing\AssertTrait. Those are all the Laravel specific assertions.

View on github

However assertTrue and assertFalse are both part of PHPUnit itself. You can find a list of all PHPUnit assertions on the official website

like image 160
lukasgeiter Avatar answered Sep 29 '22 19:09

lukasgeiter