forked from nextcloud/server
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP feat: allow custom mailer - adding tests
Signed-off-by: Misha M.-Kupriyanov <[email protected]>
- Loading branch information
1 parent
251bbfa
commit 4e910db
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace Test\Mail; | ||
|
||
use OCP\Defaults; | ||
use OCP\EventDispatcher\IEventDispatcher; | ||
use OCP\IConfig; | ||
use OCP\IL10N; | ||
use OCP\IURLGenerator; | ||
use OCP\L10N\IFactory; | ||
use OCP\Mail\IAttachment; | ||
use OCP\Mail\IEMailTemplate; | ||
use OCP\Mail\IMessage; | ||
use Psr\Log\LoggerInterface; | ||
|
||
/** | ||
* Class FakeMailer | ||
*/ | ||
class FakeMailer implements \OCP\Mail\IMailer { | ||
|
||
public function __construct( | ||
private IConfig $config, | ||
private LoggerInterface $logger, | ||
private Defaults $defaults, | ||
private IURLGenerator $urlGenerator, | ||
private IL10N $l10n, | ||
private IEventDispatcher $dispatcher, | ||
private IFactory $l10nFactory, | ||
) { | ||
} | ||
public function createMessage(): IMessage { | ||
} | ||
|
||
public function createAttachment($data = null, $filename = null, $contentType = null): IAttachment { | ||
} | ||
|
||
public function createAttachmentFromPath(string $path, $contentType = null): IAttachment { | ||
} | ||
|
||
public function createEMailTemplate(string $emailId, array $data = []): IEMailTemplate { | ||
} | ||
|
||
public function send(IMessage $message): array { | ||
} | ||
|
||
public function validateMailAddress(string $email): bool { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters