orangehrm /lib/models/time/TimeEventTest.php

Language PHP Lines 425
MD5 Hash be8d229808eb1a016e485a1ab4b40c6d Estimated Cost $6,886 (why?)
Repository https://bitbucket.org/wildanm/orangehrm View Raw File View Project SPDX
  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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
<?php
/**
 * OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures
 * all the essential functionalities required for any enterprise.
 * Copyright (C) 2006 OrangeHRM Inc., http://www.orangehrm.com
 *
 * OrangeHRM is free software; you can redistribute it and/or modify it under the terms of
 * the GNU General Public License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * OrangeHRM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program;
 * if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301, USA
 *
 */

// Call TimeEventTest::main() if this source file is executed directly.
if (!defined("PHPUnit_MAIN_METHOD")) {
    define("PHPUnit_MAIN_METHOD", "TimeEventTest::main");
}

require_once "PHPUnit/Framework/TestCase.php";
require_once "PHPUnit/Framework/TestSuite.php";

require_once "testConf.php";

require_once 'TimeEvent.php';

require_once ROOT_PATH."/lib/confs/Conf.php";
require_once ROOT_PATH."/lib/common/UniqueIDGenerator.php";

/**
 * Test class for TimeEvent.
 * Generated by PHPUnit_Util_Skeleton on 2007-03-20 at 11:24:22.
 */
class TimeEventTest extends PHPUnit_Framework_TestCase {
	public $classTimeEvent = null;
    public $connection = null;
    /**
     * Runs the test methods of this class.
     *
     * @access public
     * @static
     */
    public static function main() {
        require_once "PHPUnit/TextUI/TestRunner.php";

        $suite  = new PHPUnit_Framework_TestSuite("TimeEventTest");
        $result = PHPUnit_TextUI_TestRunner::run($suite);
    }

