1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-09-15 18:57:05 +00:00

Merge pull request #8117 from wallabag/fix-some-depreciation-notices

Fix some depreciation notices
This commit is contained in:
Yassine Guedidi 2025-04-02 21:15:50 +02:00 committed by GitHub
commit 0d93add058
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 75 additions and 168 deletions

View file

@ -29,6 +29,7 @@ framework:
handler_id: session.handler.native_file handler_id: session.handler.native_file
save_path: "%kernel.project_dir%/var/sessions/%kernel.environment%" save_path: "%kernel.project_dir%/var/sessions/%kernel.environment%"
cookie_secure: auto cookie_secure: auto
storage_factory_id: session.storage.factory.native
fragments: ~ fragments: ~
http_method_override: true http_method_override: true
assets: assets:
@ -197,7 +198,7 @@ fos_user:
address: "%from_email%" address: "%from_email%"
sender_name: wallabag sender_name: wallabag
service: service:
mailer: Wallabag\Mailer\UserMailer mailer: fos_user.mailer.twig_symfony
fos_oauth_server: fos_oauth_server:
db_driver: orm db_driver: orm

View file

@ -10,7 +10,7 @@ parameters:
framework: framework:
test: ~ test: ~
session: session:
storage_id: session.storage.mock_file storage_factory_id: session.storage.factory.mock_file
profiler: profiler:
collect: false collect: false
translator: translator:

View file

@ -1,5 +1,5 @@
security: security:
encoders: password_hashers:
FOS\UserBundle\Model\UserInterface: sha512 FOS\UserBundle\Model\UserInterface: sha512
role_hierarchy: role_hierarchy:

View file

@ -260,16 +260,6 @@ services:
$defaultSettings: '%wallabag.default_internal_settings%' $defaultSettings: '%wallabag.default_internal_settings%'
$defaultIgnoreOriginInstanceRules: '%wallabag.default_ignore_origin_instance_rules%' $defaultIgnoreOriginInstanceRules: '%wallabag.default_ignore_origin_instance_rules%'
Wallabag\Mailer\UserMailer:
arguments:
$parameters:
template:
confirmation: '%fos_user.registration.confirmation.template%'
resetting: '%fos_user.resetting.email.template%'
from_email:
confirmation: '%fos_user.registration.confirmation.from_email%'
resetting: '%fos_user.resetting.email.from_email%'
Wallabag\Event\Listener\CreateConfigListener: Wallabag\Event\Listener\CreateConfigListener:
arguments: arguments:
$itemsOnPage: "%wallabag.items_on_page%" $itemsOnPage: "%wallabag.items_on_page%"

View file

