function ResultTest::setUp

Same name and namespace in other branches
  1. 8.9.x core/modules/views/tests/src/Unit/Plugin/area/ResultTest.php \Drupal\Tests\views\Unit\Plugin\area\ResultTest::setUp()
  2. 10 core/modules/views/tests/src/Unit/Plugin/area/ResultTest.php \Drupal\Tests\views\Unit\Plugin\area\ResultTest::setUp()
  3. 11.x core/modules/views/tests/src/Unit/Plugin/area/ResultTest.php \Drupal\Tests\views\Unit\Plugin\area\ResultTest::setUp()

Overrides UnitTestCase::setUp

File

core/modules/views/tests/src/Unit/Plugin/area/ResultTest.php, line 38

Class

ResultTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21views%21src%21Plugin%21views%21area%21Result.php/class/Result/9" title="Views area handler to display some configurable result summary." class="local">\Drupal\views\Plugin\views\area\Result</a> @group views

Namespace

Drupal\Tests\views\Unit\Plugin\area

Code

protected function setUp() : void {
    parent::setUp();
    $storage = $this->prophesize(View::class);
    $storage->label()
        ->willReturn('ResultTest');
    $storage->set(Argument::cetera())
        ->willReturn(NULL);
    $user = $this->prophesize(AccountInterface::class)
        ->reveal();
    $views_data = $this->prophesize(ViewsData::class)
        ->reveal();
    $route_provider = $this->prophesize(RouteProviderInterface::class)
        ->reveal();
    $this->view = new ViewExecutable($storage->reveal(), $user, $views_data, $route_provider);
    $this->resultHandler = new Result([], 'result', []);
    $this->resultHandler->view = $this->view;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.