Skip to content

Commit

Permalink
issue #4: fix a bug with tag name
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriim committed Sep 3, 2024
1 parent 906bcf1 commit 003d239
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/observer_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ public function test_tag_added() {

$this->assertEmpty($DB->get_record('cohort', ['name' => $tagname]));
$this->assertEmpty($DB->get_field('user_info_field', 'param1', ['id' => $prodilefield->id]));
$this->assertEmpty($DB->get_record('tag', ['name' => $tagname]));
$this->assertEmpty($DB->get_record('tag', ['rawname' => $tagname]));
$this->assertEmpty($DB->get_record('tool_dynamic_cohorts', ['name' => $tagname]));
$this->assertEmpty($DB->get_record('tool_dynamic_cohorts', ['name' => $tagname]));
$this->assertCount(0, $DB->get_records('enrol', ['courseid' => $course1->id, 'enrol' => 'cohort']));

core_tag_tag::set_item_tags('core', 'course', $course1->id, \context_course::instance($course1->id), [$tagname]);
core_tag_tag::set_item_tags('core', 'course', $course1->id, context_course::instance($course1->id), [$tagname]);

$tag = $DB->get_record('tag', ['name' => $tagname]);
$tag = $DB->get_record('tag', ['rawname' => $tagname]);
$this->assertNotEmpty($tag);

$cohort = $DB->get_record('cohort', ['name' => $tagname]);
Expand Down

0 comments on commit 003d239

Please sign in to comment.