Repository navigation
Expand file tree
/
Copy pathModuleHandlerTest.php
More file actions
60 lines (50 loc) · 1.71 KB
/
Copy pathModuleHandlerTest.php
File metadata and controls
60 lines (50 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
require_once(dirname(__FILE__).'/../init.php');
class ModuleHandlerTest extends MY_UnitTestCase
{
var $myclass='XoopsModuleHandler';
public function SetUp() {
}
public function test_100() {
$instance=new $this->myclass();
$this->assertInstanceOf($this->myclass,$instance);
$this->assertRegExp('/^.*modules$/',$instance->table);
$this->assertSame('XoopsModule',$instance->className);
$this->assertSame('mid',$instance->keyName);
$this->assertSame('dirname',$instance->identifierName);
}
public function test_120() {
$instance=new $this->myclass();
$value=$instance->getById();
$this->assertSame(false,$value);
}
public function test_140() {
$instance=new $this->myclass();
$value=$instance->getByDirname('.');
$this->assertSame(false,$value);
}
public function test_160() {
$instance=new $this->myclass();
$module=new XoopsModule();
$module->setDirty(true);
$value=$instance->insertModule($module);
$this->assertSame(false,$value);
}
public function test_180() {
$instance=new $this->myclass();
$module=new XoopsModule();
$instance->db->allowWebChanges=true;
$value=$instance->deleteModule($module);
$this->assertSame(true,$value);
}
public function test_200() {
$instance=new $this->myclass();
$value=$instance->getObjectsArray();
$this->assertTrue(is_array($value));
}
public function test_220() {
$instance=new $this->myclass();
$value=$instance->getNameList();
$this->assertTrue(is_array($value));
}
}