/**
  * wstawianie kodu html
  */
 public function testInsertHtml()
 {
     $el = new HtmlElement('head');
     $el->insertHtml('<span class="ma">ma </span>');
     $el->insertHtml('<span class="ala">Ala </span>', $el::CHILD_PREPEND);
     $el->insertHtml('<span class="kota">kota</span>', $el::CHILD_APPEND);
     $span = $el->xpath('span');
     $this->assertEquals('ala', $span->item(0)->getAttribute('class'));
     $this->assertEquals('ma', $span->item(1)->getAttribute('class'));
     $this->assertEquals('kota', $span->item(2)->getAttribute('class'));
     $el->destroy($el);
 }
Example #2
0
 /**
  * Zawartość znacznika channel.
  *
  * @return string
  */
 private function channelContent()
 {
     $output = '';
     $output .= $this->title->render(false, true);
     $output .= $this->link->render(false, true);
     $output .= $this->description->render(false, true);
     if (!$this->language->isEmpty()) {
         $output .= $this->language->render(false, true);
     }
     if (!$this->copyright->isEmpty()) {
         $output .= $this->copyright->render(false, true);
     }
     if (!$this->managingEditor->isEmpty()) {
         $output .= $this->managingEditor->render(false, true);
     }
     if (!$this->webMaster->isEmpty()) {
         $output .= $this->webMaster->render(false, true);
     }
     if (!$this->pubDate->isEmpty()) {
         $output .= $this->pubDate->render(false, true);
     }
     if (!$this->lastBuildDate->isEmpty()) {
         $output .= $this->lastBuildDate->render(false, true);
     }
     if (!$this->category->isEmpty()) {
         $output .= $this->category->render(false, true);
     }
     if (!$this->generator->isEmpty()) {
         $output .= $this->generator->render(false, true);
     }
     if (!$this->ttl->isEmpty()) {
         $output .= $this->ttl->render(false, true);
     }
     if (!$this->imageUrl->isEmpty() && !$this->imageTitle->isEmpty() && !$this->imageLink->isEmpty()) {
         $output .= $this->image->render(false, true);
     }
     if (!$this->textInputLink->isEmpty() && !$this->textInputTitle->isEmpty() && !$this->textInputDescription->isEmpty() && !$this->textInputName->isEmpty()) {
         $output .= $this->textInput->render(false, true);
     }
     if ($this->skipHours->xpath('hour')->length) {
         $output .= $this->skipHours->render(false, true);
     }
     if ($this->skipDays->xpath('day')->length) {
         $output .= $this->skipDays->render(false, true);
     }
     $cloud = $this->cloud();
     if (!empty($cloud['domain']) && !empty($cloud['path']) && !empty($cloud['protocol']) && !empty($cloud['port']) && !empty($cloud['registerProcedure'])) {
         $output .= $this->cloud->render(false, true);
     }
     $output .= $this->body();
     return $output;
 }