Esempio n. 1
0
 /**
  * @test
  * @param string $body      the HTML
  * @param string $css       the complete CSS
  * @param string $attribute the attribute that must not be present on this element
  *
  * @dataProvider notMatchingCssToHtmlMappingDataProvider
  */
 public function emogrifierNotMapsUnsuitableCssToHtmlIfFeatureIsEnabled($body, $css, $attribute)
 {
     $this->subject->setHtml($this->html5DocumentType . '<html><body>' . $body . '</body></html>');
     $this->subject->setCss($css);
     $this->subject->enableCssToHtmlMapping();
     $html = $this->subject->emogrify();
     self::assertNotContains($attribute . '="', $html);
 }
Esempio n. 2
0
 /**
  * @test
  * @param string $body          The HTML
  * @param string $css           The complete CSS
  * @param string $tagName       The name of the tag that should be modified
  * @param string $attributes    The attributes that are expected on the element
  *
  * @dataProvider cssToHtmlMappingDataProvider
  */
 public function emogrifierMapsCssToHtml($body, $css, $tagName, $attributes)
 {
     $this->subject->setHtml($this->html5DocumentType . '<html><body>' . $body . '</body></html>');
     $this->subject->setCss($css);
     $this->subject->enableCssToHtmlMapping();
     $html = $this->subject->emogrify();
     self::assertContains('<' . $tagName . ' ' . $attributes, $html);
 }