Skip to content

Commit

Permalink
Merge pull request #15 from ucl-isd/CTP-3560-coursework-tests-review-…
Browse files Browse the repository at this point in the history
…phpunit

CTP-3560 PHPUnit errors
  • Loading branch information
aspark21 authored Sep 10, 2024
2 parents 45eb6f3 + 393f364 commit 160eeb2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion classes/framework/table_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,13 @@ public static final function get_table_name() {
$class_name = get_called_class(); // 'mod_coursework\models\deadline_extension'
$pieces = explode('\\', $class_name); // 'mod_coursework', 'models', 'deadline_extension'
$table_name = end($pieces); // 'deadline_extension'
$table_name .= 's'; // 'deadline_extensions'
//todo this may need further attention but fixing the one issue identified so far.
if ($table_name == 'personal_deadline') {
// Table personal_deadline does not exist but coursework_person_deadline does.
$table_name = 'coursework_person_deadline';
} else {
$table_name .= 's'; // 'deadline_extensions'
}
} else {
$table_name = static::$table_name;
}
Expand Down
2 changes: 1 addition & 1 deletion classes/stages/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function __construct($coursework, $stageidentifier) {
*/
private function get_allocation_strategy() {
$strategyname = $this->strategy_name();
$classname = "\\modcoursework\\allocation\\strategy\\{$strategyname}";
$classname = "\\mod_coursework\\allocation\\strategy\\{$strategyname}";
return new $classname($this->get_coursework(), $this);
}

Expand Down

0 comments on commit 160eeb2

Please sign in to comment.