You are here

protected function AjaxControllerTest::setUp in Sortableviews 8

Overrides UnitTestCase::setUp

File

tests/src/Unit/Controller/AjaxControllerTest.php, line 60

Class

AjaxControllerTest
@coversDefaultClass \Drupal\sortableviews\Controller\AjaxController @group sortableviews

Namespace

Drupal\Tests\sortableviews\Unit\Controller

Code

protected function setUp() {
  $this
    ->initializeContainer();
  $entity_storage = $this
    ->createMock('Drupal\\Core\\Entity\\EntityStorageInterface');
  $entity_storage
    ->expects($this
    ->any())
    ->method('loadMultiple')
    ->willReturn([]);
  $entity_manager = $this
    ->createMock('Drupal\\Core\\Entity\\EntityTypeManagerInterface');
  $entity_manager
    ->expects($this
    ->any())
    ->method('getStorage')
    ->with('some_type')
    ->willReturn($entity_storage);
  $this->ajaxController = new AjaxController($entity_manager);
  $class = new \ReflectionClass($this->ajaxController);
  $this->method = $class
    ->getMethod('retrieveOrderFromRequest');
  $this->method
    ->setAccessible(TRUE);
}