testSystemConfigurations.php
2.59 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?php
require_once (KT_DIR . '/tests/test.php');
require_once (KT_DIR . '/setup/wizard/installUtil.php');
require_once (KT_DIR . '/setup/wizard/step.php');
require_once (KT_DIR . '/setup/wizard/steps/configuration.php');
/**
* These are the unit tests for the KT environment
*
* This test can be run at any time to ensure the environment meets the requirements
* to properly run knowledgetree e.g. http://localhost/tests/env.php
*
*/
class EnvPhpSystemTestCase extends KTUnitTestCase {
/**
* @var oConfig
*/
var $oConfig;
/**
* @var memoryLimit
*/
var $arrServerInfo;
/**
* Setup the php configs to initialize the system checks.
*
*/
function setUp() {
$this->oConfig = new configuration();
$this->arrServerInfo = $this->oConfig->getServerInfo();
$this->arrPathInfo = $this->oConfig->getPathInfo($this->arrServerInfo['file_system_root']['value'], false);
}
/**
* Cleaning up
*/
function tearDown() {
$this->oConfig = null;
}
/**
* Testing configFile
*/
function testConfigFile() {
$key = 'configFile';
$fileValid = (file_exists($this->arrPathInfo[$key]['path']));
$this->assertTrue($fileValid, 'Config file : [' . $this->arrPathInfo[$key]['path'] . '] could not be found.');
}
/**
* Testing documentRoot
*/
function testDocumentRoot() {
$key = 'documentRoot';
$this->assertEqual($this->arrPathInfo[$key]['class'], 'tick', $this->arrPathInfo[$key]['msg']);
}
/**
* Testing logDirectory
*/
function testLogDirectory() {
$key = 'logDirectory';
$this->assertEqual($this->arrPathInfo[$key]['class'], 'tick', $this->arrPathInfo[$key]['msg']);
}
/**
* Testing tmpDirectory
*/
function testTmpDirectory() {
$key = 'tmpDirectory';
$this->assertEqual($this->arrPathInfo[$key]['class'], 'tick', $this->arrPathInfo[$key]['msg']);
}
/**
* Testing cacheDirectory
*/
function testCacheDirectory() {
$key = 'cacheDirectory';
$this->assertEqual($this->arrPathInfo[$key]['class'], 'tick', $this->arrPathInfo[$key]['msg']);
}
/**
* Testing uploadDirectory
*/
function testUploadDirectory() {
$key = 'uploadDirectory';
$this->assertEqual($this->arrPathInfo[$key]['class'], 'tick', $this->arrPathInfo[$key]['msg']);
}
/**
* Testing varDirectory
*/
function testvarDirectory() {
$key = 'varDirectory';
$this->assertEqual($this->arrPathInfo[$key]['class'], 'tick', $this->arrPathInfo[$key]['msg']);
}
}
?>