Skip to content

Commit

Permalink
MDL-62140 core_privacy: only reset tests when necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjnelson authored and andrewnicols committed Apr 24, 2018
1 parent 21f51cf commit 9ede824
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions privacy/tests/contextlist_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@
*/
class contextlist_test extends advanced_testcase {

/**
* Runs before each test is performed.
*/
public function setUp() {
$this->resetAfterTest();
}

/**
* Ensure that valid SQL results in the relevant contexts being added.
*/
Expand Down Expand Up @@ -78,6 +71,8 @@ public function test_add_system_context() {
* Ensure that a valid user context id is added.
*/
public function test_add_user_context() {
$this->resetAfterTest();

$user = $this->getDataGenerator()->create_user();
$this->getDataGenerator()->create_user();

Expand All @@ -95,6 +90,8 @@ public function test_add_user_context() {
* Ensure that valid user contexts are added.
*/
public function test_add_user_contexts() {
$this->resetAfterTest();

$user1 = $this->getDataGenerator()->create_user();
$user2 = $this->getDataGenerator()->create_user();
$this->getDataGenerator()->create_user();
Expand Down

0 comments on commit 9ede824

Please sign in to comment.