コード例 #1
0
 /**
  * @covers \NewFrontiers\Framework\Output\Css::registerLibrary
  * @covers \NewFrontiers\Framework\Output\Css::requireLibrary
  * @covers \NewFrontiers\Framework\Output\Css::getLinkTags
  * @covers \NewFrontiers\Framework\Output\Css::includeLibraries
  */
 public function testIncludeLibraries()
 {
     static::assertEquals('', Css::getLinkTags());
     Css::registerLibrary('test1', ['test1.css', 'test2.css']);
     Css::registerLibrary('test2', 'test3.css');
     $soll = "\n<link href=\"test1.css\" rel=\"stylesheet\" type=\"text/css\" />" . "\n<link href=\"test2.css\" rel=\"stylesheet\" type=\"text/css\" />" . "\n<link href=\"test3.css\" rel=\"stylesheet\" type=\"text/css\" />";
     Css::requireLibrary('test1');
     Css::requireLibrary('test2');
     Css::requireLibrary('test3');
     //this will create en error log
     static::assertEquals($soll, Css::getLinkTags());
     //error log asserted here
     $items = Logging::getLogItems();
     $msg = end($items)["msg"];
     static::assertStringStartsWith("CSS-Bibliothek nicht gefunden: test3", $msg);
     //Logging actually puts \r\n at the end of the message
     //the following code depends on the previous code, that' s why it isn't a single test
     Css::registerLibrary(0, '" /><link href="test');
     Css::registerLibrary('test1', '');
     $soll = "\n<link href=\"\" rel=\"stylesheet\" type=\"text/css\" />" . "\n<link href=\"test3.css\" rel=\"stylesheet\" type=\"text/css\" />" . "\n<link href=\"\" /><link href=\"test\" rel=\"stylesheet\" type=\"text/css\" />" . "\n<link href=\"test3.css\" rel=\"stylesheet\" type=\"text/css\" />";
     Css::requireLibrary(0);
     Css::requireLibrary('test2');
     //this will create a second entry for text3.css, what is correct html
     static::assertEquals($soll, Css::getLinkTags());
     Css::includeLibraries();
     $this->expectOutputString(Css::getLinkTags());
 }
コード例 #2
0
 public function requirePlugins()
 {
     if ($this->align) {
         Javascript::requireLibrary('froala-align');
     }
     if ($this->charCounter) {
         Javascript::requireLibrary('froala-charCounter');
         Css::requireLibrary('froala-charCounter');
     }
     if ($this->codeBeautifier) {
         Javascript::requireLibrary('froala-codeBeautifier');
     }
     if ($this->codeView) {
         Javascript::requireLibrary('froala-codeView');
         Css::requireLibrary('froala-codeView');
     }
     if ($this->colors) {
         Javascript::requireLibrary('froala-colors');
         Css::requireLibrary('froala-colors');
     }
     if ($this->draggable) {
         Javascript::requireLibrary('froala-draggable');
         Css::requireLibrary('froala-draggable');
     }
     if ($this->emoticons) {
         Javascript::requireLibrary('froala-emoticons');
         Css::requireLibrary('froala-emoticons');
     }
     if ($this->entities) {
         Javascript::requireLibrary('froala-entities');
         Css::requireLibrary('froala-entities');
     }
     if ($this->file) {
         Javascript::requireLibrary('froala-file');
         Css::requireLibrary('froala-file');
     }
     if ($this->fontFamily) {
         Javascript::requireLibrary('froala-fontFamily');
     }
     if ($this->fontSize) {
         Javascript::requireLibrary('froala-fontSize');
     }
     if ($this->fullscreen) {
         Javascript::requireLibrary('froala-fullscreen');
         Css::requireLibrary('froala-fullscreen');
     }
     if ($this->image) {
         Javascript::requireLibrary('froala-image');
         Css::requireLibrary('froala-image');
     }
     if ($this->imageManager) {
         Javascript::requireLibrary('froala-imageManager');
         Css::requireLibrary('froala-imageManager');
     }
     if ($this->inlineStyle) {
         Javascript::requireLibrary('froala-inlineStyle');
     }
     if ($this->lineBreaker) {
         Javascript::requireLibrary('froala-lineBreaker');
         Css::requireLibrary('froala-lineBreaker');
     }
     if ($this->link) {
         Javascript::requireLibrary('froala-link');
     }
     if ($this->lists) {
         Javascript::requireLibrary('froala-lists');
     }
     if ($this->paragraphFormat) {
         Javascript::requireLibrary('froala-paragraphFormat');
     }
     if ($this->paragraphStyle) {
         Javascript::requireLibrary('froala-paragraphStyle');
     }
     if ($this->quickInsert) {
         Javascript::requireLibrary('froala-quickInsert');
         Css::requireLibrary('froala-quickInsert');
     }
     if ($this->quote) {
         Javascript::requireLibrary('froala-quote');
     }
     if ($this->save) {
         Javascript::requireLibrary('froala-save');
     }
     if ($this->table) {
         Javascript::requireLibrary('froala-table');
         Css::requireLibrary('froala-table');
     }
     if ($this->url) {
         Javascript::requireLibrary('froala-url');
     }
     if ($this->video) {
         Javascript::requireLibrary('froala-video');
         Css::requireLibrary('froala-video');
     }
 }