WordPress tables use only the DB prefix, but MailPoet tables use DB prefix + plugin prefix (mailpoet). This commit changes TablePrefixMetadataFactory to be able to distiguish WP table for posts and adds proper prefix. [MAILPOET-5646]
16 lines
583 B
PHP
16 lines
583 B
PHP
<?php declare(strict_types = 1);
|
|
|
|
namespace MailPoet\Doctrine;
|
|
|
|
use MailPoet\Entities\NewsletterEntity;
|
|
use MailPoet\Entities\WpPostEntity;
|
|
|
|
class TablePrefixMetadataFactoryTest extends \MailPoetTest {
|
|
public function testItPrefixTablesCorrectly() {
|
|
$wpPostMetadata = $this->entityManager->getClassMetadata(WpPostEntity::class);
|
|
$newslettersMetadata = $this->entityManager->getClassMetadata(NewsletterEntity::class);
|
|
verify($wpPostMetadata->getTableName())->equals('mp_posts');
|
|
verify($newslettersMetadata->getTableName())->equals('mp_mailpoet_newsletters');
|
|
}
|
|
}
|