You are here

protected function EntityconnectTestBase::setEcButtons in Entity connect 8.2

Set the entity connect buttons state.

Parameters

bool $add: Whether add button should be on or off.

bool $edit: Whether edit button should be on or off.

Throws

\Drupal\Core\Entity\EntityStorageException

2 calls to EntityconnectTestBase::setEcButtons()
EntityconnectAddTest::setUp in tests/src/Functional/EntityconnectAddTest.php
EntityconnectEditTest::setUp in tests/src/Functional/EntityconnectEditTest.php

File

tests/src/Functional/EntityconnectTestBase.php, line 174

Class

EntityconnectTestBase
EntityConnect Test Base.

Namespace

Drupal\Tests\entityconnect\Functional

Code

protected function setEcButtons($add = TRUE, $edit = TRUE) {
  $this->testRefField
    ->setThirdPartySetting('entityconnect', 'buttons', [
    'button_add' => !$add,
    'button_edit' => !$edit,
  ]);
  if (empty($this->testRefField
    ->getThirdPartySettings('entityconnect')['icons'])) {
    $this->testRefField
      ->setThirdPartySetting('entityconnect', 'icons', [
      'icon_add' => 0,
      'icon_edit' => 0,
    ]);
  }
  $this->testRefField
    ->save();
}