summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Accounts/AccountsManagerTest.php19
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();