mirror of
https://github.com/silverstripe/silverstripe-multiform
synced 2024-10-22 11:05:49 +02:00
Added tests, and used assertEquals which makes better use of PHPUnit
This commit is contained in:
parent
edcdbf8935
commit
2f4e8de921
@ -31,7 +31,7 @@ class MultiFormSessionTest extends SapphireTest {
|
|||||||
$session->write();
|
$session->write();
|
||||||
|
|
||||||
if($memberID = Member::currentUserID()) {
|
if($memberID = Member::currentUserID()) {
|
||||||
$this->assertTrue($memberID == $session->SubmitterID);
|
$this->assertEquals($memberID, $session->SubmitterID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,21 @@ class MultiFormTest extends SapphireTest {
|
|||||||
function testInitialisingForm() {
|
function testInitialisingForm() {
|
||||||
$this->assertTrue(is_numeric($this->form->getCurrentStep()->ID) && ($this->form->getCurrentStep()->ID > 0));
|
$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(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());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user