'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?



Solution 1:[1]

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

Solution 2:[2]

Laravel uses PHPUnit and here is the list of phpunit assertions list:

https://gist.github.com/briankip/35e3506be8b1ecbcf3bb

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 lukasgeiter
Solution 2