function DrupalTest::testQueue

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/DrupalTest.php \Drupal\Tests\Core\DrupalTest::testQueue()
  2. 10 core/tests/Drupal/Tests/Core/DrupalTest.php \Drupal\Tests\Core\DrupalTest::testQueue()
  3. 11.x 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)
        ->willReturn(TRUE);
    $this->setMockContainerService('queue', $queue);
    $this->assertNotNull(\Drupal::queue('test_queue', TRUE));
}

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