Skip to content

Commit

Permalink
Added missing test
Browse files Browse the repository at this point in the history
  • Loading branch information
PeeHaa committed Jan 14, 2019
1 parent d9c8d02 commit 9f069ae
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Security

*None*

## [0.0.2]

### Added

*None*

### Changed

- [[d9c8d02](https://github.com/HarmonyIO/Smtp-Client/commit/d9c8d02ef78b3e44bb217e5c2b256d43e51cc6f3)] Refactored entire SMTP session and transaction flow

### Deprecated

*None*

### Removed

*None*

### Fixed

*None*

### Security

*None*
17 changes: 17 additions & 0 deletions tests/Unit/Transaction/Processor/Mail/ProcessRecipientsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,23 @@ public function testProcessKeepsSendingRecipientsAfterPermanentError(): void
$this->assertSame(Status::SENT_RECIPIENTS, $status->getValue());
}

public function testProcessResultsInSentRecipientsStatusWhenLastRecipientErrors(): void
{
$this->smtpSocket
->method('read')
->willReturnOnConsecutiveCalls(
new Success("200 success\r\n"),
new Success("500 error\r\n"),
new Success("500 success\r\n")
)
;

/** @var Status $status */
$status = wait($this->processor->process(new Buffer($this->smtpSocket, $this->logger)));

$this->assertSame(Status::SENT_RECIPIENTS, $status->getValue());
}

public function testProcessSendsAllRecipientsWhenAllAreAccepted(): void
{
$this->smtpSocket
Expand Down

0 comments on commit 9f069ae

Please sign in to comment.