本文整理汇总了PHP中Drupal\views\Tests\ViewTestData::dataSet方法的典型用法代码示例。如果您正苦于以下问题:PHP ViewTestData::dataSet方法的具体用法?PHP ViewTestData::dataSet怎么用?PHP ViewTestData::dataSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\views\Tests\ViewTestData
的用法示例。
在下文中一共展示了ViewTestData::dataSet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
/**
* {@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: dataSet
/**
* Returns a very simple test dataset.
*/
protected function dataSet()
{
return ViewTestData::dataSet();
}