Improve table prefixing to allow Doctrine entities for WP tables
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]
This commit is contained in:
committed by
Aschepikov
parent
1565151179
commit
c9c7146ef1
@@ -0,0 +1,15 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user