Move current unit tests to integration tests

This commit is contained in:
wxa
2018-10-17 13:27:34 +03:00
parent b21ef30202
commit 87e515b89d
175 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,30 @@
<?php
namespace MailPoet\Test\Newsletter\Editor;
use pQuery;
use MailPoet\Newsletter\Editor\StructureTransformer;
class StructureTransformerTest extends \MailPoetTest {
function _before() {
$this->transformer = new StructureTransformer();
}
function testItExtractsImagesAsImageBlocks() {
$html = '<p><i>italic</i><em>previous text<a href="#mylink"><img src="#myimage" /></a>next text</em><b>bolded</b></p>';
$blocks = $this->transformer->transform($html, false);
expect($blocks)->count(3);
expect($blocks[0]['type'])->equals('text');
expect($blocks[0]['text'])->equals('<p><i>italic</i><em>previous text</em></p>');
expect($blocks[1]['type'])->equals('image');
expect($blocks[1]['src'])->equals('#myimage');
expect($blocks[1]['link'])->equals('#mylink');
expect($blocks[2]['type'])->equals('text');
expect($blocks[2]['text'])->equals('<p><em>next text</em><b>bolded</b></p>');
}
}