Skip to content

Commit

Permalink
pradosoft#918 fixing spot DBCron test failure.
Browse files Browse the repository at this point in the history
The test itself wasn't quite right.  it should sort by asc (false), not descending (true). and ordering by uid (aka entry order) as well.
  • Loading branch information
belisoful committed May 3, 2023
1 parent 44a4ced commit c0d687f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions framework/Util/Cron/TDbCronModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -815,8 +815,8 @@ public function getCronLog($name, $pageSize, $offset, $sortingDesc = null)
$sortingDesc ??= true;
}
if ($sortingDesc !== null) {
$sortingDesc = TPropertyValue::ensureBoolean($sortingDesc) ? "DESC" : "ASC";
$orderby = " ORDER BY lastExecTime $sortingDesc, processCount $sortingDesc";
$sortingDesc = TPropertyValue::ensureBoolean($sortingDesc) ? 'DESC' : 'ASC';
$orderby = " ORDER BY lastExecTime $sortingDesc, tabuid $sortingDesc, processCount $sortingDesc";
}
$cmd = $db->createCommand(
"SELECT * FROM {$this->_tableName} WHERE {$where}active IS NULL{$orderby}{$limit}"
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Util/Cron/TDbCronModuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public function testLogCronTask()

self::assertEquals(5, $this->obj->getCronLogCount());

$log = $this->obj->getCronLog(null, false, false, true);
$log = $this->obj->getCronLog(null, false, false, false);
self::assertEquals(5, count($log));

self::assertEquals('testTaskAA', $log[0]['name']);
Expand Down

0 comments on commit c0d687f

Please sign in to comment.