    /**
     * Sets up the fixture, for example, open a network connection.
     * This method is called before a test is executed.
     *
     * @access protected
     */
    protected function setUp() {
    	$this->classTimeEvent = new TimeEvent();

    	$conf = new Conf();

    	$this->connection = mysql_connect($conf->dbhost.":".$conf->dbport, $conf->dbuser, $conf->dbpass);
        $this->assertTrue(mysql_select_db($conf->dbname));

    	$this->_deleteTestData();
		$this->_runQuery("INSERT INTO `hs_hr_employee`(emp_number, emp_lastname, emp_firstname, emp_nick_name, coun_code) VALUES ('010', 'Arnold', 'Subasinghe', 'Arnold', 'AF')");

    	mysql_query("INSERT INTO `hs_hr_customer` (`customer_id`, `name`, `description`, `deleted`) ".
    				"VALUES (10, 'OrangeHRM', 'Implement OrangeHRM', 0)");
    	mysql_query("INSERT INTO `hs_hr_project` (`project_id`, `customer_id`, `name`, `description`, `deleted`) ".
    				"VALUES (10, 10, 'OrangeHRM', 'Implement OrangeHRM', 0)");
    	mysql_query("INSERT INTO `hs_hr_project_activity` (`activity_id`, `project_id`, `name`) VALUES (10, 10, 'Test');");

    	mysql_query("INSERT INTO `hs_hr_timesheet_submission_period` (`timesheet_period_id`, `name`, `frequency`, `period`, `start_day`, `end_day`, `description`) ".
    				"VALUES (10, 'Permanent', 7, 1, ".date('N').", ".date('N', time()+3600*24*6).", 'Testing')");
    	mysql_query("INSERT INTO `hs_hr_timesheet` (`timesheet_id`, `employee_id`, `timesheet_period_id`, `start_date`, `end_date`, `status`) ".
    				"VALUES (10, 10, 10, '".date('Y-m-d')."', '".date('Y-m-d', time()+3600*24*6)." 23:59:59', 0)");
		mysql_query("INSERT INTO `hs_hr_timesheet` (`timesheet_id`, `employee_id`, `timesheet_period_id`, `start_date`, `end_date`, `status`) ".
    				"VALUES (11, 10, 10, '".date('Y-m-d', time()+3600*24*7)."', '".date('Y-m-d', time()+3600*24*13)." 23:59:59', 0)");

		mysql_query("INSERT INTO `hs_hr_time_event` (`time_event_id`, `project_id`, `activity_id`, `employee_id`, `timesheet_id`, `start_time`, `end_time`, `reported_date`, `duration`, `description`) ".
    				"VALUES (10, 10, 10, 10, 10, '".date('Y-m-d 11:30')."', '".date('Y-m-d 11:30', time()+3600)."', '".date('Y-m-d')."', 60, 'Testing')");
    	mysql_query("INSERT INTO `hs_hr_time_event` (`time_event_id`, `project_id`, `activity_id`, `employee_id`, `timesheet_id`, `start_time`, `end_time`, `reported_date`, `duration`, `description`) ".
    				"VALUES (11, 10, 10, 10, 10, '".date('Y-m-d 13:00', time()+3600)."', '".date('Y-m-d 13:00', time()+3600*2)."', '".date('Y-m-d')."', 60, 'Testing1')");
		mysql_query("INSERT INTO `hs_hr_time_event` (`time_event_id`, `project_id`, `activity_id`, `employee_id`, `timesheet_id`, `start_time`, `end_time`, `reported_date`, `duration`, `description`) ".
    				"VALUES (12, 10, 10, 10, 10, '".date('Y-m-d 14:30', time()+3600*2)."', NULL, '".date('Y-m-d')."', NULL, 'Testing2')");
    	mysql_query("INSERT INTO `hs_hr_time_event` (`time_event_id`, `project_id`, `activity_id`, `employee_id`, `timesheet_id`, `start_time`, `end_time`, `reported_date`, `duration`, `description`) ".
    				"VALUES (13, 10, 10, 10, 11, '".date('Y-m-d H:i:s', time()+3600*3)."', '".date('Y-m-d H:i:s', time()+3600*4)."', '".date('Y-m-d')."', 60, 'Testing unfinished activities')");
    	$result = mysql_query("SELECT `duration` FROM `hs_hr_time_event` WHERE `timesheet_id` = 10");

		UniqueIDGenerator::getInstance()->resetIDs();
    }

    /**
     * Tears down the fixture, for example, close a network connection.
     * This method is called after a test is executed.
     *
     * @access protected
     */
    protected function tearDown() {
    	$this->_deleteTestData();
		UniqueIDGenerator::getInstance()->resetIDs();
    }

	/**
	 * Deletes test data created during test
	 */
	private function _deleteTestData() {
    	mysql_query("DELETE FROM `hs_hr_time_event` WHERE `time_event_id` IN (10, 11, 12, 13)", $this->connection);

    	mysql_query("DELETE FROM `hs_hr_timesheet` WHERE `timesheet_id` IN (10, 11, 12)", $this->connection);

    	mysql_query("DELETE FROM `hs_hr_timesheet_submission_period` WHERE `timesheet_period_id` = 10", $this->connection);

		mysql_query("DELETE FROM `hs_hr_project_activity` WHERE `activity_id` = 10", $this->connection);
    	mysql_query("DELETE FROM `hs_hr_project` WHERE `project_id` = 10", $this->connection);
    	mysql_query("DELETE FROM `hs_hr_customer` WHERE `customer_id` = 10", $this->connection);
    	mysql_query("DELETE FROM `hs_hr_employee` WHERE `emp_number` = 10", $this->connection);
    }

	/**
	 * Run given sql query
	 */
	private function _runQuery($sql) {
	    $this->assertTrue(mysql_query($sql), mysql_error());
	}


