-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3995 from HungDV2022/unittest_BcMailer_setEmailTr…
…ansport BcMailer::setEmailTransport() ユニットテスト
- Loading branch information
Showing
7 changed files
with
67 additions
and
88 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
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
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 |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
namespace BaserCore\Test\TestCase\Mailer; | ||
|
||
use BaserCore\Mailer\BcMailer; | ||
use BaserCore\Service\SiteConfigsServiceInterface; | ||
use BaserCore\Test\Factory\ContentFactory; | ||
use BaserCore\Test\Factory\SiteConfigFactory; | ||
use BaserCore\Test\Factory\SiteFactory; | ||
|
@@ -39,6 +40,9 @@ public function setUp(): void | |
parent::setUp(); | ||
SiteConfigFactory::make(['name' => 'email', 'value' => '[email protected]'])->persist(); | ||
SiteConfigFactory::make(['name' => 'admin-theme', 'value' => 'test theme'])->persist(); | ||
SiteConfigFactory::make(['name' => 'smtp_host', 'value' => '3306'])->persist(); | ||
SiteConfigFactory::make(['name' => 'smtp_user', 'value' => 'gmail.com'])->persist(); | ||
SiteConfigFactory::make(['name' => 'smtp_password', 'value' => '123456'])->persist(); | ||
SiteFactory::make(['id' => '1', 'theme' => 'BcFront', 'status' => true])->persist(); | ||
ContentFactory::make(['id' => 1, 'plugin' => 'BcMail', 'type' => 'MailContent', 'entity_id' => 1, 'url' => '/contact/', 'site_id' => 1, 'lft' => 1, 'rght' => 2])->persist(); | ||
Router::setRequest($this->getRequest('/contact/')); | ||
|
@@ -69,23 +73,26 @@ public function test__construct() | |
*/ | ||
public function testSetEmailTransport() | ||
{ | ||
$this->markTestIncomplete('まだ実装されません'); | ||
$this->BcMailer->setEmailTransport(); | ||
$this->assertEquals('Smtp', $this->BcMailer->getTransport()->getConfig('className')); | ||
} | ||
|
||
/** | ||
* test getPlugin | ||
*/ | ||
public function testGetPlugint() | ||
public function testGetPlugin() | ||
{ | ||
$this->markTestIncomplete('まだ実装されません'); | ||
$this->assertEquals('BaserCore', $this->BcMailer->getPlugin()); | ||
} | ||
|
||
/** | ||
* test deliver | ||
*/ | ||
public function testDeliver() | ||
{ | ||
$this->markTestIncomplete('まだ実装されません'); | ||
$siteConfigsService = $this->getService(SiteConfigsServiceInterface::class); | ||
$siteConfigsService->sendTestMail(['email' => '[email protected]'], '[email protected]', 'メール送信テスト', 'メール送信テスト'); | ||
$this->assertNotNull($this->BcMailer->getMessage()); | ||
} | ||
|
||
} |
130 changes: 48 additions & 82 deletions
130
plugins/baser-core/tests/TestCase/Routing/Route/BcContentsRouteTest.php
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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