-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathunittests.php
37 lines (29 loc) · 1.28 KB
/
unittests.php
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
<?php
require_once('core/Main.php');
if (!$userSystem->isLoggedIn()) {
$log->info('unittests.php', 'User was not logged in');
$redirect->redirectTo('login.php');
}
if ($currentUser->getRole() != Constants::USER_ROLES['admin']) {
$log->error('unittests.php', 'User was not admin');
$redirect->redirectTo('lectures.php');
}
echo $header->getHeader($i18n->get('title'), $i18n->get('unitTests'), array('protocols.css', 'button.css', 'searchableTable.css'));
echo $mainMenu->getMainMenu($i18n, $currentUser);
echo '<div id="unittestsTable" style="padding-left: 40px; padding-bottom: 40px; padding-right: 40px; margin: 0px;">';
$headers = array($i18n->get('unitTests'), $i18n->get('status'));
$widths = array(80, 20);
$textAlignments = array('left', 'center');
$data = array();
$unitTestsNames = $testUtil->getTestNames();
$unitTestsResults = $testUtil->runAllTests();
for ($i = 0; $i < count($unitTestsNames); $i++) {
$row = array();
$row[] = $unitTestsNames[$i];
$row[] = $unitTestsResults[$i];
$data[] = $row;
}
echo $searchableTable->createTable($headers, $data, $widths, $textAlignments);
echo '</div>';
echo $footer->getFooter();
?>