/** * Tests that the isChecked method works as expected when using a translator. * @group ZF-4073 */ public function testIsCheckedReturnsExpectedValueWhenUsingTranslator() { $translations = array('label' => 'translation'); $translate = new Zend_Translate('array', $translations); $submit = new Zend_Form_Element_Submit('foo', 'label'); $submit->setTranslator($translate); $submit->setValue($translations['label']); $this->assertTrue($submit->isChecked()); $submit->setValue('label'); $this->assertFalse($submit->isChecked()); }
public function testLabelIsTranslatedWhenTranslationAvailable() { require_once 'Zend/Translate.php'; $translations = array('Label' => 'This is the Submit Label'); $translate = new Zend_Translate('array', $translations); $submit = new Zend_Form_Element_Submit('foo', 'Label'); $submit->setTranslator($translate); $this->assertEquals($translations['Label'], $submit->getLabel()); }