InlineBlockUsageTest.php

Same filename in this branch
  1. 11.x core/modules/layout_builder/tests/src/Kernel/InlineBlockUsageTest.php
Same filename in other branches
  1. 9 core/modules/layout_builder/tests/src/Unit/InlineBlockUsageTest.php
  2. 8.9.x core/modules/layout_builder/tests/src/Unit/InlineBlockUsageTest.php
  3. 10 core/modules/layout_builder/tests/src/Unit/InlineBlockUsageTest.php
  4. 10 core/modules/layout_builder/tests/src/Kernel/InlineBlockUsageTest.php

Namespace

Drupal\Tests\layout_builder\Unit

File

core/modules/layout_builder/tests/src/Unit/InlineBlockUsageTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\layout_builder\Unit;

use Drupal\Core\Database\Connection;
use Drupal\layout_builder\InlineBlockUsage;
use Drupal\Tests\UnitTestCase;

/**
 * @coversDefaultClass \Drupal\layout_builder\InlineBlockUsage
 *
 * @group layout_builder
 */
class InlineBlockUsageTest extends UnitTestCase {
    
    /**
     * Tests calling deleteUsage() with empty array.
     *
     * @covers ::deleteUsage
     */
    public function testEmptyDeleteUsageCall() : void {
        $connection = $this->prophesize(Connection::class);
        $connection->delete('inline_block_usage')
            ->shouldNotBeCalled();
        (new InlineBlockUsage($connection->reveal()))
            ->deleteUsage([]);
    }

}

Classes

Title Deprecated Summary
InlineBlockUsageTest @coversDefaultClass \Drupal\layout_builder\InlineBlockUsage

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