Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-08-23 16:05:04 +0300
committerJoas Schilling <coding@schilljs.com>2021-08-24 17:55:34 +0300
commite6bafc252d7e7cbd61688256b445df00309f52df (patch)
tree9dcd05cb25790111119292a91c51eaee4fd5f72c /tests
parentd0f039ba29facb49ba42741fca8510206514402a (diff)
Fix unit tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/php/Chat/SystemMessage/ListenerTest.php7
-rw-r--r--tests/php/Signaling/BackendNotifierTest.php2
2 files changed, 7 insertions, 2 deletions
diff --git a/tests/php/Chat/SystemMessage/ListenerTest.php b/tests/php/Chat/SystemMessage/ListenerTest.php
index 7b83b5e2a..62e93bd19 100644
--- a/tests/php/Chat/SystemMessage/ListenerTest.php
+++ b/tests/php/Chat/SystemMessage/ListenerTest.php
@@ -32,6 +32,7 @@ use OCA\Talk\TalkSession;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IRequest;
+use OCP\ISession;
use OCP\IUser;
use OCP\IUserSession;
use PHPUnit\Framework\MockObject\MockObject;
@@ -52,6 +53,8 @@ class ListenerTest extends TestCase {
protected $chatManager;
/** @var IUserSession|MockObject */
protected $userSession;
+ /** @var ISession|MockObject */
+ protected $session;
/** @var TalkSession|MockObject */
protected $talkSession;
/** @var ITimeFactory|MockObject */
@@ -75,6 +78,7 @@ class ListenerTest extends TestCase {
$this->dummyTime = new \DateTime();
$this->chatManager = $this->createMock(ChatManager::class);
+ $this->session = $this->createMock(ISession::class);
$this->userSession = $this->createMock(IUserSession::class);
$this->talkSession = $this->createMock(TalkSession::class);
$this->timeFactory = $this->createMock(ITimeFactory::class);
@@ -93,8 +97,9 @@ class ListenerTest extends TestCase {
$this->request,
$this->chatManager,
$this->talkSession,
+ $this->session,
$this->userSession,
- $this->timeFactory,
+ $this->timeFactory
);
$this->overwriteService(Listener::class, $this->listener);
diff --git a/tests/php/Signaling/BackendNotifierTest.php b/tests/php/Signaling/BackendNotifierTest.php
index 6c3dd92f7..8b0a91083 100644
--- a/tests/php/Signaling/BackendNotifierTest.php
+++ b/tests/php/Signaling/BackendNotifierTest.php
@@ -209,7 +209,7 @@ class BackendNotifierTest extends \Test\TestCase {
$bodies = array_map([$this, 'sortParticipantUsers'], $bodies);
$message = $this->sortParticipantUsers($message);
- $this->assertContains($message, $bodies, json_encode($bodies, JSON_PRETTY_PRINT));
+ $this->assertContainsEquals($message, $bodies, json_encode($bodies, JSON_PRETTY_PRINT));
}
private function sortParticipantUsers(array $message): array {