public function testDefaultDesign()
 {
     $checkBoxDesign = CheckBoxDesign::defaultDesign();
     $this->assertTrue($checkBoxDesign instanceof CheckBoxDesign);
     $this->assertNotNull($checkBoxDesign->getStyle());
     $this->assertNotNull($checkBoxDesign->getSubStyle());
 }
 public function testDisabledDesign()
 {
     $checkBoxFeature = new CheckBoxFeature();
     $defaultDesign = CheckBoxDesign::defaultDesign();
     $checkBoxDesign = new CheckBoxDesign();
     $this->assertEquals($defaultDesign, $checkBoxFeature->getDisabledDesign());
     $this->assertSame($checkBoxFeature, $checkBoxFeature->setDisabledDesign($checkBoxDesign));
     $this->assertSame($checkBoxDesign, $checkBoxFeature->getDisabledDesign());
 }
예제 #3
0
 /**
  * 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";
 }