From 9ede8247949ca39827fecac9b11d8d328b329f3d Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Tue, 24 Apr 2018 10:54:21 +0800 Subject: [PATCH] MDL-62140 core_privacy: only reset tests when necessary --- privacy/tests/contextlist_test.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/privacy/tests/contextlist_test.php b/privacy/tests/contextlist_test.php index 7859651889fea..736e523ef5d96 100644 --- a/privacy/tests/contextlist_test.php +++ b/privacy/tests/contextlist_test.php @@ -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. */ @@ -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(); @@ -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();