Skip to content

Commit

Permalink
adding tests for getting a single module
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Jun 22, 2012
1 parent bc9a10c commit 7959b88
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions Core/Modules/Test/Case/Model/ModuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ public function testGetModulesList($data, $expected) {
$this->assertEquals($expected, $result);
}

/**
* @brief test getting module data
*
* @dataProvider getModuleData
*/
public function testGetModule($data, $expected) {
$result = $this->Module->getModule($data['module'], $data['admin']);
$this->assertEquals($expected, $result);
}

/**
* validationFailData data provider
*
Expand Down Expand Up @@ -226,4 +236,43 @@ public function moduleListData() {
'admin/quick_view' => 'Quick View'),
'user' => array())));
}

/**
* getModuleData data provider
*
* @return void
*/
public function getModuleData() {
return array(
array(
array('module' => 'foo-bar', 'admin' => false), false),
array(
array('module' => 'foo-bar', 'admin' => true), false),
array(
array('module' => 'login', 'admin' => false),
array(
'Module' => array(
'id' => 'module-login',
'name' => 'login',
'plugin' => 'Management',
'content' => '',
'module' => 'login',
'config' => '',
'show_heading' => false,
),
'ModuleRoute' => array(
array(
'ModuleRoute' =>
array(
'id' => '65',
'module_id' => 'module-login',
'route_id' => '0'),
'Route' => array(
'id' => NULL,
'url' => NULL,
'name' => NULL))))),
array(
array('module' => 'login', 'admin' => true), false),
);
}
}

0 comments on commit 7959b88

Please sign in to comment.