You are here

protected function OperationsProviderTestTrait::assertOperationsLinks in Plugin 8.2

Checks the integrity of operations links.

Parameters

mixed[] $operations_links:

1 call to OperationsProviderTestTrait::assertOperationsLinks()
DefaultPluginTypeOperationsProviderTest::testGetOperations in tests/src/Unit/PluginType/DefaultPluginTypeOperationsProviderTest.php
@covers ::getOperations

File

tests/src/Unit/OperationsProviderTestTrait.php, line 16

Class

OperationsProviderTestTrait
Provides assertions to test operations links integrity.

Namespace

Drupal\Tests\plugin\Unit

Code

protected function assertOperationsLinks(array $operations_links) {
  foreach ($operations_links as $link) {
    \PHPUnit\Framework\Assert::assertArrayHasKey('title', $link);
    \PHPUnit\Framework\Assert::assertNotEmpty($link['title']);
    \PHPUnit\Framework\Assert::assertArrayHasKey('url', $link);
    \PHPUnit\Framework\Assert::assertInstanceOf(Url::class, $link['url']);
  }
}