diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-07-16 18:08:03 +0300 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-07-21 21:43:18 +0300 |
commit | 91e7f12088cb87ffef5660429ece404364167978 (patch) | |
tree | baf44ebc7b240bd49eb0f6bf615cbb1ed99d13db /apps/comments/tests | |
parent | e029055e766298c5852eedabf06ff42b06a50198 (diff) |
Adjust apps' code to use the ContainerInterface
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/comments/tests')
-rw-r--r-- | apps/comments/tests/Unit/JSSettingsHelperTest.php | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/apps/comments/tests/Unit/JSSettingsHelperTest.php b/apps/comments/tests/Unit/JSSettingsHelperTest.php index 26cdee1f26b..94d13a77d94 100644 --- a/apps/comments/tests/Unit/JSSettingsHelperTest.php +++ b/apps/comments/tests/Unit/JSSettingsHelperTest.php @@ -1,4 +1,7 @@ <?php + +declare(strict_types=1); + /** * @copyright Copyright (c) 2017 Arthur Schiwon <blizzz@arthur-schiwon.de> * @@ -26,11 +29,11 @@ namespace OCA\Comments\Tests\Unit; use OCA\Comments\JSSettingsHelper; use OCP\IConfig; -use OCP\IServerContainer; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class JSSettingsHelperTest extends TestCase { - /** @var IServerContainer|\PHPUnit_Framework_MockObject_MockObject */ + /** @var IConfig|MockObject */ protected $c; /** @var JSSettingsHelper */ protected $helper; @@ -38,22 +41,17 @@ class JSSettingsHelperTest extends TestCase { protected function setUp(): void { parent::setUp(); - $this->c = $this->createMock(IServerContainer::class); + $this->c = $this->createMock(IConfig::class); $this->helper = new JSSettingsHelper($this->c); } public function testExtend() { - $config = $this->createMock(IConfig::class); - $config->expects($this->once()) + $this->c->expects($this->once()) ->method('getAppValue') ->with('comments', 'maxAutoCompleteResults') ->willReturn(13); - $this->c->expects($this->once()) - ->method('getConfig') - ->willReturn($config); - $config = [ 'oc_appconfig' => json_encode([ 'anotherapp' => [ |