PageRenderTime 63ms CodeModel.GetById 34ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/models/benefits/HspPaymentRequestTest.php

https://bitbucket.org/wildanm/orangehrm
PHP | 431 lines | 308 code | 90 blank | 33 comment | 7 complexity | a789d68ce4e63afcaf3470254d75270d MD5 | raw file
Possible License(s): CC-BY-SA-3.0, AGPL-3.0, BSD-3-Clause, AGPL-1.0, GPL-2.0, LGPL-2.1, LGPL-3.0
  1. <?php
  2. // Call HspPaymentRequestTest::main() if this source file is executed directly.
  3. if (!defined("PHPUnit_MAIN_METHOD")) {
  4. define("PHPUnit_MAIN_METHOD", "HspPaymentRequestTest::main");
  5. }
  6. require_once "PHPUnit/Framework/TestCase.php";
  7. require_once "PHPUnit/Framework/TestSuite.php";
  8. require_once "testConf.php";
  9. require_once 'HspPaymentRequest.php';
  10. require_once ROOT_PATH."/lib/confs/Conf.php";
  11. require_once ROOT_PATH."/lib/common/UniqueIDGenerator.php";
  12. /**
  13. * Test class for HspPaymentRequest.
  14. * Generated by PHPUnit_Util_Skeleton on 2007-10-23 at 23:31:17.
  15. */
  16. class HspPaymentRequestTest extends PHPUnit_Framework_TestCase {
  17. private $paymentRequestFields;
  18. private $employeeFields;
  19. /**
  20. * Runs the test methods of this class.
  21. *
  22. * @access public
  23. * @static
  24. */
  25. public static function main() {
  26. require_once "PHPUnit/TextUI/TestRunner.php";
  27. $suite = new PHPUnit_Framework_TestSuite("HspPaymentRequestTest");
  28. $result = PHPUnit_TextUI_TestRunner::run($suite);
  29. }
  30. /**
  31. * Sets up the fixture, for example, open a network connection.
  32. * This method is called before a test is executed.
  33. *
  34. * @access protected
  35. */
  36. protected function setUp() {
  37. $this->paymentRequestFields = "`id`, `hsp_id`, `employee_id`, `date_incurred`, `provider_name`, `person_incurring_expense`, " .
  38. "`expense_description`, `expense_amount`, `payment_made_to`, `third_party_account_number`, `mail_address`, " .
  39. "`comments`, `date_paid`, `check_number`, `status`";
  40. $this->employeeFields = "`emp_number`, `employee_id`, `emp_lastname`, `emp_firstname`, `emp_middle_name`, `emp_nick_name`, " .
  41. "`emp_smoker`, `ethnic_race_code`, `emp_birthday`, `nation_code`, `emp_gender`, `emp_marital_status`, " .
  42. "`emp_ssn_num`, `emp_sin_num`, `emp_other_id`, `emp_dri_lice_num`, `emp_dri_lice_exp_date`, `emp_military_service`, " .
  43. "`emp_status`, `job_title_code`, `eeo_cat_code`, `work_station`, `emp_street1`, `emp_street2`, " .
  44. "`city_code`, `coun_code`, `provin_code`, `emp_zipcode`, `emp_hm_telephone`, `emp_mobile`, " .
  45. "`emp_work_telephone`, `emp_work_email`, `sal_grd_code`, `joined_date`, `emp_oth_email`";
  46. $conf = new Conf();
  47. $this->connection = mysql_connect($conf->dbhost.":".$conf->dbport, $conf->dbuser, $conf->dbpass);
  48. mysql_select_db($conf->dbname);
  49. $this->_deleteTables();
  50. $today = date('Y-m-d');
  51. $yesterday = date('Y-m-d', time()-3600*24);
  52. $this->_runQuery("INSERT INTO `hs_hr_employee`(emp_number, emp_lastname, emp_firstname) " .
  53. " VALUES (11, 'Arnold', 'Subasinghe')");
  54. $this->_runQuery("INSERT INTO `hs_hr_hsp` (`id`,`employee_id`,`hsp_value`,`total_acrued`, `amount_per_day`, " .
  55. "`termination_date`,`halted`,`halted_date`,`terminated`) " .
  56. "VALUES(10, 11, 1000, 500, 0, NULL, false, NULL, false)");
  57. $this->_runQuery("INSERT INTO `hs_hr_hsp_payment_request` ($this->paymentRequestFields) " .
  58. "VALUES (10, 10, 11, '$yesterday', 'Test provider', 'Tester', 'Just testing', '100', 'TestX', '12345GD', " .
  59. "'1231, Test Grove, Test City', 'Test', '$today', '123552-55821-ff25', 1)");
  60. $this->_runQuery("INSERT INTO `hs_hr_hsp_payment_request` ($this->paymentRequestFields) " .
  61. "VALUES (11, 10, 11, '$yesterday', 'Test provider 1', 'Tester 1', 'Just testing 1', '100', 'TestX 1', '12345GD', " .
  62. "'1231, Test Grove, Test City 1', 'Test 1', NULL, NULL, 0)");
  63. $this->_runQuery("INSERT INTO `hs_hr_hsp_payment_request` ($this->paymentRequestFields) " .
  64. "VALUES (12, 10, 11, '$yesterday', 'Test provider 2', 'Tester 2', 'Just testing 2', '100', 'TestX 2', '12345GD', " .
  65. "'1231, Test Grove, Test City 2', 'Test 2', NULL, NULL, 2)");
  66. $this->_runQuery("INSERT INTO `hs_hr_hsp_payment_request` ($this->paymentRequestFields) " .
  67. "VALUES (13, 10, 11, '$yesterday', 'Test provider 3', 'Tester 3', 'Just testing 3', '100', 'TestX 3', '12345GD', " .
  68. "'1231, Test Grove, Test City 3', 'Test 3', NULL, NULL, 3)");
  69. $this->_runQuery("INSERT INTO `hs_hr_emp_children` (`emp_number`, `ec_name`, `ec_seqno`) VALUES(11, 'saman', 1)");
  70. $this->_runQuery("INSERT INTO `hs_hr_emp_children` (`emp_number`, `ec_name`, `ec_seqno`) VALUES(11, 'saman2', 2)");
  71. $this->_runQuery("INSERT INTO `hs_hr_emp_dependents` (`emp_number`, `ed_name`, `ed_relationship`, `ed_seqno`) VALUES (11, 'kamal', 'Father', 1)");
  72. $this->_runQuery("INSERT INTO `hs_hr_emp_dependents` (`emp_number`, `ed_name`, `ed_relationship`, `ed_seqno`) VALUES (11, 'kasun', 'Father in low', 2)");
  73. $this->_runQuery("INSERT INTO `hs_hr_emp_dependents` (`emp_number`, `ed_name`, `ed_relationship`, `ed_seqno`) VALUES (11, 'kasun2', 'Father in low', 3)");
  74. UniqueIDGenerator::getInstance()->resetIDs();
  75. }
  76. /**
  77. * Tears down the fixture, for example, close a network connection.
  78. * This method is called after a test is executed.
  79. *
  80. * @access protected
  81. */
  82. protected function tearDown() {
  83. $this->_deleteTables();
  84. UniqueIDGenerator::getInstance()->resetIDs();
  85. }
  86. private function _deleteTables() {
  87. $this->_runQuery("TRUNCATE hs_hr_hsp_payment_request;");
  88. $this->_runQuery("DELETE FROM hs_hr_hsp WHERE `id` = '10'");
  89. $this->_runQuery("DELETE FROM hs_hr_employee WHERE `emp_number` = 11");
  90. $this->_runQuery("DELETE FROM hs_hr_emp_children WHERE `emp_number` = 11");
  91. $this->_runQuery("DELETE FROM hs_hr_emp_dependents WHERE `emp_number` = '11'");
  92. }
  93. private function _runQuery($sql) {
  94. $this->assertTrue(mysql_query($sql), mysql_error());
  95. }
  96. public function testGetHspRequest() {
  97. $paymentRequest = HspPaymentRequest::getHspRequest(50);
  98. $this->assertNull($paymentRequest);
  99. $expected = array(10, 10, 11,date('Y-m-d', time()-3600*24), 'Test provider', 'Tester', 'Just testing', '100', 'TestX', '12345GD',
  100. '1231, Test Grove, Test City', 'Test', date('Y-m-d'), '123552-55821-ff25', 1);
  101. $paymentRequest = HspPaymentRequest::getHspRequest(10);
  102. $this->assertNotNull($paymentRequest);
  103. $this->assertEquals($expected[0], $paymentRequest->getId());
  104. $this->assertEquals($expected[1], $paymentRequest->getHspId());
  105. $this->assertEquals($expected[2], $paymentRequest->getEmployeeId());
  106. $this->assertEquals($expected[3], $paymentRequest->getDateIncurred());
  107. $this->assertEquals($expected[4], $paymentRequest->getProviderName());
  108. $this->assertEquals($expected[5], $paymentRequest->getPersonIncurringExpense());
  109. $this->assertEquals($expected[6], $paymentRequest->getExpenseDescription());
  110. $this->assertEquals($expected[7], $paymentRequest->getExpenseAmount());
  111. $this->assertEquals($expected[8], $paymentRequest->getPaymentMadeTo());
  112. $this->assertEquals($expected[9], $paymentRequest->getThirdPartyAccountNumber());
  113. $this->assertEquals($expected[10], $paymentRequest->getMailAddress());
  114. $this->assertEquals($expected[11], $paymentRequest->getComments());
  115. $this->assertEquals($expected[12], $paymentRequest->getDatePaid());
  116. $this->assertEquals($expected[13], $paymentRequest->getCheckNumber());
  117. $this->assertEquals($expected[14], $paymentRequest->getStatus());
  118. }
  119. public function testListUnPaidHspRequests() {
  120. $expected[] = array(11, 10, 11, date('Y-m-d', time()-3600*24), 'Test provider 1', 'Tester 1', 'Just testing 1', '100', 'TestX 1', '12345GD',
  121. '1231, Test Grove, Test City 1', 'Test 1', null, null, 0);
  122. $paymentRequests = HspPaymentRequest::listUnPaidHspRequests();
  123. $this->assertNotNull($paymentRequests);
  124. for ($i=0; $i<count($paymentRequests); $i++) {
  125. $this->assertNotNull($paymentRequests[$i]);
  126. $this->assertEquals($expected[$i][0], $paymentRequests[$i]->getId());
  127. $this->assertEquals($expected[$i][1], $paymentRequests[$i]->getHspId());
  128. $this->assertEquals($expected[$i][2], $paymentRequests[$i]->getEmployeeId());
  129. $this->assertEquals($expected[$i][3], $paymentRequests[$i]->getDateIncurred());
  130. $this->assertEquals($expected[$i][4], $paymentRequests[$i]->getProviderName());
  131. $this->assertEquals($expected[$i][5], $paymentRequests[$i]->getPersonIncurringExpense());
  132. $this->assertEquals($expected[$i][6], $paymentRequests[$i]->getExpenseDescription());
  133. $this->assertEquals($expected[$i][7], $paymentRequests[$i]->getExpenseAmount());
  134. $this->assertEquals($expected[$i][8], $paymentRequests[$i]->getPaymentMadeTo());
  135. $this->assertEquals($expected[$i][9], $paymentRequests[$i]->getThirdPartyAccountNumber());
  136. $this->assertEquals($expected[$i][10], $paymentRequests[$i]->getMailAddress());
  137. $this->assertEquals($expected[$i][11], $paymentRequests[$i]->getComments());
  138. $this->assertEquals($expected[$i][12], $paymentRequests[$i]->getDatePaid());
  139. $this->assertEquals($expected[$i][13], $paymentRequests[$i]->getCheckNumber());
  140. $this->assertEquals($expected[$i][14], $paymentRequests[$i]->getStatus());
  141. }
  142. $this->assertTrue(mysql_query("DELETE FROM `hs_hr_hsp_payment_request` WHERE `id` IN (11);", $this->connection), mysql_error());
  143. UniqueIDGenerator::getInstance()->resetIDs();
  144. $paymentRequests = HspPaymentRequest::listUnPaidHspRequests();
  145. $this->assertNull($paymentRequests);
  146. }
  147. public function testListEmployeeHspRequests() {
  148. $expected[] = array(10, 10, 11, date('Y-m-d', time()-3600*24), 'Test provider', 'Tester', 'Just testing', '100', 'TestX', '12345GD',
  149. '1231, Test Grove, Test City', 'Test', date('Y-m-d'), '123552-55821-ff25', 1);
  150. $expected[] = array(11, 10, 11, date('Y-m-d', time()-3600*24), 'Test provider 1', 'Tester 1', 'Just testing 1', '100', 'TestX 1', '12345GD',
  151. '1231, Test Grove, Test City 1', 'Test 1', null, null, 0);
  152. $expected[] = array(12, 10, 11, date('Y-m-d', time()-3600*24), 'Test provider 2', 'Tester 2', 'Just testing 2', '100', 'TestX 2', '12345GD',
  153. '1231, Test Grove, Test City 2', 'Test 2', null, null, 2);
  154. $paymentRequests = HspPaymentRequest::listEmployeeHspRequests(date('Y'), 11);
  155. $this->assertNotNull($paymentRequests);
  156. for ($i=0; $i<count($paymentRequests); $i++) {
  157. $this->assertNotNull($paymentRequests[$i]);
  158. $this->assertEquals($expected[$i][0], $paymentRequests[$i]->getId());
  159. $this->assertEquals($expected[$i][1], $paymentRequests[$i]->getHspId());
  160. $this->assertEquals($expected[$i][2], $paymentRequests[$i]->getEmployeeId());
  161. $this->assertEquals($expected[$i][3], $paymentRequests[$i]->getDateIncurred());
  162. $this->assertEquals($expected[$i][4], $paymentRequests[$i]->getProviderName());
  163. $this->assertEquals($expected[$i][5], $paymentRequests[$i]->getPersonIncurringExpense());
  164. $this->assertEquals($expected[$i][6], $paymentRequests[$i]->getExpenseDescription());
  165. $this->assertEquals($expected[$i][7], $paymentRequests[$i]->getExpenseAmount());
  166. $this->assertEquals($expected[$i][8], $paymentRequests[$i]->getPaymentMadeTo());
  167. $this->assertEquals($expected[$i][9], $paymentRequests[$i]->getThirdPartyAccountNumber());
  168. $this->assertEquals($expected[$i][10], $paymentRequests[$i]->getMailAddress());
  169. $this->assertEquals($expected[$i][11], $paymentRequests[$i]->getComments());
  170. $this->assertEquals($expected[$i][12], $paymentRequests[$i]->getDatePaid());
  171. $this->assertEquals($expected[$i][13], $paymentRequests[$i]->getCheckNumber());
  172. $this->assertEquals($expected[$i][14], $paymentRequests[$i]->getStatus());
  173. }
  174. $paymentRequests = HspPaymentRequest::listEmployeeHspRequests(date('Y')+1, 11);
  175. $this->assertNull($paymentRequests);
  176. $this->assertTrue(mysql_query("DELETE FROM `hs_hr_hsp_payment_request` WHERE `id` IN (12);", $this->connection), mysql_error());
  177. try {
  178. $paymentRequests = HspPaymentRequest::listEmployeeHspRequests(date('Y'), 'Xd85');
  179. $this->fail('Exception not thrown');
  180. } catch (HspPaymentRequestException $e) {
  181. $this->assertEquals(HspPaymentRequestException::INVALID_EMPLOYEE_ID, $e->getCode(), 'Unexpected exception thrown');
  182. }
  183. }
  184. public function testPayHspRequest() {
  185. $paymentRequest = new HspPaymentRequest();
  186. $paymentRequest->setId(10);
  187. try {
  188. $paymentRequest->payHspRequest();
  189. $this->fail('Exception not thrown');
  190. } catch (HspPaymentRequestException $e) {
  191. $this->assertEquals(HspPaymentRequestException::ALREADY_PAID, $e->getCode(), 'Unexpected exception thrown');
  192. }
  193. $paymentRequest = new HspPaymentRequest();
  194. $paymentRequest->setId(11);
  195. $paymentRequest->setDatePaid(date('Y-m-d'));
  196. $paymentRequest->setCheckNumber('bsdfds-gfgbvbv-bfdtr');
  197. try {
  198. $paymentRequest->payHspRequest();
  199. $paymentRequest = HspPaymentRequest::getHspRequest(11);
  200. $this->assertNotNull($paymentRequest);
  201. $this->assertEquals(HspPaymentRequest::HSP_PAYMENT_REQUEST_STATUS_PAID, $paymentRequest->getStatus());
  202. } catch (HspPaymentRequestException $e) {
  203. $this->fail('Unexpected exception thrown');
  204. }
  205. }
  206. public function testDeleteHspRequest() {
  207. $paymentRequest = new HspPaymentRequest();
  208. $paymentRequest->setId(10);
  209. try {
  210. $paymentRequest->deleteHspRequest();
  211. $this->fail('Exception not thrown');
  212. } catch (HspPaymentRequestException $e) {
  213. $this->assertEquals(HspPaymentRequestException::ALREADY_PAID, $e->getCode(), 'Unexpected exception thrown');
  214. }
  215. $paymentRequest = new HspPaymentRequest();
  216. $paymentRequest->setId(11);
  217. try {
  218. $paymentRequest->deleteHspRequest();
  219. $paymentRequest = HspPaymentRequest::getHspRequest(11);
  220. $this->assertNotNull($paymentRequest);
  221. $this->assertEquals(HspPaymentRequest::HSP_PAYMENT_REQUEST_STATUS_DELETED, $paymentRequest->getStatus());
  222. } catch (HspPaymentRequestException $e) {
  223. $this->fail('Unexpected exception thrown');
  224. }
  225. }
  226. public function testDenyHspRequest() {
  227. $paymentRequest = new HspPaymentRequest();
  228. $paymentRequest->setId(10);
  229. try {
  230. $paymentRequest->denyHspRequest();
  231. $this->fail('Exception not thrown');
  232. } catch (HspPaymentRequestException $e) {
  233. $this->assertEquals(HspPaymentRequestException::ALREADY_PAID, $e->getCode(), 'Unexpected exception thrown');
  234. }
  235. $paymentRequest = new HspPaymentRequest();
  236. $paymentRequest->setId(11);
  237. try {
  238. $paymentRequest->denyHspRequest();
  239. $paymentRequest = HspPaymentRequest::getHspRequest(11);
  240. $this->assertNotNull($paymentRequest);
  241. $this->assertEquals(HspPaymentRequest::HSP_PAYMENT_REQUEST_STATUS_DENIED, $paymentRequest->getStatus());
  242. } catch (HspPaymentRequestException $e) {
  243. $this->fail('Unexpected exception thrown');
  244. }
  245. }
  246. public function testAddHspRequest() {
  247. $paymentRequest = new HspPaymentRequest();
  248. // Adding correct Data
  249. $paymentRequest->setHspId(0);
  250. $paymentRequest->setEmployeeId(11);
  251. $paymentRequest->setDateIncurred(date('Y-m-d', time()-3600*24));
  252. $paymentRequest->setProviderName('Jack');
  253. $paymentRequest->setPersonIncurringExpense('Bauer');
  254. $paymentRequest->setExpenseDescription('Health');
  255. $paymentRequest->setExpenseAmount(100);
  256. $paymentRequest->setPaymentMadeTo('Neena');
  257. $paymentRequest->setThirdPartyAccountNumber('123456');
  258. $paymentRequest->setMailAddress('');
  259. $paymentRequest->setComments('');
  260. //$paymentRequest->setDatePaid($expected[13]);
  261. //$paymentRequest->setCheckNumber($expected[14]);
  262. $paymentRequest->setStatus(1);
  263. $this->assertTrue($paymentRequest->addHspRequest());
  264. }
  265. /**
  266. *
  267. */
  268. public function testFetchDependants() {
  269. $hspPaymentRequest = new HspPaymentRequest();
  270. $empId = 11;
  271. $dependents = $hspPaymentRequest->fetchDependants($empId);
  272. $this->assertTrue(is_array($dependents));
  273. $this->assertEquals(3, count($dependents));
  274. $this->assertEquals("kamal", $dependents[0]);
  275. $this->assertEquals("kasun", $dependents[1]);
  276. $this->assertEquals("kasun2", $dependents[2]);
  277. $empId = 12;
  278. $dependents = $hspPaymentRequest->fetchDependants($empId);
  279. $this->assertFalse(isset($dependents));
  280. }
  281. /**
  282. *
  283. */
  284. public function testFetchChildren() {
  285. $hspPaymentRequest = new HspPaymentRequest();
  286. $empId = 11;
  287. $children = $hspPaymentRequest->fetchChildren($empId);
  288. $this->assertTrue(is_array($children));
  289. $this->assertEquals(2, count($children));
  290. $this->assertEquals("saman", $children[0]);
  291. $this->assertEquals("saman2", $children[1]);
  292. $empId = 12;
  293. $children = $hspPaymentRequest->fetchChildren($empId);
  294. $this->assertFalse(isset($children));
  295. }
  296. public function testIsDataChangedByAdmin() {
  297. $hspPaymentRequest = new HspPaymentRequest();
  298. $hspPaymentRequest->setDateIncurred(date('Y-m-d', time()-3600*24));
  299. $hspPaymentRequest->setProviderName('Test provider');
  300. $hspPaymentRequest->setPersonIncurringExpense('Tester');
  301. $hspPaymentRequest->setExpenseDescription('Just testing');
  302. $hspPaymentRequest->setExpenseAmount('100');
  303. $hspPaymentRequest->setPaymentMadeTo('TestX');
  304. $hspPaymentRequest->setThirdPartyAccountNumber('12345GD');
  305. $hspPaymentRequest->setMailAddress('1231, Test Grove, Test City');
  306. $hspPaymentRequest->setComments('Test');
  307. $exsistingRequest = $hspPaymentRequest->getHspRequest(10);
  308. $this->assertFalse($hspPaymentRequest->isDataChangedByAdmin($exsistingRequest));
  309. $hspPaymentRequest->setDateIncurred(date('Y-m-d', time()-3600*24*2));
  310. $msg = $hspPaymentRequest->isDataChangedByAdmin($exsistingRequest);
  311. $this->assertFalse($msg == false, $msg);
  312. $hspPaymentRequest->setProviderName('wrong name');
  313. $msg = $hspPaymentRequest->isDataChangedByAdmin($exsistingRequest);
  314. $this->assertFalse($msg == false, $msg);
  315. }
  316. public function testCalculateNewHspUsed() {
  317. $this->assertTrue(mysql_query("TRUNCATE `hs_hr_employee`;", $this->connection), mysql_error());
  318. $this->assertTrue(mysql_query("TRUNCATE `hs_hr_hsp_payment_request`;", $this->connection), mysql_error());
  319. $this->assertTrue(mysql_query("INSERT INTO `hs_hr_employee` ($this->employeeFields) VALUES (1, '001', 'Arnold', 'Subasinghe', '', 'Arnold', 0, NULL, NULL, NULL, NULL, NULL, '', '', '', '', NULL, '', NULL, NULL, NULL, NULL, '', '', '', 'AF', '', '', '', '', '', '', NULL, NULL, '')"), mysql_error());
  320. $this->assertTrue(mysql_query("INSERT INTO `hs_hr_hsp_payment_request` ($this->paymentRequestFields) " .
  321. "VALUES (1, 1, 1, '".date('Y')."-02-01', 'Test provider', 'Tester', 'Just testing', '150', 'TestX', '12345GD', " .
  322. "'1231, Test Grove, Test City', 'Test', '".date('Y')."-02-02', '123552-55821-ff25', 1)"), mysql_error());
  323. $this->assertTrue(mysql_query("INSERT INTO `hs_hr_hsp_payment_request` ($this->paymentRequestFields) " .
  324. "VALUES (2, 1, 1, '".date('Y')."-02-10', 'Test provider', 'Tester', 'Just testing', '100', 'TestX', '12345GD', " .
  325. "'1231, Test Grove, Test City', 'Test', '".date('Y')."-02-11', '123552-55821-ff25', 1)"), mysql_error());
  326. $this->assertTrue(mysql_query("INSERT INTO `hs_hr_hsp_payment_request` ($this->paymentRequestFields) " .
  327. "VALUES (3, 1, 1, '".date('Y')."-02-20', 'Test provider', 'Tester', 'Just testing', '127', 'TestX', '12345GD', " .
  328. "'1231, Test Grove, Test City', 'Test', '".date('Y')."-02-21', '123552-55821-ff25', 1)"), mysql_error());
  329. $lastUpdated = date('Y')."-02-05";
  330. $this->assertEquals(HspPaymentRequest::calculateNewHspUsed(1, 1, $lastUpdated), 227);
  331. $lastUpdated = (date('Y')-1)."-02-05";
  332. $this->assertEquals(HspPaymentRequest::calculateNewHspUsed(1, 1, $lastUpdated), 377);
  333. $this->assertTrue(mysql_query("TRUNCATE `hs_hr_employee`;", $this->connection), mysql_error());
  334. $this->assertTrue(mysql_query("TRUNCATE `hs_hr_hsp_payment_request`;", $this->connection), mysql_error());
  335. }
  336. }
  337. // Call HspPaymentRequestTest::main() if this source file is executed directly.
  338. if (PHPUnit_MAIN_METHOD == "HspPaymentRequestTest::main") {
  339. HspPaymentRequestTest::main();
  340. }
  341. ?>