QueueExceptionsTest.php

Same filename and directory in other branches
  1. 10 core/tests/Drupal/Tests/Core/Queue/QueueExceptionsTest.php
  2. 11.x core/tests/Drupal/Tests/Core/Queue/QueueExceptionsTest.php

Namespace

Drupal\Tests\Core\Queue

File

core/tests/Drupal/Tests/Core/Queue/QueueExceptionsTest.php

View source
<?php

namespace Drupal\Tests\Core\Queue;

use Drupal\Core\Queue\DelayedRequeueException;
use Drupal\Tests\UnitTestCase;

/**
 * Tests queue exceptions.
 *
 * @group Queue
 */
class QueueExceptionsTest extends UnitTestCase {
    
    /**
     * Tests that the `DelayedRequeueException` calls parent constructor.
     */
    public function testDelayedRequeueExceptionCallsParentConstructor() : void {
        $without_previous = new DelayedRequeueException(50, 'Delay the processing.');
        static::assertSame(50, $without_previous->getDelay());
        static::assertSame('Delay the processing.', $without_previous->getMessage());
        static::assertSame(0, $without_previous->getCode());
        static::assertNull($without_previous->getPrevious());
        $with_previous = new DelayedRequeueException(100, 'Increase the delay.', 200, $without_previous);
        static::assertSame(100, $with_previous->getDelay());
        static::assertSame('Increase the delay.', $with_previous->getMessage());
        static::assertSame(200, $with_previous->getCode());
        static::assertSame($without_previous, $with_previous->getPrevious());
    }

}

Classes

Title Deprecated Summary
QueueExceptionsTest Tests queue exceptions.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.