    public function testFetchTimeEvents() {
    	$eventObj = $this->classTimeEvent;

		$eventObj->setTimesheetId(50);

    	$res = $eventObj->fetchTimeEvents();

    	$this->assertEquals($res, false, "Returned non existing record");
    }

    public function testFetchTimeEvents2() {
    	$eventObj = $this->classTimeEvent;

		$eventObj->setTimesheetId(10);

    	$res = $eventObj->fetchTimeEvents();

		$expected[0] = array(10, 10, 10, 10, 10, date('Y-m-d 11:30'), date('Y-m-d 11:30', time()+3600), date('Y-m-d'), 60, 'Testing');
		$expected[1] = array(11, 10, 10, 10, 10, date('Y-m-d 13:00', time()+3600), date('Y-m-d 13:00', time()+3600*2), date('Y-m-d'), 60, 'Testing1');
		$expected[2] = array(12, 10, 10, 10, 10, date('Y-m-d 14:30', time()+3600*2), null, date('Y-m-d'), null, 'Testing2');

		$this->assertNotNull($res, "Returned nothing");

		$this->assertEquals(count($res), count($expected), "Didn't return the expected number of records");

		for ($i=0; $i<count($res); $i++) {
			$this->assertEquals($expected[$i][0], $res[$i]->getTimeEventId(), "Invalid time event id");
		 	$this->assertEquals($expected[$i][1], $res[$i]->getProjectId(), "Invalid project id");
		 	$this->assertEquals($expected[$i][2], $res[$i]->getActivityId(), "Invalid activity id");
		 	$this->assertEquals($expected[$i][3], $res[$i]->getEmployeeId(), "Invalid employee id");
		 	$this->assertEquals($expected[$i][4], $res[$i]->getTimesheetId(), "Invalid timesheet id");
		 	$this->assertEquals($expected[$i][5], $res[$i]->getStartTime(), "Invalid start time");
		 	$this->assertEquals($expected[$i][6], $res[$i]->getEndTime(), "Invalid end time");
		 	$this->assertEquals($expected[$i][7], $res[$i]->getReportedDate(), "Invalid reported date");
		 	$this->assertEquals($expected[$i][8], $res[$i]->getDuration(), "Invalid duration");
		 	$this->assertEquals($expected[$i][9], $res[$i]->getDescription(), "Invalid description");
		}
    }

    public function testFetchTimeEvents3() {
    	$eventObj = $this->classTimeEvent;

		$eventObj->setTimesheetId(10);

    	$res = $eventObj->fetchTimeEvents(true);

		$expected[0] = array(12, 10, 10, 10, 10, date('Y-m-d 14:30', time()+3600*2), null, date('Y-m-d'), null, 'Testing2');

		$this->assertNotNull($res, "Returned nothing");

		$this->assertEquals(count($res), count($expected), "Didn't return the expected number of records");

		for ($i=0; $i<count($res); $i++) {
			$this->assertEquals($expected[$i][0], $res[$i]->getTimeEventId(), "Invalid time event id");
		 	$this->assertEquals($expected[$i][1], $res[$i]->getProjectId(), "Invalid project id");
		 	$this->assertEquals($expected[$i][2], $res[$i]->getActivityId(), "Invalid activity id");
		 	$this->assertEquals($expected[$i][3], $res[$i]->getEmployeeId(), "Invalid employee id");
		 	$this->assertEquals($expected[$i][4], $res[$i]->getTimesheetId(), "Invalid timesheet id");
		 	$this->assertEquals($expected[$i][5], $res[$i]->getStartTime(), "Invalid start time");
		 	$this->assertEquals($expected[$i][6], $res[$i]->getEndTime(), "Invalid end time");
		 	$this->assertEquals($expected[$i][7], $res[$i]->getReportedDate(), "Invalid reported date");
		 	$this->assertEquals($expected[$i][8], $res[$i]->getDuration(), "Invalid duration");
		 	$this->assertEquals($expected[$i][9], $res[$i]->getDescription(), "Invalid description");
		}
    }

