public function getRegistry() { /** @var PortableElementRegistry $registry */ $registry = PciRegistry::getRegistry($this); $registry->setServiceLocator(ServiceManager::getServiceManager()); $registry->setModel($this); return $registry; }
public function notestRegister() { $pciTmpDir = dirname(__FILE__) . '/../views/js/pciCreator/dev/likertScaleInteraction/'; $this->registry->register('likertScaleInteraction', '0.1.0', ['hook' => ['runtime/likertScaleInteraction.amd.js' => $pciTmpDir . 'runtime/likertScaleInteraction.amd.js'], 'libraries' => ['runtime/js/renderer.js' => $pciTmpDir . 'runtime/js/renderer.js'], 'stylesheets' => ['runtime/css/likertScaleInteraction.css' => $pciTmpDir . 'runtime/css/likertScaleInteraction.css', 'runtime/css/base.css' => $pciTmpDir . 'runtime/css/base.css'], 'mediaFiles' => ['runtime/assets/ThumbDown.png' => $pciTmpDir . 'runtime/assets/ThumbDown.png', 'runtime/assets/ThumbUp.png' => $pciTmpDir . 'runtime/assets/ThumbUp.png', 'runtime/css/img/bg.png' => $pciTmpDir . 'runtime/css/img/bg.png']], ["icon" => ['creator/img/icon.svg' => $pciTmpDir . 'creator/img/icon.svg'], "hook" => ['pciCreator.js' => $pciTmpDir . 'pciCreator.js'], "manifest" => ['pciCreator.json' => $pciTmpDir . 'pciCreator.json'], "libraries" => ['creator/tpl/markup.tpl' => $pciTmpDir . 'creator/tpl/markup.tpl', 'creator/tpl/propertiesForm.tpl' => $pciTmpDir . 'creator/tpl/propertiesForm.tpl', 'creator/widget/Widget.js' => $pciTmpDir . 'creator/widget/Widget.js', 'creator/widget/states/Question.js' => $pciTmpDir . 'creator/widget/states/Question.js', 'creator/widget/states/states.js' => $pciTmpDir . 'creator/widget/states/states.js'], 'stylesheets' => [], 'mediaFiles' => []]); $this->assertTrue(strlen($this->registry->getBaseUrl('likertScaleInteraction', '0.1.0')) > 0); $this->assertFalse($this->registry->getBaseUrl('likertScaleInteraction', '0.1.1')); $pci = $this->registry->getRuntime('likertScaleInteraction', '0.1.0'); $pcis = $this->registry->getLatestRuntimes(); $isOnRuntime = false; foreach ($pcis as $name => $runtime) { foreach ($runtime as $key => $runtime_pci) { if ($pci == $runtime_pci) { $isOnRuntime = true; break; } } } $this->assertTrue($isOnRuntime); }