You are here

public function OptOutTest::testOptOutDisabled in Mass Contact 8

Tests opt-out disabled.

@covers ::getOptOutAccounts

File

tests/src/Kernel/OptOutTest.php, line 109

Class

OptOutTest
Kernel tests for the opt-out service.

Namespace

Drupal\Tests\mass_contact\Kernel

Code

public function testOptOutDisabled() {

  // Disable opt out.
  $this
    ->config('mass_contact.settings')
    ->set('optout_enabled', MassContactInterface::OPT_OUT_DISABLED)
    ->save();

  /** @var \Drupal\mass_contact\OptOutInterface $opt_out */
  $opt_out = \Drupal::service('mass_contact.opt_out');
  $this
    ->assertEmpty($opt_out
    ->getOptOutAccounts($this->categories));
}