    public function testAddTimeEvent() {
    	mysql_query("DELETE FROM `hs_hr_time_event` WHERE `time_event_id` IN (12)", $this->connection);

		$eventObj = $this->classTimeEvent;

		$expected[0] = array(13, 10, 10, 10, 10, date('Y-m-d 01:22'), date('Y-m-d 03:42'), date('Y-m-d'), 90, "Testing2");

		$eventObj->setProjectId($expected[0][1]);
		$eventObj->setActivityId($expected[0][2]);
		$eventObj->setEmployeeId($expected[0][3]);
		$eventObj->setTimesheetId($expected[0][4]);
		$eventObj->setStartTime($expected[0][5]);
		$eventObj->setEndTime($expected[0][6]);
		$eventObj->setReportedDate($expected[0][7]);
		$eventObj->setDuration($expected[0][8]);
		$eventObj->setDescription($expected[0][9]);

		$res = $eventObj->addTimeEvent();

		$this->assertTrue($res, "Adding failed");

		$expected[0][0] = $eventObj->getTimeEventId();

		$res = $eventObj->fetchTimeEvents();

		$this->assertNotNull($res, "Returned nothing");

		$this->assertEquals(count($expected), count($res), "Didn't return the expected number of records");

		for ($i=0; $i<count($res); $i++) {
			$this->assertEquals($expected[$i][0], $res[$i]->getTimeEventId(), "Invalid time event id");
		 	$this->assertEquals($expected[$i][1], $res[$i]->getProjectId(), "Invalid project id");
		 	$this->assertEquals($expected[$i][2], $res[$i]->getActivityId(), "Invalid activity id");
		 	$this->assertEquals($expected[$i][3], $res[$i]->getEmployeeId(), "Invalid employee id");
		 	$this->assertEquals($expected[$i][4], $res[$i]->getTimesheetId(), "Invalid timesheet id");
		 	$this->assertEquals($expected[$i][5], $res[$i]->getStartTime(), "Invalid start time");
		 	$this->assertEquals($expected[$i][6], $res[$i]->getEndTime(), "Invalid end time");
		 	$this->assertEquals($expected[$i][7], $res[$i]->getReportedDate(), "Invalid reported date");
		 	$this->assertEquals($expected[$i][8], $res[$i]->getDuration(), "Invalid duration");
		 	$this->assertEquals($expected[$i][9], $res[$i]->getDescription(), "Invalid description");
		}
    }

    public function testEditTimeEvent() {
		$eventObj = $this->classTimeEvent;

		$expected[0] = array(11, 10, 10, 10, 10, date('Y-m-d 04:00', time()-3600), date('Y-m-d 04:00', time()-3600*0.5), date('Y-m-d'), 30, "Testing12");

		$eventObj->setTimeEventId($expected[0][0]);
		$eventObj->setProjectId($expected[0][1]);
		$eventObj->setActivityId($expected[0][2]);
		$eventObj->setEmployeeId($expected[0][3]);
		$eventObj->setTimesheetId($expected[0][4]);
		$eventObj->setStartTime($expected[0][5]);
		$eventObj->setEndTime($expected[0][6]);
		$eventObj->setReportedDate($expected[0][7]);
		$eventObj->setDuration($expected[0][8]);
		$eventObj->setDescription($expected[0][9]);

		$res = $eventObj->editTimeEvent();

		$this->assertTrue($res, "Editing failed");

		$res = $eventObj->fetchTimeEvents();

		$this->assertNotNull($res, "Returned nothing");

		$this->assertEquals(count($res), count($expected), "Didn't return the expected number of records");

		for ($i=0; $i<count($res); $i++) {
			$this->assertEquals($expected[$i][0], $res[$i]->getTimeEventId(), "Invalid time event id");
		 	$this->assertEquals($expected[$i][1], $res[$i]->getProjectId(), "Invalid project id");
		 	$this->assertEquals($expected[$i][2], $res[$i]->getActivityId(), "Invalid activity id");
		 	$this->assertEquals($expected[$i][3], $res[$i]->getEmployeeId(), "Invalid employee id");
		 	$this->assertEquals($expected[$i][4], $res[$i]->getTimesheetId(), "Invalid timesheet id");
		 	$this->assertEquals($expected[$i][5], $res[$i]->getStartTime(), "Invalid start time");
		 	$this->assertEquals($expected[$i][6], $res[$i]->getEndTime(), "Invalid end time");
		 	$this->assertEquals($expected[$i][7], $res[$i]->getReportedDate(), "Invalid reported date");
		 	$this->assertEquals($expected[$i][8], $res[$i]->getDuration(), "Invalid duration");
		 	$this->assertEquals($expected[$i][9], $res[$i]->getDescription(), "Invalid description");
		}
    }

