本文整理汇总了PHP中MenuItem::getDatasets方法的典型用法代码示例。如果您正苦于以下问题:PHP MenuItem::getDatasets方法的具体用法?PHP MenuItem::getDatasets怎么用?PHP MenuItem::getDatasets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MenuItem
的用法示例。
在下文中一共展示了MenuItem::getDatasets方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testConstructor
/**
* Test constructor
*/
public function testConstructor()
{
$tab = new MenuItem('my_short_name', "Name of My Tab");
$this->assertEqual($tab->short_name, 'my_short_name');
$this->assertEqual($tab->name, 'Name of My Tab');
$this->assertEqual($tab->description, '');
$this->assertEqual($tab->view_template, 'inline.view.tpl');
$datasets = $tab->getDatasets();
$this->assertIsA($datasets, 'array');
$this->assertEqual(sizeof($datasets), 0);
}
示例2: testConstructor
/**
* Test constructor
*/
public function testConstructor()
{
$menu_item = new MenuItem("Name of My Menu Item");
$this->assertEqual($menu_item->name, 'Name of My Menu Item');
$this->assertEqual($menu_item->description, '');
$this->assertEqual($menu_item->view_template, 'inline.view.tpl');
$this->assertEqual($menu_item->parent, null);
$datasets = $menu_item->getDatasets();
$this->assertIsA($datasets, 'array');
$this->assertEqual(sizeof($datasets), 0);
$menu_item1 = new MenuItem("Name of My Menu Item 1", 'descriptive text', 'mytemplate.tpl', "my-parent");
$this->assertEqual($menu_item1->name, 'Name of My Menu Item 1');
$this->assertEqual($menu_item1->description, 'descriptive text');
$this->assertEqual($menu_item1->view_template, 'mytemplate.tpl');
$this->assertEqual($menu_item1->parent, "my-parent");
}