Added tests, and used assertEquals which makes better use of PHPUnit

This commit is contained in:
Sean Harvey 2008-05-23 05:47:07 +00:00
parent edcdbf8935
commit 2f4e8de921
2 changed files with 16 additions and 2 deletions

View File

@ -31,7 +31,7 @@ class MultiFormSessionTest extends SapphireTest {
$session->write();
if($memberID = Member::currentUserID()) {
$this->assertTrue($memberID == $session->SubmitterID);
$this->assertEquals($memberID, $session->SubmitterID);
}
}

View File

@ -47,7 +47,21 @@ class MultiFormTest extends SapphireTest {
function testInitialisingForm() {
$this->assertTrue(is_numeric($this->form->getCurrentStep()->ID) && ($this->form->getCurrentStep()->ID > 0));
$this->assertTrue(is_numeric($this->form->session->ID) && ($this->form->session->ID > 0));
$this->assertTrue($this->form->getStartStep() == 'MultiFormTestStepOne');
$this->assertEquals('MultiFormTestStepOne', $this->form->getStartStep());
}
/**
* Test that the 2nd step is correct to what we expect it to be.
*/
function testSecondStep() {
$this->assertEquals('MultiFormTestStepTwo', $this->form->getCurrentStep()->getNextStep());
}
/**
* Test that the amount of steps we have has been calculated correctly.
*/
function testTotalStepCount() {
$this->assertEquals(3, $this->form->getAllStepsLinear()->Count());
}
/**