public function ViewTest::testCalculateDependencies in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php \Drupal\Tests\views\Unit\Plugin\area\ViewTest::testCalculateDependencies()
@covers ::calculateDependencies
File
- core/
modules/ views/ tests/ src/ Unit/ Plugin/ area/ ViewTest.php, line 48 - Contains \Drupal\Tests\views\Unit\Plugin\area\ViewTest.
Class
- ViewTest
- @coversDefaultClass \Drupal\views\Plugin\views\area\View @group views
Namespace
Drupal\Tests\views\Unit\Plugin\areaCode
public function testCalculateDependencies() {
/* @var $view_this \Drupal\views\Entity\View */
/* @var $view_other \Drupal\views\Entity\View */
$view_this = $this
->getMock('Drupal\\views\\ViewEntityInterface');
$view_this
->expects($this
->any())
->method('getConfigDependencyKey')
->willReturn('config');
$view_this
->expects($this
->any())
->method('getConfigDependencyName')
->willReturn('view.this');
$view_this
->expects($this
->any())
->method('id')
->willReturn('this');
$view_other = $this
->getMock('Drupal\\views\\ViewEntityInterface');
$view_other
->expects($this
->any())
->method('getConfigDependencyKey')
->willReturn('config');
$view_other
->expects($this
->any())
->method('getConfigDependencyName')
->willReturn('view.other');
$this->entityStorage
->expects($this
->any())
->method('load')
->willReturnMap([
[
'this',
$view_this,
],
[
'other',
$view_other,
],
]);
$this->viewHandler->view->storage = $view_this;
$this->viewHandler->options['view_to_insert'] = 'other:default';
$this
->assertArrayEquals(array(
'config' => array(
'view.other',
),
), $this->viewHandler
->calculateDependencies());
$this->viewHandler->options['view_to_insert'] = 'this:default';
$this
->assertArrayEquals(array(), $this->viewHandler
->calculateDependencies());
}