Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors in calendar tests saying function handleIMipMessage does n… #35620

Merged
merged 1 commit into from
Dec 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions tests/lib/Calendar/ManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,20 @@
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Calendar\ICalendar;
use OCP\Calendar\ICreateFromString;
use OCP\Calendar\IHandleImipMessage;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
use Sabre\VObject\Document;
use Sabre\VObject\Reader;
use Test\TestCase;

/*
* This allows us to create Mock object supporting both interfaces
*/
interface ICreateFromStringAndHandleImipMessage extends ICreateFromString, IHandleImipMessage {
}

class ManagerTest extends TestCase {

/** @var Coordinator|MockObject */
Expand Down Expand Up @@ -334,7 +341,7 @@ public function testHandleImipReplyEventNotFound(): void {
'getCalendarsForPrincipal'
])
->getMock();
$calendar = $this->createMock(ICreateFromString::class);
$calendar = $this->createMock(ICreateFromStringAndHandleImipMessage::class);
$principalUri = 'principals/user/linus';
$sender = 'pierre@general-store.com';
$recipient = 'linus@stardew-tent-living.com';
Expand Down Expand Up @@ -371,7 +378,7 @@ public function testHandleImipReply(): void {
'getCalendarsForPrincipal'
])
->getMock();
$calendar = $this->createMock(ICreateFromString::class);
$calendar = $this->createMock(ICreateFromStringAndHandleImipMessage::class);
$principalUri = 'principals/user/linus';
$sender = 'pierre@general-store.com';
$recipient = 'linus@stardew-tent-living.com';
Expand Down Expand Up @@ -495,7 +502,7 @@ public function testHandleImipCancelOrganiserInReplyTo(): void {
$sender = 'clint@stardew-blacksmiths.com';
$recipient = 'pierre@general-store.com';
$replyTo = 'linus@stardew-tent-living.com';
$calendar = $this->createMock(ICreateFromString::class);
$calendar = $this->createMock(ICreateFromStringAndHandleImipMessage::class);
$calendarData = $this->getVCalendarCancel();

$this->time->expects(self::once())
Expand Down Expand Up @@ -532,7 +539,7 @@ public function testHandleImipCancel(): void {
$sender = 'linus@stardew-tent-living.com';
$recipient = 'pierre@general-store.com';
$replyTo = null;
$calendar = $this->createMock(ICreateFromString::class);
$calendar = $this->createMock(ICreateFromStringAndHandleImipMessage::class);
$calendarData = $this->getVCalendarCancel();

$this->time->expects(self::once())
Expand Down