You are here

protected function SimplenewsSubscribeTest::countSubscribers in Simplenews 3.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/SimplenewsSubscribeTest.php \Drupal\Tests\simplenews\Functional\SimplenewsSubscribeTest::countSubscribers()

Gets the number of subscribers entities.

2 calls to SimplenewsSubscribeTest::countSubscribers()
SimplenewsSubscribeTest::testDuplicate in tests/src/Functional/SimplenewsSubscribeTest.php
Tests protection against duplicate subscribers.
SimplenewsSubscribeTest::testSubscribeAuthenticated in tests/src/Functional/SimplenewsSubscribeTest.php
TestSubscribeAuthenticated.

File

tests/src/Functional/SimplenewsSubscribeTest.php, line 793

Class

SimplenewsSubscribeTest
Un/subscription of anonymous and authenticated users.

Namespace

Drupal\Tests\simplenews\Functional

Code

protected function countSubscribers() {
  return \Drupal::entityQuery('simplenews_subscriber')
    ->count()
    ->execute();
}