function ViewExecutableFactoryTest::testGet
Tests the get method.
@covers ::get
      
    
File
- 
              core/
modules/ views/ tests/ src/ Unit/ ViewExecutableFactoryTest.php, line 91  
Class
- ViewExecutableFactoryTest
 - @coversDefaultClass \Drupal\views\ViewExecutableFactory[[api-linebreak]] @group views
 
Namespace
Drupal\Tests\views\UnitCode
public function testGet() : void {
  $request_1 = new Request();
  $request_2 = new Request();
  $this->requestStack
    ->push($request_1);
  $executable = $this->viewExecutableFactory
    ->get($this->view);
  $this->assertInstanceOf('Drupal\\views\\ViewExecutable', $executable);
  $this->assertSame($executable->getRequest(), $request_1);
  $this->assertSame($executable->getUser(), $this->user);
  // Call get() again to ensure a new executable is created with the other
  // request object.
  $this->requestStack
    ->push($request_2);
  $executable = $this->viewExecutableFactory
    ->get($this->view);
  $this->assertInstanceOf('Drupal\\views\\ViewExecutable', $executable);
  $this->assertSame($executable->getRequest(), $request_2);
  $this->assertSame($executable->getUser(), $this->user);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.