/** * Apply the Design to the given Quad * * @api * @param Quad $quad CheckBox Quad * @return static */ public function applyToQuad(Quad $quad) { if ($this->imageUrl) { $quad->setImageUrl($this->imageUrl); } elseif ($this->style) { $quad->setStyles($this->style, $this->subStyle); } return $this; }
/** * Set the CheckBox Quad * * @api * @param Quad $quad CheckBox Quad * @return static */ public function setQuad(Quad $quad) { $quad->checkId(); $quad->setScriptEvents(true); $this->quad = $quad; return $this; }
/** * Create the CheckBox Quad * * @return Quad */ protected function createQuad() { $quad = new Quad(); $quad->setSize(10, 10); $this->setQuad($quad); return $quad; }
public function testRender() { $domDocument = new \DOMDocument(); $quad = new Quad("test.quad"); $quad->clearAlign()->setImageUrl("some.url")->setImageId("some-id")->setImageFocusUrl("some.url")->setImageFocusId("some-id")->setColorize("some-color")->setModulizeColor("some-color")->setAutoScale(false)->setKeepRatio("some-mode")->setOpacity(0.5)->setBackgroundColor("some-color")->setAction("some-action")->setActionKey(42)->setUrl("some.url")->setUrlId("some.urlid")->setManialink("some-manialink")->setManialinkId("some-manialinkid")->setScriptEvents(true)->setStyle("some-style")->setSubStyle("some-substyle")->setStyleSelected(true); $domElement = $quad->render($domDocument); $domDocument->appendChild($domElement); $this->assertEquals("<?xml version=\"1.0\"?>\n<quad id=\"test.quad\" image=\"some.url\" imageid=\"some-id\" imagefocus=\"some.url\" imagefocusid=\"some-id\" colorize=\"some-color\" modulizecolor=\"some-color\" autoscale=\"0\" keepratio=\"some-mode\" opacity=\"0.5\" bgcolor=\"some-color\" action=\"some-action\" actionkey=\"42\" url=\"some.url\" urlid=\"some.urlid\" manialink=\"some-manialink\" manialinkid=\"some-manialinkid\" scriptevents=\"1\" style=\"some-style\" substyle=\"some-substyle\" styleselected=\"1\"/>\n", $domDocument->saveXML()); }