Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php laravel assert on error show message

<?php
namespace TestsFeature;
use TestsTestCase;
class exampleTest extends TestCase
{
    public function test_with_message_on_error()
    {
		for ($i = 0; $i < 10; $i++)
        	// assertLessThan(needed, calucalted, onErrorMessage)
            $this->assertLessThan(3, $i, ">>>>>>>> different index: " . $i);
    }
}
// output
>>>>>>>> different index: 3
Failed asserting that 3 is less than 3.
 
PREVIOUS NEXT
Tagged: #php #laravel #assert #error #show #message
ADD COMMENT
Topic
Name
9+5 =