is_valid; } } class BaseBackendFormTest extends BaseTestCase { public function testIsForceCreationCheckboxBeingAdded() { $form = new BackendForm(); $form->is_valid = false; $this->assertFalse($form->isValid(array())); $this->assertNotNull( $form->getElement('backend_force_creation'), 'Checkbox to force a backend\'s creation is not being added though the backend is invalid' ); } public function testIsForceCreationCheckboxNotBeingAdded() { $form = new BackendForm(); $form->is_valid = true; $this->assertTrue($form->isValid(array())); $this->assertNull( $form->getElement('backend_force_creation'), 'Checkbox to force a backend\'s creation is being added though the backend is valid' ); } public function testIsTheFormValidIfForceCreationTrue() { $form = new BackendForm(); $form->is_valid = false; $this->assertTrue( $form->isValid(array('backend_force_creation' => 1)), 'BaseBackendForm with invalid backend is not valid though force creation is set' ); } }