diff --git a/core/modules/views/tests/Drupal/views/Tests/Plugin/Block/ViewsBlockTest.php b/core/modules/views/tests/Drupal/views/Tests/Plugin/Block/ViewsBlockTest.php index 89e46aa..bcfd88b 100644 --- a/core/modules/views/tests/Drupal/views/Tests/Plugin/Block/ViewsBlockTest.php +++ b/core/modules/views/tests/Drupal/views/Tests/Plugin/Block/ViewsBlockTest.php @@ -54,6 +54,13 @@ class ViewsBlockTest extends UnitTestCase { */ protected $storageController; + /** + * The mocked user account. + * + * @var \Drupal\Core\Session\AccountInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $account; + public static function getInfo() { return array( 'name' => ' Block: Views block', @@ -101,6 +108,7 @@ protected function setUp() { ->method('load') ->with('test_view') ->will($this->returnValue($this->view)); + $this->account = $this->getMock('Drupal\Core\Session\AccountInterface'); } /** @@ -120,7 +128,7 @@ public function testBuild() { $config = array(); $definition = array(); $definition['module'] = 'views'; - $plugin = new ViewsBlock($config, $block_id, $definition, $this->executableFactory, $this->storageController); + $plugin = new ViewsBlock($config, $block_id, $definition, $this->executableFactory, $this->storageController, $this->account); $this->assertEquals($build, $plugin->build()); } @@ -141,7 +149,7 @@ public function testBuildFailed() { $config = array(); $definition = array(); $definition['module'] = 'views'; - $plugin = new ViewsBlock($config, $block_id, $definition, $this->executableFactory, $this->storageController); + $plugin = new ViewsBlock($config, $block_id, $definition, $this->executableFactory, $this->storageController, $this->account); $this->assertEquals(array(), $plugin->build()); }