27 lines
822 B
PHP
27 lines
822 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Esun\MultiLocaleTranslation\Test\Unit\Model;
|
|
|
|
use Esun\MultiLocaleTranslation\Model\BlogPostFields;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class BlogPostFieldsTest extends TestCase
|
|
{
|
|
public function testUrlKeyIsNotTranslatable(): void
|
|
{
|
|
self::assertNotContains('url_key', BlogPostFields::codes());
|
|
}
|
|
|
|
public function testReadsDefaultMetaValueFromMageplazaStoreJson(): void
|
|
{
|
|
self::assertSame(
|
|
'English meta title',
|
|
BlogPostFields::baseValue('meta_title', '{"0":"English meta title","2":"French title"}')
|
|
);
|
|
self::assertSame('Plain value', BlogPostFields::baseValue('meta_title', 'Plain value'));
|
|
self::assertSame('<p>Content</p>', BlogPostFields::baseValue('post_content', '<p>Content</p>'));
|
|
}
|
|
}
|