diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-04-07 23:42:43 +0300 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-04-10 05:43:01 +0300 |
commit | 5b4adf66e51e21b3ecbd683397a362b60f792a50 (patch) | |
tree | 8bdc129ac9fd6575ee41be438ff667e49f7110a2 /tests/Settings | |
parent | ca9d25169dcdd2923a356e2a797d8704506a3787 (diff) |
Move OC_Defaults to OCP\Defaults
* currently there are two ways to access default values:
OCP\Defaults or OC_Defaults (which is extended by
OCA\Theming\ThemingDefaults)
* our code used a mixture of both of them, which made
it hard to work on theme values
* this extended the public interface with the missing
methods and uses them everywhere to only rely on the
public interface
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests/Settings')
-rw-r--r-- | tests/Settings/Controller/UsersControllerTest.php | 2 | ||||
-rw-r--r-- | tests/Settings/Mailer/NewUserMailHelperTest.php | 21 |
2 files changed, 10 insertions, 13 deletions
diff --git a/tests/Settings/Controller/UsersControllerTest.php b/tests/Settings/Controller/UsersControllerTest.php index d7961e2332b..79e6dd61813 100644 --- a/tests/Settings/Controller/UsersControllerTest.php +++ b/tests/Settings/Controller/UsersControllerTest.php @@ -52,8 +52,6 @@ class UsersControllerTest extends \Test\TestCase { private $config; /** @var ILogger|\PHPUnit_Framework_MockObject_MockObject */ private $logger; - /** @var \OC_Defaults|\PHPUnit_Framework_MockObject_MockObject */ - private $defaults; /** @var IMailer|\PHPUnit_Framework_MockObject_MockObject */ private $mailer; /** @var IURLGenerator|\PHPUnit_Framework_MockObject_MockObject */ diff --git a/tests/Settings/Mailer/NewUserMailHelperTest.php b/tests/Settings/Mailer/NewUserMailHelperTest.php index e77e8e197b8..f38eed0745e 100644 --- a/tests/Settings/Mailer/NewUserMailHelperTest.php +++ b/tests/Settings/Mailer/NewUserMailHelperTest.php @@ -21,12 +21,11 @@ namespace Tests\Settings\Mailer; -use OC\Mail\EMailTemplate; use OC\Mail\IEMailTemplate; use OC\Mail\Message; use OC\Settings\Mailer\NewUserMailHelper; -use OCA\Theming\ThemingDefaults; use OCP\AppFramework\Utility\ITimeFactory; +use OCP\Defaults; use OCP\IConfig; use OCP\IL10N; use OCP\IURLGenerator; @@ -37,8 +36,8 @@ use OCP\Security\ISecureRandom; use Test\TestCase; class NewUserMailHelperTest extends TestCase { - /** @var ThemingDefaults|\PHPUnit_Framework_MockObject_MockObject */ - private $themingDefaults; + /** @var Defaults|\PHPUnit_Framework_MockObject_MockObject */ + private $defaults; /** @var IURLGenerator|\PHPUnit_Framework_MockObject_MockObject */ private $urlGenerator; /** @var IL10N|\PHPUnit_Framework_MockObject_MockObject */ @@ -59,7 +58,7 @@ class NewUserMailHelperTest extends TestCase { public function setUp() { parent::setUp(); - $this->themingDefaults = $this->createMock(ThemingDefaults::class); + $this->defaults = $this->createMock(Defaults::class); $this->urlGenerator = $this->createMock(IURLGenerator::class); $this->l10n = $this->createMock(IL10N::class); $this->mailer = $this->createMock(IMailer::class); @@ -73,7 +72,7 @@ class NewUserMailHelperTest extends TestCase { })); $this->newUserMailHelper = new NewUserMailHelper( - $this->themingDefaults, + $this->defaults, $this->urlGenerator, $this->l10n, $this->mailer, @@ -144,7 +143,7 @@ class NewUserMailHelperTest extends TestCase { ->expects($this->at(5)) ->method('getUID') ->willReturn('john'); - $this->themingDefaults + $this->defaults ->expects($this->at(0)) ->method('getName') ->willReturn('TestCloud'); @@ -175,7 +174,7 @@ class NewUserMailHelperTest extends TestCase { <tbody> <tr style="padding:0;text-align:left;vertical-align:top"> <center data-parsed="" style="min-width:580px;width:100%"> - <img class="logo float-center" src="?v=" alt="logo" align="center" style="-ms-interpolation-mode:bicubic;Margin:0 auto;clear:both;display:block;float:none;margin:0 auto;max-height:100%;max-width:100px;outline:0;text-align:center;text-decoration:none;width:auto"> + <img class="logo float-center" src="" alt="logo" align="center" style="-ms-interpolation-mode:bicubic;Margin:0 auto;clear:both;display:block;float:none;margin:0 auto;max-height:100%;max-width:100px;outline:0;text-align:center;text-decoration:none;width:auto"> </center> </tr> </tbody> @@ -376,7 +375,7 @@ EOF; ->expects($this->at(1)) ->method('getUID') ->willReturn('john'); - $this->themingDefaults + $this->defaults ->expects($this->any()) ->method('getName') ->willReturn('TestCloud'); @@ -407,7 +406,7 @@ EOF; <tbody> <tr style="padding:0;text-align:left;vertical-align:top"> <center data-parsed="" style="min-width:580px;width:100%"> - <img class="logo float-center" src="?v=" alt="logo" align="center" style="-ms-interpolation-mode:bicubic;Margin:0 auto;clear:both;display:block;float:none;margin:0 auto;max-height:100%;max-width:100px;outline:0;text-align:center;text-decoration:none;width:auto"> + <img class="logo float-center" src="" alt="logo" align="center" style="-ms-interpolation-mode:bicubic;Margin:0 auto;clear:both;display:block;float:none;margin:0 auto;max-height:100%;max-width:100px;outline:0;text-align:center;text-decoration:none;width:auto"> </center> </tr> </tbody> @@ -609,7 +608,7 @@ EOF; ->expects($this->at(0)) ->method('setTo') ->with(['recipient@example.com' => 'John Doe']); - $this->themingDefaults + $this->defaults ->expects($this->exactly(2)) ->method('getName') ->willReturn('TestCloud'); |