You are here

protected function ViewsXmlBackendTestBase::getMockedView in Views XML Backend 8

13 calls to ViewsXmlBackendTestBase::getMockedView()
DateTest::testRenderItem in tests/src/Unit/Plugin/views/sort/DateTest.php
@covers ::query
DateTest::testRenderItem in tests/src/Unit/Plugin/views/field/DateTest.php
@covers ::render_item
MarkupTest::testRenderItem in tests/src/Unit/Plugin/views/field/MarkupTest.php
@covers ::render_item
NumericTest::testRenderItem in tests/src/Unit/Plugin/views/filter/NumericTest.php
@covers ::__toString
NumericTest::testRenderItem in tests/src/Unit/Plugin/views/sort/NumericTest.php
@covers ::query

... See full list

File

tests/src/Unit/ViewsXmlBackendTestBase.php, line 35
Contains \Drupal\Tests\views_xml_backend\Unit\ViewsXmlBackendTestBase.

Class

ViewsXmlBackendTestBase
Base testing class.

Namespace

Drupal\Tests\views_xml_backend\Unit

Code

protected function getMockedView() {
  if (isset($this->view)) {
    return $this->view
      ->reveal();
  }
  $this->view = $this
    ->prophesize(ViewExecutable::class);
  $this->view->display_handler = $this
    ->getMockedDisplay();
  $this->view
    ->getDisplay()
    ->willReturn($this
    ->getMockedDisplay());
  $this->view
    ->initPager()
    ->willReturn(TRUE);
  $this->view
    ->getStyle()
    ->willReturn(new DefaultStyle([], '', []));
  $this->view->pager = new None([], '', []);
  $this->view->field = [];
  return $this->view
    ->reveal();
}