You are here

public function EntityAnalyzerSubscriberTest::testEntityPagerAnalyze in Entity Pager 2.0.x

Same name and namespace in other branches
  1. 8 tests/src/Unit/EntityAnalyzerSubscriberTest.php \Drupal\Tests\entity_pager\Unit\EntityAnalyzerSubscriberTest::testEntityPagerAnalyze()

@covers ::onEntityPagerAnalyze @dataProvider onEntityPagerAnalyzeTestCases

File

tests/src/Unit/EntityAnalyzerSubscriberTest.php, line 21

Class

EntityAnalyzerSubscriberTest
@coversDefaultClass \Drupal\entity_pager\EventSubscriber\EntityAnalyzerSubscriber @group entity_pager

Namespace

Drupal\Tests\entity_pager\Unit

Code

public function testEntityPagerAnalyze($entity, $logs) {
  $entity_pager = $this
    ->createMock(EntityPagerInterface::class);
  $entity_pager
    ->method('getEntity')
    ->willReturn($entity);
  $event = new EntityPagerAnalyzeEvent($entity_pager);
  (new EntityAnalyzerSubscriber())
    ->onEntityPagerAnalyze($event);
  $this
    ->assertEquals($logs, $event
    ->getLogs());
}