public function EntityCollectorTest::testCollectForClient in Simple OAuth (OAuth2) & OpenID Connect 8.4
Same name and namespace in other branches
- 8.2 tests/src/Unit/EntityCollectorTest.php \Drupal\Tests\simple_oauth\Unit\EntityCollectorTest::testCollectForClient()
- 8.3 tests/src/Unit/EntityCollectorTest.php \Drupal\Tests\simple_oauth\Unit\EntityCollectorTest::testCollectForClient()
- 5.x tests/src/Unit/EntityCollectorTest.php \Drupal\Tests\simple_oauth\Unit\EntityCollectorTest::testCollectForClient()
@covers ::collectForClient
File
- tests/
src/ Unit/ EntityCollectorTest.php, line 35
Class
- EntityCollectorTest
- @coversDefaultClass \Drupal\simple_oauth\ExpiredCollector @group simple_oauth
Namespace
Drupal\Tests\simple_oauth\UnitCode
public function testCollectForClient() {
list($expired_collector, $query, ) = $this
->buildProphecies();
$client = $this
->prophesize(Consumer::class);
$client
->id()
->willReturn(35);
$query
->condition('client', 35)
->shouldBeCalledTimes(1);
$tokens = $expired_collector
->collectForClient($client
->reveal());
$this
->assertArrayEquals([
1,
52,
], array_map(function ($entity) {
return $entity
->id();
}, $tokens));
}