@ -27,7 +27,7 @@ class Version20161001072726 extends WallabagMigration
// remove all FK from entry_tag // remove all FK from entry_tag
switch (true) { switch (true) {
case $platform instanceof MySQLPlatform: case $platform instanceof MySQLPlatform:
$query = $this->connection->query(" $query = $this->connection->executeQuery("
SELECT CONSTRAINT_NAME SELECT CONSTRAINT_NAME
FROM information_schema.key_column_usage FROM information_schema.key_column_usage
WHERE TABLE_NAME = '" . $this->getTable('entry_tag', WallabagMigration::UN_ESCAPED_TABLE) . "' AND CONSTRAINT_NAME LIKE 'FK_%' WHERE TABLE_NAME = '" . $this->getTable('entry_tag', WallabagMigration::UN_ESCAPED_TABLE) . "' AND CONSTRAINT_NAME LIKE 'FK_%'
@ -40,7 +40,7 @@ class Version20161001072726 extends WallabagMigration
break; break;
case $platform instanceof PostgreSQLPlatform: case $platform instanceof PostgreSQLPlatform:
// http://dba.stackexchange.com/questions/36979/retrieving-all-pk-and-fk // http://dba.stackexchange.com/questions/36979/retrieving-all-pk-and-fk
$query = $this->connection->query(" $query = $this->connection->executeQuery("
SELECT conrelid::regclass AS table_from SELECT conrelid::regclass AS table_from
,conname ,conname
,pg_get_constraintdef(c.oid) ,pg_get_constraintdef(c.oid)
@ -64,7 +64,7 @@ class Version20161001072726 extends WallabagMigration
switch (true) { switch (true) {
case $platform instanceof MySQLPlatform: case $platform instanceof MySQLPlatform:
$query = $this->connection->query(" $query = $this->connection->executeQuery("
SELECT CONSTRAINT_NAME SELECT CONSTRAINT_NAME
FROM information_schema.key_column_usage FROM information_schema.key_column_usage
WHERE TABLE_NAME = '" . $this->getTable('annotation', WallabagMigration::UN_ESCAPED_TABLE) . "' WHERE TABLE_NAME = '" . $this->getTable('annotation', WallabagMigration::UN_ESCAPED_TABLE) . "'
@ -79,7 +79,7 @@ class Version20161001072726 extends WallabagMigration
break; break;
case $platform instanceof PostgreSQLPlatform: case $platform instanceof PostgreSQLPlatform:
// http://dba.stackexchange.com/questions/36979/retrieving-all-pk-and-fk // http://dba.stackexchange.com/questions/36979/retrieving-all-pk-and-fk
$query = $this->connection->query(" $query = $this->connection->executeQuery("
SELECT conrelid::regclass AS table_from SELECT conrelid::regclass AS table_from
,conname ,conname
,pg_get_constraintdef(c.oid) ,pg_get_constraintdef(c.oid)

View file

@ -20,7 +20,7 @@ class Version20170719231144 extends WallabagMigration
} }
// Find tags which need to be merged // Find tags which need to be merged
$dupTags = $this->connection->query(' $dupTags = $this->connection->executeQuery('
SELECT LOWER(label) AS lower_label SELECT LOWER(label) AS lower_label
FROM ' . $this->getTable('tag') . ' FROM ' . $this->getTable('tag') . '
GROUP BY LOWER(label) GROUP BY LOWER(label)
@ -31,7 +31,7 @@ class Version20170719231144 extends WallabagMigration
$label = $duplicates['lower_label']; $label = $duplicates['lower_label'];
// Retrieve all duplicate tags for a given tag // Retrieve all duplicate tags for a given tag
$tags = $this->connection->query(' $tags = $this->connection->executeQuery('
SELECT id SELECT id
FROM ' . $this->getTable('tag') . ' FROM ' . $this->getTable('tag') . '
WHERE LOWER(label) = :label WHERE LOWER(label) = :label

View file

@ -60,11 +60,6 @@ parameters:
count: 2 count: 2
path: src/Mailer/AuthCodeMailer.php path: src/Mailer/AuthCodeMailer.php
-
message: "#^PHPDoc type Symfony\\\\Component\\\\Mailer\\\\MailerInterface of property Wallabag\\\\Mailer\\\\UserMailer\\:\\:\\$mailer is not covariant with PHPDoc type Swift_Mailer of overridden property FOS\\\\UserBundle\\\\Mailer\\\\TwigSwiftMailer\\:\\:\\$mailer\\.$#"
count: 1
path: src/Mailer/UserMailer.php
- -
message: "#^Call to an undefined method DOMNode\\:\\:getAttribute\\(\\)\\.$#" message: "#^Call to an undefined method DOMNode\\:\\:getAttribute\\(\\)\\.$#"
count: 1 count: 1

View file

@ -138,7 +138,7 @@ class InstallCommand extends Command
// now check if MySQL isn't too old to handle utf8mb4 // now check if MySQL isn't too old to handle utf8mb4
if ($conn->isConnected() && $conn->getDatabasePlatform() instanceof MySQLPlatform) { if ($conn->isConnected() && $conn->getDatabasePlatform() instanceof MySQLPlatform) {
$version = $conn->query('select version()')->fetchOne(); $version = $conn->executeQuery('select version()')->fetchOne();
$minimalVersion = '5.5.4'; $minimalVersion = '5.5.4';
if (false === version_compare($version, $minimalVersion, '>')) { if (false === version_compare($version, $minimalVersion, '>')) {
@ -151,7 +151,7 @@ class InstallCommand extends Command
// testing if PostgreSQL > 9.1 // testing if PostgreSQL > 9.1
if ($conn->isConnected() && $conn->getDatabasePlatform() instanceof PostgreSQLPlatform) { if ($conn->isConnected() && $conn->getDatabasePlatform() instanceof PostgreSQLPlatform) {
// return version should be like "PostgreSQL 9.5.4 on x86_64-apple-darwin15.6.0, compiled by Apple LLVM version 8.0.0 (clang-800.0.38), 64-bit" // return version should be like "PostgreSQL 9.5.4 on x86_64-apple-darwin15.6.0, compiled by Apple LLVM version 8.0.0 (clang-800.0.38), 64-bit"
$version = $conn->query('SELECT version();')->fetchOne(); $version = $conn->executeQuery('SELECT version();')->fetchOne();
preg_match('/PostgreSQL ([0-9\.]+)/i', $version, $matches); preg_match('/PostgreSQL ([0-9\.]+)/i', $version, $matches);

View file

@ -7,8 +7,8 @@ use PhpAmqpLib\Message\AMQPMessage;
class AMQPEntryConsumer extends AbstractConsumer implements ConsumerInterface class AMQPEntryConsumer extends AbstractConsumer implements ConsumerInterface
{ {
public function execute(AMQPMessage $msg) public function execute(AMQPMessage $msg): int|bool
{ {
return $this->handleMessage($msg->body); return $this->handleMessage($msg->getBody());
} }
} }

View file

@ -115,6 +115,6 @@ class RabbitMQConsumerTotalProxy
return 0; return 0;
} }
return $message->delivery_info['message_count'] + 1; return $message->getMessageCount() + 1;
} }
} }

View file

@ -625,7 +625,7 @@ class EntryController extends AbstractController
*/ */
private function showEntries($type, Request $request, $page) private function showEntries($type, Request $request, $page)
{ {
$searchTerm = (isset($request->query->get('search_entry')['term']) ? trim($request->query->get('search_entry')['term']) : ''); $searchTerm = (isset($request->query->all('search_entry')['term']) ? trim($request->query->all('search_entry')['term']) : '');
$currentRoute = (null !== $request->query->get('currentRoute') ? $request->query->get('currentRoute') : ''); $currentRoute = (null !== $request->query->get('currentRoute') ? $request->query->get('currentRoute') : '');
$currentEntryId = $request->attributes->getInt('id'); $currentEntryId = $request->attributes->getInt('id');

View file

@ -77,7 +77,7 @@ class ExportController extends AbstractController
$title = 'Tag ' . $tag->getLabel(); $title = 'Tag ' . $tag->getLabel();
} elseif ('search' === $category) { } elseif ('search' === $category) {
$searchTerm = (isset($request->query->get('search_entry')['term']) ? $request->query->get('search_entry')['term'] : ''); $searchTerm = (isset($request->query->all('search_entry')['term']) ? $request->query->all('search_entry')['term'] : '');
$currentRoute = (null !== $request->query->get('currentRoute') ? $request->query->get('currentRoute') : ''); $currentRoute = (null !== $request->query->get('currentRoute') ? $request->query->get('currentRoute') : '');
$entries = $entryRepository->getBuilderForSearchByUser( $entries = $entryRepository->getBuilderForSearchByUser(

View file

@ -14,10 +14,12 @@ use Wallabag\Import\ImportChain;
class ImportController extends AbstractController class ImportController extends AbstractController
{ {
private RabbitMQConsumerTotalProxy $rabbitMQConsumerTotalProxy; private RabbitMQConsumerTotalProxy $rabbitMQConsumerTotalProxy;
private Client $redisClient;
public function __construct(RabbitMQConsumerTotalProxy $rabbitMQConsumerTotalProxy) public function __construct(RabbitMQConsumerTotalProxy $rabbitMQConsumerTotalProxy, Client $redisClient)
{ {
$this->rabbitMQConsumerTotalProxy = $rabbitMQConsumerTotalProxy; $this->rabbitMQConsumerTotalProxy = $rabbitMQConsumerTotalProxy;
$this->redisClient = $redisClient;
} }
/** /**
@ -67,22 +69,20 @@ class ImportController extends AbstractController
$rabbitNotInstalled = true; $rabbitNotInstalled = true;
} }
} elseif ($craueConfig->get('import_with_redis')) { } elseif ($craueConfig->get('import_with_redis')) {
$redis = $this->get(Client::class);
try { try {
$nbRedisMessages = $redis->llen('wallabag.import.pocket') $nbRedisMessages = $this->redisClient->llen('wallabag.import.pocket')
+ $redis->llen('wallabag.import.readability') + $this->redisClient->llen('wallabag.import.readability')
+ $redis->llen('wallabag.import.wallabag_v1') + $this->redisClient->llen('wallabag.import.wallabag_v1')
+ $redis->llen('wallabag.import.wallabag_v2') + $this->redisClient->llen('wallabag.import.wallabag_v2')
+ $redis->llen('wallabag.import.firefox') + $this->redisClient->llen('wallabag.import.firefox')
+ $redis->llen('wallabag.import.chrome') + $this->redisClient->llen('wallabag.import.chrome')
+ $redis->llen('wallabag.import.instapaper') + $this->redisClient->llen('wallabag.import.instapaper')
+ $redis->llen('wallabag.import.pinboard') + $this->redisClient->llen('wallabag.import.pinboard')
+ $redis->llen('wallabag.import.delicious') + $this->redisClient->llen('wallabag.import.delicious')
+ $redis->llen('wallabag.import.elcurator') + $this->redisClient->llen('wallabag.import.elcurator')
+ $redis->llen('wallabag.import.shaarli') + $this->redisClient->llen('wallabag.import.shaarli')
+ $redis->llen('wallabag.import.pocket_html') + $this->redisClient->llen('wallabag.import.pocket_html')
+ $redis->llen('wallabag.import.omnivore') + $this->redisClient->llen('wallabag.import.omnivore')
; ;
} catch (\Exception $e) { } catch (\Exception $e) {
$redisNotInstalled = true; $redisNotInstalled = true;

View file

@ -161,7 +161,7 @@ class UserController extends AbstractController
$form->handleRequest($request); $form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) { if ($form->isSubmitted() && $form->isValid()) {
$searchTerm = (isset($request->query->get('search_user')['term']) ? $request->query->get('search_user')['term'] : ''); $searchTerm = (isset($request->query->all('search_user')['term']) ? $request->query->all('search_user')['term'] : '');
$qb = $userRepository->getQueryBuilderForSearch($searchTerm); $qb = $userRepository->getQueryBuilderForSearch($searchTerm);
} }

View file

@ -14,7 +14,7 @@ use Doctrine\DBAL\Types\JsonType;
*/ */
class JsonArrayType extends JsonType class JsonArrayType extends JsonType
{ {
public function convertToPHPValue($value, AbstractPlatform $platform) public function convertToPHPValue($value, AbstractPlatform $platform): mixed
{ {
if (null === $value || '' === $value) { if (null === $value || '' === $value) {
return []; return [];

View file

@ -5,7 +5,7 @@ namespace Wallabag\Event\Listener;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Security\Core\AuthenticationEvents; use Symfony\Component\Security\Http\Event\LoginFailureEvent;
class AuthenticationFailureListener implements EventSubscriberInterface class AuthenticationFailureListener implements EventSubscriberInterface
{ {
@ -21,7 +21,7 @@ class AuthenticationFailureListener implements EventSubscriberInterface
public static function getSubscribedEvents(): array public static function getSubscribedEvents(): array
{ {
return [ return [
AuthenticationEvents::AUTHENTICATION_FAILURE => 'onAuthenticationFailure', LoginFailureEvent::class => 'onAuthenticationFailure',
]; ];
} }

View file

@ -4,7 +4,7 @@ namespace Wallabag\Event\Subscriber;
use Doctrine\Common\EventSubscriber; use Doctrine\Common\EventSubscriber;
use Doctrine\DBAL\Platforms\SqlitePlatform; use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\ORM\Event\LifecycleEventArgs; use Doctrine\ORM\Event\PreRemoveEventArgs;
use Doctrine\Persistence\ManagerRegistry; use Doctrine\Persistence\ManagerRegistry;
use Wallabag\Entity\Entry; use Wallabag\Entity\Entry;
@ -38,7 +38,7 @@ class SQLiteCascadeDeleteSubscriber implements EventSubscriber
* We removed everything related to the upcoming removed entry because SQLite can't handle it on it own. * We removed everything related to the upcoming removed entry because SQLite can't handle it on it own.
* We do it in the preRemove, because we can't retrieve tags in the postRemove (because the entry id is gone). * We do it in the preRemove, because we can't retrieve tags in the postRemove (because the entry id is gone).
*/ */
public function preRemove(LifecycleEventArgs $args) public function preRemove(PreRemoveEventArgs $args)
{ {
$entity = $args->getObject(); $entity = $args->getObject();
if (!$this->doctrine->getConnection()->getDatabasePlatform() instanceof SqlitePlatform if (!$this->doctrine->getConnection()->getDatabasePlatform() instanceof SqlitePlatform

View file

@ -67,6 +67,11 @@ class WallabagClient implements HttpClientInterface
return $this->httpClient->stream($responses, $timeout); return $this->httpClient->stream($responses, $timeout);
} }
public function withOptions(array $options): HttpClientInterface
{
return new self($this->restrictedAccess, $this->browser, $this->authenticator, $this->logger);
}
private function getCookieHeader(string $url): ?string private function getCookieHeader(string $url): ?string
{ {
$cookies = []; $cookies = [];

View file

@ -1,78 +0,0 @@
<?php
namespace Wallabag\Mailer;
use FOS\UserBundle\Mailer\TwigSwiftMailer;
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Email;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Twig\Environment;
/**
* This replace the default mailer from TwigSwiftMailer by symfony/mailer instead of swiftmailer.
*/
class UserMailer extends TwigSwiftMailer
{
/**
* @var MailerInterface
*/
protected $mailer;
/**
* @var UrlGeneratorInterface
*/
protected $router;
/**
* @var Environment
*/
protected $twig;
/**
* @var array{template: array{confirmation: string, resetting: string}, from_email: array{confirmation: array<string, string>|string, resetting: array<string, string>|string}}
*/
protected $parameters;
public function __construct(MailerInterface $mailer, UrlGeneratorInterface $router, Environment $twig, array $parameters)
{
$this->mailer = $mailer;
$this->router = $router;
$this->twig = $twig;
$this->parameters = $parameters;
}
/**
* @param string $templateName
* @param array $context
* @param array $fromEmail
* @param string $toEmail
*/
protected function sendMessage($templateName, $context, $fromEmail, $toEmail)
{
$template = $this->twig->load($templateName);
$subject = $template->renderBlock('subject', $context);
$textBody = $template->renderBlock('body_text', $context);
$htmlBody = '';
if ($template->hasBlock('body_html', $context)) {
$htmlBody = $template->renderBlock('body_html', $context);
}
$email = (new Email())
->from(new Address(key($fromEmail), current($fromEmail)))
->to($toEmail)
->subject($subject);
if (!empty($htmlBody)) {
$email
->text($textBody)
->html($htmlBody);
} else {
$email->text($textBody);
}
$this->mailer->send($email);
}
}

View file

@ -691,7 +691,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$container = $this->client->getContainer(); $container = $this->client->getContainer();
$contentProxy = $this->getMockBuilder(ContentProxy::class) $contentProxy = $this->getMockBuilder(ContentProxy::class)
->disableOriginalConstructor() ->disableOriginalConstructor()
->setMethods(['updateEntry']) ->onlyMethods(['updateEntry'])
->getMock(); ->getMock();
$contentProxy->expects($this->any()) $contentProxy->expects($this->any())
->method('updateEntry') ->method('updateEntry')

View file

@ -1721,7 +1721,7 @@ class EntryControllerTest extends WallabagTestCase
$container = $client->getContainer(); $container = $client->getContainer();
$contentProxy = $this->getMockBuilder(ContentProxy::class) $contentProxy = $this->getMockBuilder(ContentProxy::class)
->disableOriginalConstructor() ->disableOriginalConstructor()
->setMethods(['updateEntry']) ->onlyMethods(['updateEntry'])
->getMock(); ->getMock();
$contentProxy->expects($this->any()) $contentProxy->expects($this->any())
->method('updateEntry') ->method('updateEntry')

View file

@ -8,10 +8,9 @@ use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\AuthenticationEvents;
use Symfony\Component\Security\Core\Event\AuthenticationFailureEvent;
use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface;
use Symfony\Component\Security\Http\Event\LoginFailureEvent;
use Wallabag\Event\Listener\AuthenticationFailureListener; use Wallabag\Event\Listener\AuthenticationFailureListener;
class AuthenticationFailureListenerTest extends TestCase class AuthenticationFailureListenerTest extends TestCase
@ -43,7 +42,7 @@ class AuthenticationFailureListenerTest extends TestCase
public function testOnAuthenticationFailure() public function testOnAuthenticationFailure()
{ {
$token = $this->getMockBuilder(TokenInterface::class) $authenticator = $this->getMockBuilder(AuthenticatorInterface::class)
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -51,15 +50,9 @@ class AuthenticationFailureListenerTest extends TestCase
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$event = new AuthenticationFailureEvent( $event = new LoginFailureEvent($exception, $authenticator, $this->requestStack->getMainRequest(), null, 'main', null);
$token,
$exception
);
$this->dispatcher->dispatch( $this->dispatcher->dispatch($event);
$event,
AuthenticationEvents::AUTHENTICATION_FAILURE
);
$records = $this->logHandler->getRecords(); $records = $this->logHandler->getRecords();

View file

@ -82,6 +82,6 @@ class LocaleListenerTest extends TestCase
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
return new RequestEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST); return new RequestEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST);
} }
} }

View file

@ -9,6 +9,7 @@ use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Event\LoadClassMetadataEventArgs; use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\DefaultQuoteStrategy;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Wallabag\Entity\User; use Wallabag\Entity\User;
use Wallabag\Event\Subscriber\TablePrefixSubscriber; use Wallabag\Event\Subscriber\TablePrefixSubscriber;
@ -57,7 +58,7 @@ class TablePrefixSubscriberTest extends TestCase
$subscriber->loadClassMetadata($metaDataEvent); $subscriber->loadClassMetadata($metaDataEvent);
$this->assertSame($finalTableName, $metaDataEvent->getClassMetadata()->getTableName()); $this->assertSame($finalTableName, $metaDataEvent->getClassMetadata()->getTableName());
$this->assertSame($finalTableNameQuoted, $metaDataEvent->getClassMetadata()->getQuotedTableName($platform)); $this->assertSame($finalTableNameQuoted, (new DefaultQuoteStrategy())->getTableName($metaClass, $platform));
} }
/** /**
@ -82,7 +83,7 @@ class TablePrefixSubscriberTest extends TestCase
$evm->dispatchEvent('loadClassMetadata', $metaDataEvent); $evm->dispatchEvent('loadClassMetadata', $metaDataEvent);
$this->assertSame($finalTableName, $metaDataEvent->getClassMetadata()->getTableName()); $this->assertSame($finalTableName, $metaDataEvent->getClassMetadata()->getTableName());
$this->assertSame($finalTableNameQuoted, $metaDataEvent->getClassMetadata()->getQuotedTableName($platform)); $this->assertSame($finalTableNameQuoted, (new DefaultQuoteStrategy())->getTableName($metaClass, $platform));
} }
public function testPrefixManyToMany() public function testPrefixManyToMany()
@ -115,6 +116,6 @@ class TablePrefixSubscriberTest extends TestCase
$this->assertSame('yo_entry', $metaDataEvent->getClassMetadata()->getTableName()); $this->assertSame('yo_entry', $metaDataEvent->getClassMetadata()->getTableName());
$this->assertSame('yo_entry_tag', $metaDataEvent->getClassMetadata()->associationMappings['tags']['joinTable']['name']); $this->assertSame('yo_entry_tag', $metaDataEvent->getClassMetadata()->associationMappings['tags']['joinTable']['name']);
$this->assertSame('yo_entry', $metaDataEvent->getClassMetadata()->getQuotedTableName(new MySQLPlatform())); $this->assertSame('yo_entry', (new DefaultQuoteStrategy())->getTableName($metaClass, new MySQLPlatform()));
} }
} }

View file

@ -29,7 +29,7 @@ class ContentProxyTest extends TestCase
$ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock(); $ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock();
$graby = $this->getMockBuilder(Graby::class) $graby = $this->getMockBuilder(Graby::class)
->setMethods(['fetchContent']) ->onlyMethods(['fetchContent'])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -69,7 +69,7 @@ class ContentProxyTest extends TestCase
$ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock(); $ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock();
$graby = $this->getMockBuilder(Graby::class) $graby = $this->getMockBuilder(Graby::class)
->setMethods(['fetchContent']) ->onlyMethods(['fetchContent'])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -109,7 +109,7 @@ class ContentProxyTest extends TestCase
$ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock(); $ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock();
$graby = $this->getMockBuilder(Graby::class) $graby = $this->getMockBuilder(Graby::class)
->setMethods(['fetchContent']) ->onlyMethods(['fetchContent'])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -154,7 +154,7 @@ class ContentProxyTest extends TestCase
->method('process'); ->method('process');
$graby = $this->getMockBuilder(Graby::class) $graby = $this->getMockBuilder(Graby::class)
->setMethods(['fetchContent']) ->onlyMethods(['fetchContent'])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -200,7 +200,7 @@ class ContentProxyTest extends TestCase
->method('process'); ->method('process');
$graby = $this->getMockBuilder(Graby::class) $graby = $this->getMockBuilder(Graby::class)
->setMethods(['fetchContent']) ->onlyMethods(['fetchContent'])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -246,7 +246,7 @@ class ContentProxyTest extends TestCase
->method('process'); ->method('process');
$graby = $this->getMockBuilder(Graby::class) $graby = $this->getMockBuilder(Graby::class)
->setMethods(['fetchContent']) ->onlyMethods(['fetchContent'])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -291,7 +291,7 @@ class ContentProxyTest extends TestCase
->method('process'); ->method('process');
$graby = $this->getMockBuilder(Graby::class) $graby = $this->getMockBuilder(Graby::class)
->setMethods(['fetchContent']) ->onlyMethods(['fetchContent'])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -341,7 +341,7 @@ class ContentProxyTest extends TestCase
->willReturn(new ConstraintViolationList([new ConstraintViolation('oops', 'oops', [], 'oops', 'language', 'dontexist')])); ->willReturn(new ConstraintViolationList([new ConstraintViolation('oops', 'oops', [], 'oops', 'language', 'dontexist')]));
$graby = $this->getMockBuilder(Graby::class) $graby = $this->getMockBuilder(Graby::class)
->setMethods(['fetchContent']) ->onlyMethods(['fetchContent'])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -392,7 +392,7 @@ class ContentProxyTest extends TestCase
)); ));
$graby = $this->getMockBuilder(Graby::class) $graby = $this->getMockBuilder(Graby::class)
->setMethods(['fetchContent']) ->onlyMethods(['fetchContent'])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -649,7 +649,7 @@ class ContentProxyTest extends TestCase
$ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock(); $ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock();
$graby = $this->getMockBuilder(Graby::class) $graby = $this->getMockBuilder(Graby::class)
->setMethods(['fetchContent']) ->onlyMethods(['fetchContent'])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -693,7 +693,7 @@ class ContentProxyTest extends TestCase
$ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock(); $ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock();
$graby = $this->getMockBuilder(Graby::class) $graby = $this->getMockBuilder(Graby::class)
->setMethods(['fetchContent']) ->onlyMethods(['fetchContent'])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -732,7 +732,7 @@ class ContentProxyTest extends TestCase
$ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock(); $ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock();
$graby = $this->getMockBuilder(Graby::class) $graby = $this->getMockBuilder(Graby::class)
->setMethods(['fetchContent']) ->onlyMethods(['fetchContent'])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -770,7 +770,7 @@ class ContentProxyTest extends TestCase
$ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock(); $ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock();
$graby = $this->getMockBuilder(Graby::class) $graby = $this->getMockBuilder(Graby::class)
->setMethods(['fetchContent']) ->onlyMethods(['fetchContent'])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -808,7 +808,7 @@ class ContentProxyTest extends TestCase
$ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock(); $ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock();
$graby = $this->getMockBuilder(Graby::class) $graby = $this->getMockBuilder(Graby::class)
->setMethods(['fetchContent']) ->onlyMethods(['fetchContent'])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -846,7 +846,7 @@ class ContentProxyTest extends TestCase
$ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock(); $ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock();
$graby = $this->getMockBuilder(Graby::class) $graby = $this->getMockBuilder(Graby::class)
->setMethods(['fetchContent']) ->onlyMethods(['fetchContent'])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -895,7 +895,7 @@ class ContentProxyTest extends TestCase
$ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock(); $ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock();
$graby = $this->getMockBuilder(Graby::class) $graby = $this->getMockBuilder(Graby::class)
->setMethods(['fetchContent']) ->onlyMethods(['fetchContent'])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -1103,7 +1103,7 @@ class ContentProxyTest extends TestCase
private function getTaggerMock() private function getTaggerMock()
{ {
return $this->getMockBuilder(RuleBasedTagger::class) return $this->getMockBuilder(RuleBasedTagger::class)
->setMethods(['tag']) ->onlyMethods(['tag'])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
} }
@ -1111,7 +1111,7 @@ class ContentProxyTest extends TestCase
private function getRuleBasedIgnoreOriginProcessorMock() private function getRuleBasedIgnoreOriginProcessorMock()
{ {
return $this->getMockBuilder(RuleBasedIgnoreOriginProcessor::class) return $this->getMockBuilder(RuleBasedIgnoreOriginProcessor::class)
->setMethods(['process']) ->onlyMethods(['process'])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
} }
@ -1124,7 +1124,7 @@ class ContentProxyTest extends TestCase
private function getValidator($withDefaultMock = true) private function getValidator($withDefaultMock = true)
{ {
$mock = $this->getMockBuilder(RecursiveValidator::class) $mock = $this->getMockBuilder(RecursiveValidator::class)
->setMethods(['validate']) ->onlyMethods(['validate'])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();