Merge pull request #41 from silverstripe-rebelalliance/open/7314

BUGFIX: Fix the PHPUnit tests for SS 3.0. Fixes #7314
This commit is contained in:
Will Rossiter 2012-06-21 21:25:34 -07:00
commit e8a0c7d338

View File

@ -70,7 +70,7 @@ class UserDefinedFormControllerTest extends FunctionalTest {
$controller = new UserDefinedFormControllerTest_Controller($form);
// test form
$this->assertEquals($controller->Form()->Name(), 'Form', 'The form is referenced as Form');
$this->assertEquals($controller->Form()->getName(), 'Form', 'The form is referenced as Form');
$this->assertEquals($controller->Form()->Fields()->Count(), 1); // disabled SecurityID token fields
$this->assertEquals($controller->Form()->Actions()->Count(), 1);
$this->assertEquals(count($controller->Form()->getValidator()->getRequired()), 0);
@ -148,7 +148,8 @@ class UserDefinedFormControllerTest extends FunctionalTest {
function testArrayToJson() {
$array = array('1' => 'one', '2' => 'two');
$string = "{\n1:\"one\", 2:\"two\"\n}\n";
$this->assertEquals(UserDefinedFormControllerTest_Controller::array2json($array), $string);
$form = new UserDefinedFormControllerTest_Controller();
$this->assertEquals($form->array2json($array), $string);
}
@ -224,4 +225,4 @@ class UserDefinedFormControllerTest_Controller extends UserDefinedForM_Controlle
return $form;
}
}
}