diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2020-07-08 19:38:26 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2020-07-09 12:21:06 +0200 |
commit | 725872c23a82a31026504e052cfff83bc4d6cceb (patch) | |
tree | 27db8a15169d77039a6724109188fae0ca263d9d /tests/lib/Support/Subscription/RegistryTest.php | |
parent | 8f4d5334f4c392a5571c8f96292ae80fa9bbc177 (diff) | |
download | nextcloud-server-725872c23a82a31026504e052cfff83bc4d6cceb.tar.gz nextcloud-server-725872c23a82a31026504e052cfff83bc4d6cceb.zip |
Make the subscription registry lazy
This will allow to do lazy registration here which should allow for
loading less (or at least only when needed!).
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests/lib/Support/Subscription/RegistryTest.php')
-rw-r--r-- | tests/lib/Support/Subscription/RegistryTest.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/lib/Support/Subscription/RegistryTest.php b/tests/lib/Support/Subscription/RegistryTest.php index 3e316792682..2548cfe817f 100644 --- a/tests/lib/Support/Subscription/RegistryTest.php +++ b/tests/lib/Support/Subscription/RegistryTest.php @@ -24,6 +24,7 @@ namespace Test\Support\Subscription; use OC\Support\Subscription\Registry; use OCP\IConfig; +use OCP\IServerContainer; use OCP\Support\Subscription\ISubscription; use OCP\Support\Subscription\ISupportedApps; use PHPUnit\Framework\MockObject\MockObject; @@ -37,11 +38,15 @@ class RegistryTest extends TestCase { /** @var MockObject|IConfig */ private $config; + /** @var MockObject|IServerContainer */ + private $serverContainer; + protected function setUp(): void { parent::setUp(); $this->config = $this->createMock(IConfig::class); - $this->registry = new Registry($this->config); + $this->serverContainer = $this->createMock(IServerContainer::class); + $this->registry = new Registry($this->config, $this->serverContainer); } /** @@ -52,7 +57,7 @@ class RegistryTest extends TestCase { $this->addToAssertionCount(1); } - + public function testDoubleRegistration() { $this->expectException(\OCP\Support\Subscription\Exception\AlreadyRegisteredException::class); |