Skip to content

Commit

Permalink
unify DSN for ArrayTransport
Browse files Browse the repository at this point in the history
  • Loading branch information
klimov-paul committed May 10, 2024
1 parent e87c8ef commit 04557fd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
13 changes: 7 additions & 6 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

### Additional info

| Q | A
|-----------------------| ---
| This Package Version | 1.?.?
| Yii Framework Version | 1.1.?
| PHP version |
| Operating system |
| Q | A
|------------------------| ---
| This Package Version | 1.?.?
| Yii Framework Version | 1.1.?
| Symfony Mailer Version | 7.0.?
| PHP version |
| Operating system |
2 changes: 1 addition & 1 deletion src/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function getTransport(): TransportInterface
throw new \LogicException('Either "' . get_class($this) . '::$dsn" or "' . get_class($this) . '::$transport" property should be set.');
}

if ($this->dsn === 'array' || stripos($this->dsn, 'array://') !== false) {
if ($this->dsn === 'array://') {
$this->_transport = new ArrayTransport();
} else {
$this->_transport = Transport::fromDsn($this->dsn);
Expand Down
2 changes: 1 addition & 1 deletion src/transport/ArrayTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
* This transport can be useful while writing unit tests.
*
* In {@see \yii1tech\mailer\Mailer::getTransport()} this transport will be created for DSN 'array' or 'array://'.
* In {@see \yii1tech\mailer\Mailer::getTransport()} this transport will be created for DSN 'array://'.
*
* @author Paul Klimov <[email protected]>
* @since 1.0
Expand Down
7 changes: 0 additions & 7 deletions tests/MailerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ public function testCreateTransportFromCallable(): void
public function testCreateArrayTransport(): void
{
/** @var Mailer $mailer */
$mailer = Yii::createComponent([
'class' => Mailer::class,
'dsn' => 'array',
]);

$this->assertTrue($mailer->getTransport() instanceof ArrayTransport);

$mailer = Yii::createComponent([
'class' => Mailer::class,
'dsn' => 'array://',
Expand Down

0 comments on commit 04557fd

Please sign in to comment.