Read-only was added to prevent using the entity for modifying post data. We want to allow modifying posts only via WP functions so that we don't skip any hooks etc. [MAILPOET-5646]
12 lines
358 B
PHP
12 lines
358 B
PHP
<?php declare(strict_types = 1);
|
|
|
|
namespace MailPoet\Entities;
|
|
|
|
class WpPostEntityTest extends \MailPoetTest {
|
|
public function testItIsReadOnlyAndCanNotBeInstantiated() {
|
|
$this->expectException(\MailPoet\RuntimeException::class);
|
|
$this->expectExceptionMessage('WpPostEntity is read only and cannot be instantiated.');
|
|
new WpPostEntity();
|
|
}
|
|
}
|