Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SimpleTest showing success

Just in order so we see it I include an example where I removed the failing test and in the following example all of the assertions are successful.

<?php

require_once(dirname(__FILE__) . '/../../../tools/simpletest/autorun.php');

require_once(dirname(__FILE__) . '/../includes/mylib.php');

class TestOfAdd extends UnitTestCase {
    function testAdd() {
        $this->assertTrue(add(1,1) == 2);
        $this->assertTrue(add(2,2) == 4);
    }
}


?>


Output:

{% embed include file="src/examples/php/simpletest/st02.txt)

With the last row being GREEN