Skip to content

Commit

Permalink
fix consistent namespace after merging
Browse files Browse the repository at this point in the history
  • Loading branch information
Laur0r committed Jun 3, 2024
1 parent a8edac3 commit 4a09410
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 58 deletions.
8 changes: 4 additions & 4 deletions backup/moodle2/backup_ratingallocate_activity_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ protected function define_structure() {
$ratingallocatechoicegroups->add_child($ratingallocatechoicegroup);

// Define sources.
$ratingallocate->set_source_table(get_tablename_for_tableClass('ratingallocate\db\ratingallocate'),
$ratingallocate->set_source_table(get_tablename_for_tableClass('mod_ratingallocate\db\ratingallocate'),
[this_db\ratingallocate::ID => backup::VAR_ACTIVITYID], this_db\ratingallocate_choices::ID . ' ASC');
$ratingallocatechoice->set_source_table(get_tablename_for_tableClass('ratingallocate\db\ratingallocate_choices'),
$ratingallocatechoice->set_source_table(get_tablename_for_tableClass('mod_ratingallocate\db\ratingallocate_choices'),
[this_db\ratingallocate_choices::RATINGALLOCATEID => backup::VAR_PARENTID],
this_db\ratingallocate_choices::ID . ' ASC');
$groupchoice->set_source_table(get_tablename_for_tableClass($groupchoiceclass), ['choiceid' => backup::VAR_PARENTID]);
Expand All @@ -105,11 +105,11 @@ protected function define_structure() {

if ($userinfo) {
$ratingallocaterating->set_source_table(get_tablename_for_tableClass(
'ratingallocate\db\ratingallocate_ratings'),
'mod_ratingallocate\db\ratingallocate_ratings'),
[this_db\ratingallocate_ratings::CHOICEID => backup::VAR_PARENTID],
this_db\ratingallocate_ratings::ID . ' ASC');
$ratingallocateallocation->set_source_table(
get_tablename_for_tableClass('ratingallocate\db\ratingallocate_allocations'),
get_tablename_for_tableClass('mod_ratingallocate\db\ratingallocate_allocations'),
[
this_db\ratingallocate_allocations::RATINGALLOCATEID => backup::VAR_ACTIVITYID,
this_db\ratingallocate_allocations::CHOICEID => backup::VAR_PARENTID,
Expand Down
108 changes: 54 additions & 54 deletions tests/mod_ratingallocate_strategy_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ class mod_ratingallocate_strategy_test extends \advanced_testcase {
*/
public function test_yes_no_validation() {
// Attribute required.
$settings = [\ratingallocate\strategy_yesno\strategy::MAXCROSSOUT => null];
$strategy = new \ratingallocate\strategy_yesno\strategy($settings);
$settings = [\mod_ratingallocate\strategy_yesno\strategy::MAXCROSSOUT => null];
$strategy = new \mod_ratingallocate\strategy_yesno\strategy($settings);
$this->assertCount(1, $strategy->validate_settings());
// Attribute minimum error.
$settings = [\ratingallocate\strategy_yesno\strategy::MAXCROSSOUT => -1];
$strategy = new \ratingallocate\strategy_yesno\strategy($settings);
$settings = [\mod_ratingallocate\strategy_yesno\strategy::MAXCROSSOUT => -1];
$strategy = new \mod_ratingallocate\strategy_yesno\strategy($settings);
$this->assertCount(1, $strategy->validate_settings());
// No validation error.
$settings = [\ratingallocate\strategy_yesno\strategy::MAXCROSSOUT => 1];
$strategy = new \ratingallocate\strategy_yesno\strategy($settings);
$settings = [\mod_ratingallocate\strategy_yesno\strategy::MAXCROSSOUT => 1];
$strategy = new \mod_ratingallocate\strategy_yesno\strategy($settings);
$this->assertCount(0, $strategy->validate_settings());
}

Expand All @@ -55,16 +55,16 @@ public function test_yes_no_validation() {
*/
public function test_yes_maybe_no_validation() {
// Attribute required.
$settings = [\ratingallocate\strategy_yesmaybeno\strategy::MAXNO => null];
$strategy = new \ratingallocate\strategy_yesmaybeno\strategy($settings);
$settings = [\mod_ratingallocate\strategy_yesmaybeno\strategy::MAXNO => null];
$strategy = new \mod_ratingallocate\strategy_yesmaybeno\strategy($settings);
$this->assertCount(1, $strategy->validate_settings());
// Attribute minimum error.
$settings = [\ratingallocate\strategy_yesmaybeno\strategy::MAXNO => -1];
$strategy = new \ratingallocate\strategy_yesmaybeno\strategy($settings);
$settings = [\mod_ratingallocate\strategy_yesmaybeno\strategy::MAXNO => -1];
$strategy = new \mod_ratingallocate\strategy_yesmaybeno\strategy($settings);
$this->assertCount(1, $strategy->validate_settings());
// No validation error.
$settings = [\ratingallocate\strategy_yesmaybeno\strategy::MAXNO => 1];
$strategy = new \ratingallocate\strategy_yesmaybeno\strategy($settings);
$settings = [\mod_ratingallocate\strategy_yesmaybeno\strategy::MAXNO => 1];
$strategy = new \mod_ratingallocate\strategy_yesmaybeno\strategy($settings);
$this->assertCount(0, $strategy->validate_settings());
}

Expand All @@ -73,28 +73,28 @@ public function test_yes_maybe_no_validation() {
*/
public function test_lickert_validation() {
// Attribute required.
$settings = [\ratingallocate\strategy_lickert\strategy::COUNTLICKERT => null];
$strategy = new \ratingallocate\strategy_lickert\strategy($settings);
$settings = [\mod_ratingallocate\strategy_lickert\strategy::COUNTLICKERT => null];
$strategy = new \mod_ratingallocate\strategy_lickert\strategy($settings);
$this->assertCount(1, $strategy->validate_settings());
// Attribute required.
$settings = [\ratingallocate\strategy_lickert\strategy::MAXNO => null];
$strategy = new \ratingallocate\strategy_lickert\strategy($settings);
$settings = [\mod_ratingallocate\strategy_lickert\strategy::MAXNO => null];
$strategy = new \mod_ratingallocate\strategy_lickert\strategy($settings);
$this->assertCount(1, $strategy->validate_settings());
// Attribute minimum error.
$settings = [\ratingallocate\strategy_lickert\strategy::COUNTLICKERT => 1];
$strategy = new \ratingallocate\strategy_lickert\strategy($settings);
$settings = [\mod_ratingallocate\strategy_lickert\strategy::COUNTLICKERT => 1];
$strategy = new \mod_ratingallocate\strategy_lickert\strategy($settings);
$this->assertCount(1, $strategy->validate_settings());
// Attribute minimum error.
$settings = [\ratingallocate\strategy_lickert\strategy::MAXNO => -1];
$strategy = new \ratingallocate\strategy_lickert\strategy($settings);
$settings = [\mod_ratingallocate\strategy_lickert\strategy::MAXNO => -1];
$strategy = new \mod_ratingallocate\strategy_lickert\strategy($settings);
$this->assertCount(1, $strategy->validate_settings());
// No validation error.
$settings = [\ratingallocate\strategy_lickert\strategy::COUNTLICKERT => 3];
$strategy = new \ratingallocate\strategy_lickert\strategy($settings);
$settings = [\mod_ratingallocate\strategy_lickert\strategy::COUNTLICKERT => 3];
$strategy = new \mod_ratingallocate\strategy_lickert\strategy($settings);
$this->assertCount(0, $strategy->validate_settings());
// No validation error.
$settings = [\ratingallocate\strategy_lickert\strategy::MAXNO => 1];
$strategy = new \ratingallocate\strategy_lickert\strategy($settings);
$settings = [\mod_ratingallocate\strategy_lickert\strategy::MAXNO => 1];
$strategy = new \mod_ratingallocate\strategy_lickert\strategy($settings);
$this->assertCount(0, $strategy->validate_settings());
}

Expand All @@ -103,40 +103,40 @@ public function test_lickert_validation() {
*/
public function test_points_validation() {
// Attribute required.
$settings = [\ratingallocate\strategy_points\strategy::MAXZERO => null];
$strategy = new \ratingallocate\strategy_points\strategy($settings);
$settings = [\mod_ratingallocate\strategy_points\strategy::MAXZERO => null];
$strategy = new \mod_ratingallocate\strategy_points\strategy($settings);
$this->assertCount(1, $strategy->validate_settings());
// Attribute required.
$settings = [\ratingallocate\strategy_points\strategy::TOTALPOINTS => null];
$strategy = new \ratingallocate\strategy_points\strategy($settings);
$settings = [\mod_ratingallocate\strategy_points\strategy::TOTALPOINTS => null];
$strategy = new \mod_ratingallocate\strategy_points\strategy($settings);
$this->assertCount(1, $strategy->validate_settings());
// Attribute required.
$settings = [\ratingallocate\strategy_points\strategy::MAXPERCHOICE => null];
$strategy = new \ratingallocate\strategy_points\strategy($settings);
$settings = [\mod_ratingallocate\strategy_points\strategy::MAXPERCHOICE => null];
$strategy = new \mod_ratingallocate\strategy_points\strategy($settings);
$this->assertCount(1, $strategy->validate_settings());
// Attribute minimum error.
$settings = [\ratingallocate\strategy_points\strategy::MAXZERO => -1];
$strategy = new \ratingallocate\strategy_points\strategy($settings);
$settings = [\mod_ratingallocate\strategy_points\strategy::MAXZERO => -1];
$strategy = new \mod_ratingallocate\strategy_points\strategy($settings);
$this->assertCount(1, $strategy->validate_settings());
// Attribute minimum error.
$settings = [\ratingallocate\strategy_points\strategy::TOTALPOINTS => 0];
$strategy = new \ratingallocate\strategy_points\strategy($settings);
$settings = [\mod_ratingallocate\strategy_points\strategy::TOTALPOINTS => 0];
$strategy = new \mod_ratingallocate\strategy_points\strategy($settings);
$this->assertCount(1, $strategy->validate_settings());
// Attribute minimum error.
$settings = [\ratingallocate\strategy_points\strategy::MAXPERCHOICE => 0];
$strategy = new \ratingallocate\strategy_points\strategy($settings);
$settings = [\mod_ratingallocate\strategy_points\strategy::MAXPERCHOICE => 0];
$strategy = new \mod_ratingallocate\strategy_points\strategy($settings);
$this->assertCount(1, $strategy->validate_settings());
// No validation error.
$settings = [\ratingallocate\strategy_points\strategy::MAXZERO => 0];
$strategy = new \ratingallocate\strategy_points\strategy($settings);
$settings = [\mod_ratingallocate\strategy_points\strategy::MAXZERO => 0];
$strategy = new \mod_ratingallocate\strategy_points\strategy($settings);
$this->assertCount(0, $strategy->validate_settings());
// No validation error.
$settings = [\ratingallocate\strategy_points\strategy::TOTALPOINTS => 1];
$strategy = new \ratingallocate\strategy_points\strategy($settings);
$settings = [\mod_ratingallocate\strategy_points\strategy::TOTALPOINTS => 1];
$strategy = new \mod_ratingallocate\strategy_points\strategy($settings);
$this->assertCount(0, $strategy->validate_settings());
// No validation error.
$settings = [\ratingallocate\strategy_points\strategy::MAXPERCHOICE => 1];
$strategy = new \ratingallocate\strategy_points\strategy($settings);
$settings = [\mod_ratingallocate\strategy_points\strategy::MAXPERCHOICE => 1];
$strategy = new \mod_ratingallocate\strategy_points\strategy($settings);
$this->assertCount(0, $strategy->validate_settings());
}

Expand All @@ -145,16 +145,16 @@ public function test_points_validation() {
*/
public function test_order_validation() {
// Attribute required.
$settings = [\ratingallocate\strategy_order\strategy::COUNTOPTIONS => null];
$strategy = new \ratingallocate\strategy_order\strategy($settings);
$settings = [\mod_ratingallocate\strategy_order\strategy::COUNTOPTIONS => null];
$strategy = new \mod_ratingallocate\strategy_order\strategy($settings);
$this->assertCount(1, $strategy->validate_settings());
// Attribute minimum error.
$settings = [\ratingallocate\strategy_order\strategy::COUNTOPTIONS => 0];
$strategy = new \ratingallocate\strategy_order\strategy($settings);
$settings = [\mod_ratingallocate\strategy_order\strategy::COUNTOPTIONS => 0];
$strategy = new \mod_ratingallocate\strategy_order\strategy($settings);
$this->assertCount(1, $strategy->validate_settings());
// No validation error.
$settings = [\ratingallocate\strategy_order\strategy::COUNTOPTIONS => 1];
$strategy = new \ratingallocate\strategy_order\strategy($settings);
$settings = [\mod_ratingallocate\strategy_order\strategy::COUNTOPTIONS => 1];
$strategy = new \mod_ratingallocate\strategy_order\strategy($settings);
$this->assertCount(0, $strategy->validate_settings());
}

Expand All @@ -163,16 +163,16 @@ public function test_order_validation() {
*/
public function test_tickyes_validation() {
// Attribute required.
$settings = [\ratingallocate\strategy_tickyes\strategy::MINTICKYES => null];
$strategy = new \ratingallocate\strategy_tickyes\strategy($settings);
$settings = [\mod_ratingallocate\strategy_tickyes\strategy::MINTICKYES => null];
$strategy = new \mod_ratingallocate\strategy_tickyes\strategy($settings);
$this->assertCount(1, $strategy->validate_settings());
// Attribute minimum error.
$settings = [\ratingallocate\strategy_tickyes\strategy::MINTICKYES => 0];
$strategy = new \ratingallocate\strategy_tickyes\strategy($settings);
$settings = [\mod_ratingallocate\strategy_tickyes\strategy::MINTICKYES => 0];
$strategy = new \mod_ratingallocate\strategy_tickyes\strategy($settings);
$this->assertCount(1, $strategy->validate_settings());
// No validation error.
$settings = [\ratingallocate\strategy_tickyes\strategy::MINTICKYES => 1];
$strategy = new \ratingallocate\strategy_tickyes\strategy($settings);
$settings = [\mod_ratingallocate\strategy_tickyes\strategy::MINTICKYES => 1];
$strategy = new \mod_ratingallocate\strategy_tickyes\strategy($settings);
$this->assertCount(0, $strategy->validate_settings());
}

Expand Down

0 comments on commit 4a09410

Please sign in to comment.