Skip to content
Snippets Groups Projects
Commit 66a4c78b authored by catch's avatar catch
Browse files

Issue #3418178 by longwave: Remove withConsecutive() in CronQueueTest

parent 73bc225c
No related branches found
No related tags found
26 merge requests!8528Issue #3456871 by Tim Bozeman: Support NULL services,!3878Removed unused condition head title for views,!38582585169-10.1.x,!3818Issue #2140179: $entity->original gets stale between updates,!3742Issue #3328429: Create item list field formatter for displaying ordered and unordered lists,!3731Claro: role=button on status report items,!3668Resolve #3347842 "Deprecate the trusted",!3651Issue #3347736: Create new SDC component for Olivero (header-search),!3531Issue #3336994: StringFormatter always displays links to entity even if the user in context does not have access,!3355Issue #3209129: Scrolling problems when adding a block via layout builder,!3226Issue #2987537: Custom menu link entity type should not declare "bundle" entity key,!3154Fixes #2987987 - CSRF token validation broken on routes with optional parameters.,!3133core/modules/system/css/components/hidden.module.css,!2964Issue #2865710 : Dependencies from only one instance of a widget are used in display modes,!2812Issue #3312049: [Followup] Fix Drupal.Commenting.FunctionComment.MissingReturnType returns for NULL,!2378Issue #2875033: Optimize joins and table selection in SQL entity query implementation,!2334Issue #3228209: Add hasRole() method to AccountInterface,!2062Issue #3246454: Add weekly granularity to views date sort,!1105Issue #3025039: New non translatable field on translatable content throws error,!1073issue #3191727: Focus states on mobile second level navigation items fixed,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!877Issue #2708101: Default value for link text is not saved,!617Issue #3043725: Provide a Entity Handler for user cancelation,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493
Pipeline #86290 failed
Pipeline: drupal

#86292

    ...@@ -57,7 +57,7 @@ class CronQueueTest extends KernelTestBase { ...@@ -57,7 +57,7 @@ class CronQueueTest extends KernelTestBase {
    /** /**
    * A logger for testing. * A logger for testing.
    * *
    * @var \PHPUnit\Framework\MockObject\MockObject|\Psr\Log\LoggerInterface * @var \Prophecy\Prophecy\ObjectProphecy|\Psr\Log\LoggerInterface
    */ */
    protected $logger; protected $logger;
    ...@@ -66,7 +66,7 @@ class CronQueueTest extends KernelTestBase { ...@@ -66,7 +66,7 @@ class CronQueueTest extends KernelTestBase {
    */ */
    protected function setUp(): void { protected function setUp(): void {
    // Setup logger before register() is called. // Setup logger before register() is called.
    $this->logger = $this->createMock(LoggerInterface::class); $this->logger = $this->prophesize(LoggerInterface::class);
    parent::setUp(); parent::setUp();
    $this->connection = Database::getConnection(); $this->connection = Database::getConnection();
    ...@@ -173,23 +173,20 @@ public function testLeaseTime() { ...@@ -173,23 +173,20 @@ public function testLeaseTime() {
    * @see \Drupal\cron_queue_test\Plugin\QueueWorker\CronQueueTestException * @see \Drupal\cron_queue_test\Plugin\QueueWorker\CronQueueTestException
    */ */
    public function testUncaughtExceptions() { public function testUncaughtExceptions() {
    $this->logger->expects($this->atLeast(2)) $this->logger->log(
    ->method('log') RfcLogLevel::ERROR,
    ->withConsecutive( '%type: @message in %function (line %line of %file).',
    [ Argument::that(function ($args) {
    $this->equalTo(RfcLogLevel::ERROR), return $args['@message'] === 'That is not supposed to happen.'
    $this->equalTo('%type: @message in %function (line %line of %file).'), && $args['exception'] instanceof \Exception;
    $this->callback(function ($args) { })
    return $args['@message'] === 'That is not supposed to happen.' && )->shouldBeCalled();
    $args['exception'] instanceof \Exception;
    }), $this->logger->log(
    ], RfcLogLevel::INFO,
    [ 'Cron run completed.',
    $this->equalTo(RfcLogLevel::INFO), Argument::cetera()
    $this->equalTo('Cron run completed.'), )->shouldBeCalled();
    $this->anything(),
    ],
    );
    // Get the queue to test the normal Exception. // Get the queue to test the normal Exception.
    $queue = $this->container->get('queue')->get(CronQueueTestException::PLUGIN_ID); $queue = $this->container->get('queue')->get(CronQueueTestException::PLUGIN_ID);
    ...@@ -226,22 +223,19 @@ public function testUncaughtExceptions() { ...@@ -226,22 +223,19 @@ public function testUncaughtExceptions() {
    * @covers \Drupal\Core\Queue\SuspendQueueException * @covers \Drupal\Core\Queue\SuspendQueueException
    */ */
    public function testSuspendQueueException(): void { public function testSuspendQueueException(): void {
    $this->logger->expects($this->atLeast(2)) $this->logger->log(
    ->method('log') RfcLogLevel::DEBUG,
    ->withConsecutive( 'A worker for @queue queue suspended further processing of the queue.',
    [ Argument::that(function ($args) {
    $this->equalTo(RfcLogLevel::DEBUG), return $args['@queue'] === CronQueueTestSuspendQueue::PLUGIN_ID;
    $this->equalTo('A worker for @queue queue suspended further processing of the queue.'), })
    $this->callback(function ($args) { )->shouldBeCalled();
    return $args['@queue'] === CronQueueTestSuspendQueue::PLUGIN_ID;
    }), $this->logger->log(
    ], RfcLogLevel::INFO,
    [ 'Cron run completed.',
    $this->equalTo(RfcLogLevel::INFO), Argument::cetera()
    $this->equalTo('Cron run completed.'), )->shouldBeCalled();
    $this->anything(),
    ],
    );
    // Get the queue to test the specific SuspendQueueException. // Get the queue to test the specific SuspendQueueException.
    $queue = \Drupal::queue(CronQueueTestSuspendQueue::PLUGIN_ID); $queue = \Drupal::queue(CronQueueTestSuspendQueue::PLUGIN_ID);
    ...@@ -348,9 +342,9 @@ public function testQueueWorkerDeriver(): void { ...@@ -348,9 +342,9 @@ public function testQueueWorkerDeriver(): void {
    */ */
    public function register(ContainerBuilder $container) { public function register(ContainerBuilder $container) {
    parent::register($container); parent::register($container);
    $container->register('test_logger', get_class($this->logger)) $container->register('test_logger', get_class($this->logger->reveal()))
    ->addTag('logger'); ->addTag('logger');
    $container->set('test_logger', $this->logger); $container->set('test_logger', $this->logger->reveal());
    } }
    } }
    ...@@ -2298,11 +2298,6 @@ parameters: ...@@ -2298,11 +2298,6 @@ parameters:
    count: 2 count: 2
    path: modules/system/tests/src/Functional/Theme/ThemeUiTest.php path: modules/system/tests/src/Functional/Theme/ThemeUiTest.php
    -
    message: "#^Call to deprecated method withConsecutive\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\Builder\\\\InvocationMocker\\.$#"
    count: 2
    path: modules/system/tests/src/Kernel/System/CronQueueTest.php
    - -
    message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
    count: 1 count: 1
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment