static::
assertEquals('my-first-block',
$firstCmsBlock->
getName());
static::
assertEquals('First block from app',
$firstCmsBlock->
getLabel());
$firstBlockJson =
json_encode($firstCmsBlock->
getBlock(), \JSON_THROW_ON_ERROR
);
static::
assertIsString($firstBlockJson);
static::
assertJsonStringEqualsJsonFile(__DIR__ . '/_fixtures/cms/expectedFirstCmsBlock.json',
$firstBlockJson);
static::
assertEquals( $this->
stripWhitespace((string) file_get_contents(__DIR__ . '/../Manifest/_fixtures/test/Resources/cms/blocks/my-first-block/preview.html'
)),
$this->
stripWhitespace($firstCmsBlock->
getTemplate()) );
static::
assertEquals( file_get_contents(__DIR__ . '/../Manifest/_fixtures/test/Resources/cms/blocks/my-first-block/styles.css'
),
$firstCmsBlock->
getStyles() );
/** @var AppCmsBlockEntity $secondCmsBlock */
$secondCmsBlock =
$cmsBlocks->
filterByProperty('name', 'my-second-block'
)->
first();
static::
assertEquals('my-second-block',
$secondCmsBlock->
getName());
static::
assertEquals('Second block from app',
$secondCmsBlock->
getLabel());
$cmsBlockJson =
json_encode($secondCmsBlock->
getBlock(), \JSON_THROW_ON_ERROR
);
static::
assertIsString($cmsBlockJson);
static::
assertJsonStringEqualsJsonFile(__DIR__ . '/_fixtures/cms/expectedSecondCmsBlock.json',
$cmsBlockJson);
static::
assertEquals( $this->
stripWhitespace((string) file_get_contents(__DIR__ . '/../Manifest/_fixtures/test/Resources/cms/blocks/my-second-block/previewExpected.html'
)),