diff --git a/test/unittests/UserTest.php b/test/unittests/UserTest.php index 31b7d6afaf1..d3ece30deb5 100644 --- a/test/unittests/UserTest.php +++ b/test/unittests/UserTest.php @@ -291,8 +291,6 @@ protected function setUp(): void $this->_mockDB = $mockdb; $this->_mockConfig = $mockconfig; - $this->_factory->setConfig($this->_mockConfig); - $this->_userInfoComplete = $this->_userInfo; $this->_userInfoComplete['ID'] = '1'; $this->_userInfoComplete['Privilege'] = '1'; @@ -661,6 +659,9 @@ public function testUpdatePasswordWithExpiration() // Cause usePwnedPasswordsAPI config option to return false. $mockConfig = &$this->_mockConfig; '@phan-var \PHPUnit\Framework\MockObject\MockObject $mockConfig'; + + $this->_factory->setConfig($mockConfig); + $mockConfig->expects($this->any()) ->method('settingEnabled') ->willReturn(false); @@ -696,6 +697,8 @@ public function testUpdatePasswordWithoutExpiry() ->method('settingEnabled') ->willReturn(false); + $this->_factory->setConfig($mockConfig); + $this->_user->updatePassword( new \Password(\Utility::randomString(16)) );