Php Laravel Assert in der Fehlermeldung anzeigen Meldung
<?php
namespace Tests\Feature;
use Tests\TestCase;
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.
inibir