You are here

public function EntityCollectorTest::testCollect in Simple OAuth (OAuth2) & OpenID Connect 5.x

Same name and namespace in other branches
  1. 8.4 tests/src/Unit/EntityCollectorTest.php \Drupal\Tests\simple_oauth\Unit\EntityCollectorTest::testCollect()
  2. 8.2 tests/src/Unit/EntityCollectorTest.php \Drupal\Tests\simple_oauth\Unit\EntityCollectorTest::testCollect()
  3. 8.3 tests/src/Unit/EntityCollectorTest.php \Drupal\Tests\simple_oauth\Unit\EntityCollectorTest::testCollect()

@covers ::collect

File

tests/src/Unit/EntityCollectorTest.php, line 24

Class

EntityCollectorTest
@coversDefaultClass \Drupal\simple_oauth\ExpiredCollector @group simple_oauth

Namespace

Drupal\Tests\simple_oauth\Unit

Code

public function testCollect() {
  list($expired_collector, $query, ) = $this
    ->buildProphecies();
  $query
    ->condition('expire', 42, '<')
    ->shouldBeCalledTimes(1);
  $this
    ->assertArrayEquals([
    1,
    52,
  ], array_map(function ($entity) {
    return $entity
      ->id();
  }, $expired_collector
    ->collect()));
}