diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-05-12 17:08:54 +0200 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-08-01 09:46:40 +0200 |
commit | 458c2fa2971e6595a18a289b0afeb4a79ea0e0d3 (patch) | |
tree | c0bebce50e7d6956045df53f1e51dc44b0ab6c9e /tests/lib/Encryption/UtilTest.php | |
parent | 952acd4d276b3190d23e0597c5e01b1dfc4d72bc (diff) | |
download | nextcloud-server-458c2fa2971e6595a18a289b0afeb4a79ea0e0d3.tar.gz nextcloud-server-458c2fa2971e6595a18a289b0afeb4a79ea0e0d3.zip |
Remove OCP\App and OCP\BackgroundJob
Both deprecated since NC 23
IAppManager is the replacement for OCP\App unfortunately it can't be
dependency injected in classes used by the installed otherwise the
database connection is initialised too early
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'tests/lib/Encryption/UtilTest.php')
-rw-r--r-- | tests/lib/Encryption/UtilTest.php | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/tests/lib/Encryption/UtilTest.php b/tests/lib/Encryption/UtilTest.php index 02155be11dd..248377fc698 100644 --- a/tests/lib/Encryption/UtilTest.php +++ b/tests/lib/Encryption/UtilTest.php @@ -8,6 +8,8 @@ use OCA\Files_External\Lib\StorageConfig; use OCA\Files_External\Service\GlobalStoragesService; use OCP\Encryption\IEncryptionModule; use OCP\IConfig; +use OCP\IGroupManager; +use OCP\IUserManager; use Test\TestCase; class UtilTest extends TestCase { @@ -15,24 +17,21 @@ class UtilTest extends TestCase { /** * block size will always be 8192 for a PHP stream * @see https://bugs.php.net/bug.php?id=21641 - * @var integer */ - protected $headerSize = 8192; + protected int $headerSize = 8192; /** @var \PHPUnit\Framework\MockObject\MockObject */ protected $view; - /** @var \PHPUnit\Framework\MockObject\MockObject */ + /** @var \PHPUnit\Framework\MockObject\MockObject|IUserManager */ protected $userManager; - /** @var \PHPUnit\Framework\MockObject\MockObject */ + /** @var \PHPUnit\Framework\MockObject\MockObject|IGroupManager */ protected $groupManager; - /** @var \PHPUnit\Framework\MockObject\MockObject */ + /** @var \PHPUnit\Framework\MockObject\MockObject|IConfig */ private $config; - - /** @var \OC\Encryption\Util */ - private $util; + private Util $util; protected function setUp(): void { parent::setUp(); @@ -40,17 +39,9 @@ class UtilTest extends TestCase { ->disableOriginalConstructor() ->getMock(); - $this->userManager = $this->getMockBuilder('OC\User\Manager') - ->disableOriginalConstructor() - ->getMock(); - - $this->groupManager = $this->getMockBuilder('OC\Group\Manager') - ->disableOriginalConstructor() - ->getMock(); - - $this->config = $this->getMockBuilder(IConfig::class) - ->disableOriginalConstructor() - ->getMock(); + $this->userManager = $this->createMock(IUserManager::class); + $this->groupManager = $this->createMock(IGroupManager::class); + $this->config = $this->createMock(IConfig::class); $this->util = new Util( $this->view, |