diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-12-13 12:39:29 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-12-13 12:39:29 +0100 |
commit | b97d90e0c3a9064127cf203e92c5c18bde129703 (patch) | |
tree | 8320e5f0455102d511178ed216c419507813b27d /tests | |
parent | bbe41a73dd0a77c572c78e9df8a77ff7b0cb7bf2 (diff) | |
download | nextcloud-server-b97d90e0c3a9064127cf203e92c5c18bde129703.tar.gz nextcloud-server-b97d90e0c3a9064127cf203e92c5c18bde129703.zip |
Log critical fallback to user default if we can't parse the JSON
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Accounts/AccountsManagerTest.php | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/lib/Accounts/AccountsManagerTest.php b/tests/lib/Accounts/AccountsManagerTest.php index d727f05d1ef..958b6fd4738 100644 --- a/tests/lib/Accounts/AccountsManagerTest.php +++ b/tests/lib/Accounts/AccountsManagerTest.php @@ -26,7 +26,9 @@ use OC\Accounts\Account; use OC\Accounts\AccountManager; use OCP\Accounts\IAccountManager; use OCP\BackgroundJob\IJobList; +use OCP\ILogger; use OCP\IUser; +use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\GenericEvent; use Test\TestCase; @@ -42,21 +44,24 @@ class AccountsManagerTest extends TestCase { /** @var \OCP\IDBConnection */ private $connection; - /** @var EventDispatcherInterface | \PHPUnit_Framework_MockObject_MockObject */ + /** @var EventDispatcherInterface|MockObject */ private $eventDispatcher; - /** @var IJobList | \PHPUnit_Framework_MockObject_MockObject */ + /** @var IJobList|MockObject */ private $jobList; /** @var string accounts table name */ private $table = 'accounts'; + /** @var ILogger|MockObject */ + private $logger; + protected function setUp(): void { parent::setUp(); - $this->eventDispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface') - ->disableOriginalConstructor()->getMock(); + $this->eventDispatcher = $this->createMock(EventDispatcherInterface::class); $this->connection = \OC::$server->getDatabaseConnection(); - $this->jobList = $this->getMockBuilder(IJobList::class)->getMock(); + $this->jobList = $this->createMock(IJobList::class); + $this->logger = $this->createMock(ILogger::class); } protected function tearDown(): void { @@ -69,11 +74,11 @@ class AccountsManagerTest extends TestCase { * get a instance of the accountManager * * @param array $mockedMethods list of methods which should be mocked - * @return \PHPUnit_Framework_MockObject_MockObject | AccountManager + * @return MockObject | AccountManager */ public function getInstance($mockedMethods = null) { return $this->getMockBuilder(AccountManager::class) - ->setConstructorArgs([$this->connection, $this->eventDispatcher, $this->jobList]) + ->setConstructorArgs([$this->connection, $this->eventDispatcher, $this->jobList, $this->logger]) ->setMethods($mockedMethods) ->getMock(); |