You are here

public function DrupalTest::testQueue in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/DrupalTest.php \Drupal\Tests\Core\DrupalTest::testQueue()
  2. 9 core/tests/Drupal/Tests/Core/DrupalTest.php \Drupal\Tests\Core\DrupalTest::testQueue()

Tests the queue() method.

@covers ::queue

File

core/tests/Drupal/Tests/Core/DrupalTest.php, line 181

Class

DrupalTest
Tests the Drupal class.

Namespace

Drupal\Tests\Core

Code

public function testQueue() {
  $queue = $this
    ->getMockBuilder('Drupal\\Core\\Queue\\QueueFactory')
    ->disableOriginalConstructor()
    ->getMock();
  $queue
    ->expects($this
    ->once())
    ->method('get')
    ->with('test_queue', TRUE)
    ->will($this
    ->returnValue(TRUE));
  $this
    ->setMockContainerService('queue', $queue);
  $this
    ->assertNotNull(\Drupal::queue('test_queue', TRUE));
}