-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update tests to ensure MailMessage implements the fluent interface pa…
…ttern
- Loading branch information
Showing
1 changed file
with
22 additions
and
22 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 |
---|---|---|
|
@@ -26,65 +26,65 @@ protected function setUp(): void | |
|
||
public function testFromMethod() | ||
{ | ||
$this->assertInstanceOf(Message::class, $message = $this->message->from('[email protected]', 'Foo')); | ||
$this->assertEquals(new Address('[email protected]', 'Foo'), $message->getSymfonyMessage()->getFrom()[0]); | ||
$this->assertSame($this->message, $this->message->from('[email protected]', 'Foo')); | ||
$this->assertEquals(new Address('[email protected]', 'Foo'), $this->message->getSymfonyMessage()->getFrom()[0]); | ||
} | ||
|
||
public function testSenderMethod() | ||
{ | ||
$this->assertInstanceOf(Message::class, $message = $this->message->sender('[email protected]', 'Foo')); | ||
$this->assertEquals(new Address('[email protected]', 'Foo'), $message->getSymfonyMessage()->getSender()); | ||
$this->assertSame($this->message, $this->message->sender('[email protected]', 'Foo')); | ||
$this->assertEquals(new Address('[email protected]', 'Foo'), $this->message->getSymfonyMessage()->getSender()); | ||
} | ||
|
||
public function testReturnPathMethod() | ||
{ | ||
$this->assertInstanceOf(Message::class, $message = $this->message->returnPath('[email protected]')); | ||
$this->assertEquals(new Address('[email protected]'), $message->getSymfonyMessage()->getReturnPath()); | ||
$this->assertSame($this->message, $this->message->returnPath('[email protected]')); | ||
$this->assertEquals(new Address('[email protected]'), $this->message->getSymfonyMessage()->getReturnPath()); | ||
} | ||
|
||
public function testToMethod() | ||
{ | ||
$this->assertInstanceOf(Message::class, $message = $this->message->to('[email protected]', 'Foo')); | ||
$this->assertEquals(new Address('[email protected]', 'Foo'), $message->getSymfonyMessage()->getTo()[0]); | ||
$this->assertSame($this->message, $this->message->to('[email protected]', 'Foo')); | ||
$this->assertEquals(new Address('[email protected]', 'Foo'), $this->message->getSymfonyMessage()->getTo()[0]); | ||
|
||
$this->assertInstanceOf(Message::class, $message = $this->message->to(['[email protected]' => 'Bar'])); | ||
$this->assertEquals(new Address('[email protected]', 'Bar'), $message->getSymfonyMessage()->getTo()[0]); | ||
$this->assertSame($this->message, $this->message->to(['[email protected]' => 'Bar'])); | ||
$this->assertEquals(new Address('[email protected]', 'Bar'), $this->message->getSymfonyMessage()->getTo()[0]); | ||
} | ||
|
||
public function testToMethodWithOverride() | ||
{ | ||
$this->assertInstanceOf(Message::class, $message = $this->message->to('[email protected]', 'Foo', true)); | ||
$this->assertEquals(new Address('[email protected]', 'Foo'), $message->getSymfonyMessage()->getTo()[0]); | ||
$this->assertSame($this->message, $this->message->to('[email protected]', 'Foo', true)); | ||
$this->assertEquals(new Address('[email protected]', 'Foo'), $this->message->getSymfonyMessage()->getTo()[0]); | ||
} | ||
|
||
public function testCcMethod() | ||
{ | ||
$this->assertInstanceOf(Message::class, $message = $this->message->cc('[email protected]', 'Foo')); | ||
$this->assertEquals(new Address('[email protected]', 'Foo'), $message->getSymfonyMessage()->getCc()[0]); | ||
$this->assertSame($this->message, $this->message->cc('[email protected]', 'Foo')); | ||
$this->assertEquals(new Address('[email protected]', 'Foo'), $this->message->getSymfonyMessage()->getCc()[0]); | ||
} | ||
|
||
public function testBccMethod() | ||
{ | ||
$this->assertInstanceOf(Message::class, $message = $this->message->bcc('[email protected]', 'Foo')); | ||
$this->assertEquals(new Address('[email protected]', 'Foo'), $message->getSymfonyMessage()->getBcc()[0]); | ||
$this->assertSame($this->message, $this->message->bcc('[email protected]', 'Foo')); | ||
$this->assertEquals(new Address('[email protected]', 'Foo'), $this->message->getSymfonyMessage()->getBcc()[0]); | ||
} | ||
|
||
public function testReplyToMethod() | ||
{ | ||
$this->assertInstanceOf(Message::class, $message = $this->message->replyTo('[email protected]', 'Foo')); | ||
$this->assertEquals(new Address('[email protected]', 'Foo'), $message->getSymfonyMessage()->getReplyTo()[0]); | ||
$this->assertSame($this->message, $this->message->replyTo('[email protected]', 'Foo')); | ||
$this->assertEquals(new Address('[email protected]', 'Foo'), $this->message->getSymfonyMessage()->getReplyTo()[0]); | ||
} | ||
|
||
public function testSubjectMethod() | ||
{ | ||
$this->assertInstanceOf(Message::class, $message = $this->message->subject('foo')); | ||
$this->assertSame('foo', $message->getSymfonyMessage()->getSubject()); | ||
$this->assertSame($this->message, $this->message->subject('foo')); | ||
$this->assertSame('foo', $this->message->getSymfonyMessage()->getSubject()); | ||
} | ||
|
||
public function testPriorityMethod() | ||
{ | ||
$this->assertInstanceOf(Message::class, $message = $this->message->priority(1)); | ||
$this->assertEquals(1, $message->getSymfonyMessage()->getPriority()); | ||
$this->assertSame($this->message, $this->message->priority(1)); | ||
$this->assertEquals(1, $this->message->getSymfonyMessage()->getPriority()); | ||
} | ||
|
||
public function testBasicAttachment() | ||
|