    public function testPendingTimeEvents() {
		$eventObj = $this->classTimeEvent;

		$eventObj->setTimeEventId(11);

    	$res = $eventObj->pendingTimeEvents();

		$this->assertNull($res, "Returned completed time event");
    }

    public function testPendingTimeEvents2() {
    	$eventObj = $this->classTimeEvent;

		$eventObj->setTimeEventId(12);

    	$res = $eventObj->pendingTimeEvents();

		$expected[0] = array(12, 10, 10, 10, 10, date('Y-m-d 14:30', time()+3600*2), null, date('Y-m-d'), null, 'Testing2');

		$this->assertNotNull($res, "Returned nothing");

		$this->assertEquals(count($res), count($expected), "Didn't return the expected number of records");

		for ($i=0; $i<count($res); $i++) {
			$this->assertEquals($expected[$i][0], $res[$i]->getTimeEventId(), "Invalid time event id");
		 	$this->assertEquals($expected[$i][1], $res[$i]->getProjectId(), "Invalid project id");
		 	$this->assertEquals($expected[$i][2], $res[$i]->getActivityId(), "Invalid activity id");
		 	$this->assertEquals($expected[$i][3], $res[$i]->getEmployeeId(), "Invalid employee id");
		 	$this->assertEquals($expected[$i][4], $res[$i]->getTimesheetId(), "Invalid timesheet id");
		 	$this->assertEquals($expected[$i][5], $res[$i]->getStartTime(), "Invalid start time");
		 	$this->assertEquals($expected[$i][6], $res[$i]->getEndTime(), "Invalid end time");
		 	$this->assertEquals($expected[$i][7], $res[$i]->getReportedDate(), "Invalid reported date");
		 	$this->assertEquals($expected[$i][8], $res[$i]->getDuration(), "Invalid duration");
		 	$this->assertEquals($expected[$i][9], $res[$i]->getDescription(), "Invalid description");
		}
    }

	public function testPendingTimeEvents3() {

		$eventObj = $this->classTimeEvent;
		$res = $eventObj->pendingTimeEvents();
		$expected[0] = array(12, 10, 10, 10, 10, date('Y-m-d 14:30', time()+3600*2), null, date('Y-m-d'), null, 'Testing2');
		$this->assertNotNull($res, "Returned nothing when no id was specified");
		$this->assertEquals(count($res), count($expected), "Didn't return the expected number of records");

		for ($i=0; $i<count($res); $i++) {
			$this->assertEquals($expected[$i][0], $res[$i]->getTimeEventId(), "Invalid time event id");
			$this->assertEquals($expected[$i][1], $res[$i]->getProjectId(), "Invalid project id");
			$this->assertEquals($expected[$i][2], $res[$i]->getActivityId(), "Invalid activity id");
			$this->assertEquals($expected[$i][3], $res[$i]->getEmployeeId(), "Invalid employee id");
			$this->assertEquals($expected[$i][4], $res[$i]->getTimesheetId(), "Invalid timesheet id");
			$this->assertEquals($expected[$i][5], $res[$i]->getStartTime(), "Invalid start time");
			$this->assertEquals($expected[$i][6], $res[$i]->getEndTime(), "Invalid end time");
			$this->assertEquals($expected[$i][7], $res[$i]->getReportedDate(), "Invalid reported date");
			$this->assertEquals($expected[$i][8], $res[$i]->getDuration(), "Invalid duration");
			$this->assertEquals($expected[$i][9], $res[$i]->getDescription(), "Invalid description");
		}

	}

