#211 addTest() should be add()

closed-fixed
5
2011-11-30
2011-11-05
Anonymous
No

I'm getting errors from the online docs below
http://www.simpletest.org/en/group_test_tutorial.html

Changing the line:
$this->addTest(new TestOfLogging());
to:
$this->add(new TestOfLogging());
seems to have solved the issue.

A test suite

A test case does not function alone for very long. When coding for real we usually want to run as many tests as quickly and as often as we can. This means grouping them together into test suites that could easily include every test in the application.

Firstly we create a test suite called all_tests.php in the tests folder...

<?php
require_once(dirname(__FILE__) . '/simpletest/autorun.php');
require_once('log_test.php');

class AllTests extends TestSuite {
function __construct() {
parent::__construct();
$this->addTest(new TestOfLogging());
}
}
?>

We hardly notice the difference when things work...

Discussion

  • Perrick Penet

    Perrick Penet - 2011-11-30
    • assigned_to: nobody --> pp11
    • status: open --> closed-fixed
     
  • Perrick Penet

    Perrick Penet - 2011-11-30

    The correction was applied to the source documentation. It should find its way to the website sooner or later. Thanks for submitting the bug !

    Yours,
    Perrick

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks