/** * Build the init script text * * @return string */ protected function buildInitScriptText() { $quadId = Builder::getId($this->getQuad()); $entryId = Builder::EMPTY_STRING; if ($this->entry) { $entryId = Builder::getId($this->getEntry()); } $default = Builder::getBoolean($this->default); $enabledDesignString = $this->enabledDesign->getDesignString(); $disabledDesignString = $this->disabledDesign->getDesignString(); return "\ndeclare Quad_CheckBox <=> (Page.GetFirstChild(\"{$quadId}\") as CMlQuad);\ndeclare Text[Boolean] " . self::VAR_CHECKBOX_DESIGNS . " as Designs for Quad_CheckBox;\nDesigns[True] = \"{$enabledDesignString}\";\nDesigns[False] = \"{$disabledDesignString}\";\ndeclare Boolean " . self::VAR_CHECKBOX_ENABLED . " as Enabled for Quad_CheckBox;\nEnabled = !{$default};\ndeclare Text " . self::VAR_CHECKBOX_ENTRY_ID . " as EntryId for Quad_CheckBox;\nEntryId = \"{$entryId}\";\n" . self::FUNCTION_UPDATE_QUAD_DESIGN . "(Quad_CheckBox);\n"; }
public function testDesignStringWithImageUrl() { $checkBoxDesign = new CheckBoxDesign("image.url"); $designString = $checkBoxDesign->getDesignString(); $this->assertEquals($designString, "image.url"); }