Add paragraph spaces to post excerpts
[MAILPOET-2627]
This commit is contained in:
@@ -71,7 +71,7 @@ class PostTransformer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function getStructureWithLayout($post) {
|
private function getStructureWithLayout($post) {
|
||||||
$withPostClass = $this->args['displayType'] === 'full';
|
$withPostClass = $this->args['displayType'] === 'full' || $this->args['displayType'] === 'excerpt';
|
||||||
$content = $this->extractor->getContent($post, $withPostClass, $this->args['displayType']);
|
$content = $this->extractor->getContent($post, $withPostClass, $this->args['displayType']);
|
||||||
$title = $this->extractor->getTitle($post);
|
$title = $this->extractor->getTitle($post);
|
||||||
$featuredImage = $this->extractor->getFeaturedImage($post);
|
$featuredImage = $this->extractor->getFeaturedImage($post);
|
||||||
|
@@ -310,39 +310,6 @@ class PostContentTransformerTest extends \MailPoetTest {
|
|||||||
$transformer->transform($post);
|
$transformer->transform($post);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testShouldNotAddClassToParagraphsInExcerptWithLayout() {
|
|
||||||
$args = [
|
|
||||||
'withLayout' => true,
|
|
||||||
'displayType' => 'excerpt',
|
|
||||||
'featuredImagePosition' => 'right',
|
|
||||||
];
|
|
||||||
|
|
||||||
$post = (object)[
|
|
||||||
'post_type' => 'post',
|
|
||||||
];
|
|
||||||
$expectedWithPostClass = false;
|
|
||||||
|
|
||||||
/** @var PostTransformerContentsExtractor&MockObject $extractor */
|
|
||||||
$extractor = $this->make(
|
|
||||||
PostTransformerContentsExtractor::class,
|
|
||||||
[
|
|
||||||
'getContent' => Expected::once($this->contentMock),
|
|
||||||
'getFeaturedImage' => null,
|
|
||||||
'getTitle' => 'Title',
|
|
||||||
]
|
|
||||||
);
|
|
||||||
$extractor->expects($this->once())
|
|
||||||
->method('getContent')
|
|
||||||
->with(
|
|
||||||
$this->equalTo($post),
|
|
||||||
$this->equalTo($expectedWithPostClass),
|
|
||||||
$this->equalTo('excerpt')
|
|
||||||
);
|
|
||||||
|
|
||||||
$transformer = new PostTransformer($args, $extractor);
|
|
||||||
$transformer->transform($post);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return PostTransformer
|
* @return PostTransformer
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user