    public function testDeleteTimeEvent() {
    	$eventObj = $this->classTimeEvent;

    	$eventObj->setTimeEventId(10);

    	$res = $eventObj->deleteTimeEvent();

    	$this->assertTrue($res, "Deletion failed");

    	$res = $eventObj->fetchTimeEvents();

    	$this->assertNull($res, "Found deleted records");
    }

    public function testResolveTimesheet() {
    	$timesheetObj = new Timesheet();

    	$eventObj = $this->classTimeEvent;

    	$expected[0] = array(11, 10, 10, 10, 10, date('Y-m-d 13:00', time()+3600), date('Y-m-d 13:00', time()+3600*1.5), date('Y-m-d'), 30, "Testing12");

		$eventObj->setProjectId($expected[0][1]);
		$eventObj->setEmployeeId($expected[0][3]);
		$eventObj->setStartTime($expected[0][5]);
		$eventObj->setEndTime($expected[0][6]);

		$eventObj->resolveTimesheet(10);

		$this->assertNotNull($eventObj->getTimesheetId(), "Timesheet id was not resolved");
		$this->assertEquals($eventObj->getTimesheetId(), $expected[0][4], "Timesheet id is invalid");
    }

     public function testResolveTimesheet2() {
    	$eventObj = $this->classTimeEvent;

    	$expected[0] = array(11, 10, 10, 10, 12, date('Y-m-d 13:00', time()+3600*24*15), date('Y-m-d 13:00', (time()+3600*24*15)+1800)." 23:59:59", date('Y-m-d'), 30, "Testing12");

		$eventObj->setProjectId($expected[0][1]);
		$eventObj->setEmployeeId($expected[0][3]);
		$eventObj->setStartTime($expected[0][5]);
		$eventObj->setEndTime($expected[0][6]);

		$eventObj->resolveTimesheet(10);

		$this->assertNotNull($eventObj->getTimesheetId(), "Timesheet id was not resolved");
		$this->assertEquals($eventObj->getTimesheetId(), $expected[0][4], "Timesheet id is invalid");
    }

    public function testTimeReport() {
		$eventObj = $this->classTimeEvent;

    	$eventObj->setEmployeeId(10);

    	$res = $eventObj->timeReport(date('Y-m-d', time()+3600*24), date('Y-m-d', time()+3600*47));

    	$this->assertNull($res, "Empty report received");
    }

    public function testFetchTimeSheetIds(){
    	
    	$eventObj = $this->classTimeEvent;
    	$eventObj->setStartTime(date('Y-m-d'));
		$eventObj->setEndTime(date('Y-m-d', time()+3600*2));
		$employeeIds = array(10);
		$timsheetIds = $eventObj->fetchTimeSheetIds($employeeIds);
		$this->assertEquals($timsheetIds[0], 10 , "Employee id is wrong");
		$this->assertEquals($timsheetIds[1], 11 , "Employee id is wrong");
		
    }

    public function testIsUnfinishedTimesheet() {
		$this->assertTrue(TimeEvent::isUnfinishedTimesheet(10));
		$this->assertFalse(TimeEvent::isUnfinishedTimesheet(11));
    }

}

// Call TimeEventTest::main() if this source file is executed directly.
if (PHPUnit_MAIN_METHOD == "TimeEventTest::main") {
    TimeEventTest::main();
}
?>
Back to Top