-
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 branch '5.1.x' of github.com:baserproject/basercms into 5.1.x
- Loading branch information
Showing
16 changed files
with
233 additions
and
14 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
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
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
66 changes: 66 additions & 0 deletions
66
plugins/bc-installer/tests/TestCase/Mailer/Admin/InstallerMailerTest.php
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,66 @@ | ||
<?php | ||
/** | ||
* baserCMS : Based Website Development Project <https://basercms.net> | ||
* Copyright (c) baserCMS Users Community <https://basercms.net/community/> | ||
* | ||
* @copyright Copyright (c) baserCMS Users Community | ||
* @link https://basercms.net baserCMS Project | ||
* @since baserCMS v 4.0.9 | ||
* @license https://basercms.net/license/index.html | ||
*/ | ||
|
||
namespace BcInstaller\Test\TestCase\Mailer\Admin; | ||
use BaserCore\Test\Factory\SiteConfigFactory; | ||
use BaserCore\Test\Factory\SiteFactory; | ||
use BaserCore\TestSuite\BcTestCase; | ||
use BcInstaller\Mailer\Admin\InstallerMailer; | ||
use Cake\TestSuite\EmailTrait; | ||
|
||
/** | ||
* Class InstallerMailerTest | ||
* | ||
* @property InstallerMailer $InstallerMailer | ||
*/ | ||
class InstallerMailerTest extends BcTestCase | ||
{ | ||
|
||
use EmailTrait; | ||
|
||
/** | ||
* setup | ||
*/ | ||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
SiteConfigFactory::make(['name' => 'email', 'value' => 'basertest@example.com'])->persist(); | ||
SiteFactory::make(['id' => 1, 'display_name' => 'main site'])->persist(); | ||
|
||
$this->InstallerMailer = new InstallerMailer(); | ||
} | ||
|
||
/** | ||
* tearDown | ||
* | ||
* @return void | ||
*/ | ||
public function tearDown(): void | ||
{ | ||
parent::tearDown(); | ||
} | ||
|
||
/** | ||
* beforeFilter | ||
*/ | ||
public function testInstalled() | ||
{ | ||
$this->InstallerMailer->installed('test@example.com'); | ||
|
||
//戻り値確認 | ||
$this->assertEquals(['test@example.com' => 'test@example.com'], $this->InstallerMailer->getTo()); | ||
$vars = $this->InstallerMailer->viewBuilder()->getVars(); | ||
$this->assertEquals('test@example.com', $vars['email']); | ||
$this->assertEquals('https://localhost/', $vars['siteUrl']); | ||
$this->assertEquals('https://localhost/baser/admin/baser-core/users/login', $vars['adminUrl']); | ||
} | ||
|
||
} |
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
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
Oops, something went wrong.