Skip to content

Commit

Permalink
Fixed naming for some unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
vtos committed Feb 2, 2023
1 parent 1449ae2 commit ba88fa5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 25 deletions.
31 changes: 8 additions & 23 deletions tests/local/fetchquestion_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,31 +248,22 @@ public function test_get_set_level() {
$fetchquestion->set_level(-22);
}

/**
* @test
*/
public function it_fails_when_instantiated_with_a_zero_difficulty_level(): void {
$this->resetAfterTest(true);
public function test_it_fails_when_instantiated_with_a_zero_difficulty_level(): void {
$this->resetAfterTest();

$this->expectException('coding_exception');
(new fetchquestion(new stdClass(), 0, 1, 100, ['phpunittag_']));
}

/**
* @test
*/
public function it_fails_when_instantiated_with_a_negative_difficulty_level(): void {
$this->resetAfterTest(true);
public function test_it_fails_when_instantiated_with_a_negative_difficulty_level(): void {
$this->resetAfterTest();

$this->expectException('coding_exception');
(new fetchquestion(new stdClass(), -11, 1, 100, ['phpunittag_']));
}

/**
* @test
*/
public function it_fails_when_instantiated_with_a_difficulty_level_as_a_string(): void {
$this->resetAfterTest(true);
public function test_it_fails_when_instantiated_with_a_difficulty_level_as_a_string(): void {
$this->resetAfterTest();

$this->expectException('coding_exception');
(new fetchquestion(new stdClass(), 'asdf', 1, 100, ['phpunittag_']));
Expand Down Expand Up @@ -511,10 +502,7 @@ public function test_fetch_question_search_outside_min_max_bounds() {
$this->assertEquals([], $result);
}

/**
* @test
*/
public function it_retrieves_all_tag_ids(): void {
public function test_it_retrieves_all_tag_ids(): void {
$this->resetAfterTest();
$this->setup_test_data_xml();

Expand All @@ -527,10 +515,7 @@ public function it_retrieves_all_tag_ids(): void {
);
}

/**
* @test
*/
public function it_throws_an_exception_when_retrieves_all_tag_ids_for_an_empty_tag_prefix(): void {
public function test_it_throws_an_exception_when_retrieves_all_tag_ids_for_an_empty_tag_prefix(): void {
$fetchquestion = new fetchquestion(new stdClass(), 5, 1, 100);

$this->expectException('invalid_parameter_exception');
Expand Down
3 changes: 1 addition & 2 deletions tests/locallib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,9 @@ public function test_adaptivequiz_complete_attempt() {
}

/**
* @test
* @covers ::adaptivequiz_complete_attempt
*/
public function event_is_triggered_on_attempt_completion(): void {
public function test_event_is_triggered_on_attempt_completion(): void {
global $DB;

$this->resetAfterTest();
Expand Down

0 comments on commit ba88fa5

Please sign in to comment.