N00b needs help @group testing

Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")

Moderator: General Moderators

Post Reply
Terrahawk
Forum Newbie
Posts: 2
Joined: Fri Mar 02, 2007 2:58 am
Location: Germany / Black Forrest

N00b needs help @group testing

Post by Terrahawk »

Hello ,

Momentarily I try simple test. Unfortunately I have the straight following problem...

imprint.test.php
.

Code: Select all

<?php

require_once('simpletest/web_tester.php');
require_once('simpletest/reporter.php');
require_once('simpletest/url.php');
require_once('simpletest/unit_tester.php');

class ImprintTest extends WebTestCase {

	function CheckImprintAccessibility() {
        $browser = new SimpleBrowser();
        $browser->addHeader('User-Agent: Firefox/2.0.0.2');
        $this->get('http://www.domain.eu');
        $this->clickLink('Imprint');

        $this->assertText('Mail');
        $this->assertPattern('/@/');

        $this->assertLink('http//www.test.eu');

	}

}

?>

and this one :

index.php

<?php

    require_once('simpletest/unit_tester.php');
    require_once('simpletest/web_tester.php');
    require_once('simpletest/reporter.php');


    class AllTests extends TestSuite {
        function AllTests() {
            $this->TestSuite('Testing');
            $this->addTestFile('imprint.test.php');
// etc

        }
        
    }
    
    
        $test = new AllTests();
	$test->run(new HtmlReporter());

?>
Result is "1/1 test cases complete: 0 passes, 0 fails and 0 exceptions."

Why that does not function ? Where is the Problem ?

PS: Excuse me for my horrible english :roll:
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The method in your ImprintTest class must start with "test" to be called.
Terrahawk
Forum Newbie
Posts: 2
Joined: Fri Mar 02, 2007 2:58 am
Location: Germany / Black Forrest

Post by Terrahawk »

8O :roll: :idea:

Thank you very much :)
Post Reply