/**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     // Setup basic stuff like the view and the display.
     $config = array();
     $config['display']['default'] = array('id' => 'default', 'display_plugin' => 'default', 'display_title' => 'Default');
     $storage = new View($config, 'view');
     $user = $this->getMock('Drupal\\Core\\Session\\AccountInterface');
     $this->view = $this->getMock('Drupal\\views\\ViewExecutable', NULL, array($storage, $user));
     $this->display = $this->getMockBuilder('Drupal\\views\\Plugin\\views\\display\\DisplayPluginBase')->disableOriginalConstructor()->getMock();
     $this->pager = $this->getMockBuilder('Drupal\\views\\Plugin\\views\\pager\\Full')->disableOriginalConstructor()->setMethods(NULL)->getMock();
     $this->view->display_handler = $this->display;
     $this->view->pager = $this->pager;
     foreach (ViewTestData::dataSet() as $index => $set) {
         $this->testData[] = new ResultRow($set + ['index' => $index]);
     }
     $this->definition = array('title' => 'counter field', 'plugin_type' => 'field');
 }
Пример #2
0
 /**
  * Returns a very simple test dataset.
  */
 protected function dataSet()
 {
     return ViewTestData::dataSet();
 }