diff --git a/CHANGELOG.md b/CHANGELOG.md index 881c7fc..e34779d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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* diff --git a/tests/Unit/Transaction/Processor/Mail/ProcessRecipientsTest.php b/tests/Unit/Transaction/Processor/Mail/ProcessRecipientsTest.php index 09cf09a..fb750ed 100644 --- a/tests/Unit/Transaction/Processor/Mail/ProcessRecipientsTest.php +++ b/tests/Unit/Transaction/Processor/Mail/ProcessRecipientsTest.php @@ -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