From: Joe Nahmias <jello@debian.org>
Date: Sun, 14 Sep 2025 21:46:33 -0400
Subject: fix remaining test errors and failures with PHPUnit 11.5

---
 tests/acceptance/Swift/DependencyContainerAcceptanceTest.php   |  5 ++---
 .../Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php     |  9 +++------
 tests/bug/Swift/Bug274Test.php                                 |  6 +++---
 tests/bug/Swift/Bug650Test.php                                 | 10 +++-------
 tests/bug/Swift/BugFileByteStreamConsecutiveReadCallsTest.php  |  2 +-
 .../unit/Swift/Mime/ContentEncoder/PlainContentEncoderTest.php |  6 +++---
 tests/unit/Swift/Mime/EmbeddedFileTest.php                     |  4 +---
 tests/unit/Swift/Mime/SimpleMessageTest.php                    |  4 +---
 tests/unit/Swift/Transport/EsmtpTransportTest.php              | 10 ++++------
 9 files changed, 21 insertions(+), 35 deletions(-)

diff --git a/tests/acceptance/Swift/DependencyContainerAcceptanceTest.php b/tests/acceptance/Swift/DependencyContainerAcceptanceTest.php
index 9c488e9..bf49790 100644
--- a/tests/acceptance/Swift/DependencyContainerAcceptanceTest.php
+++ b/tests/acceptance/Swift/DependencyContainerAcceptanceTest.php
@@ -1,14 +1,13 @@
 <?php
 
 require_once 'swift_required.php';
+use PHPUnit\Framework\Attributes\DoesNotPerformAssertions;
 
 //This is more of a "cross your fingers and hope it works" test!
 
 class Swift_DependencyContainerAcceptanceTest extends PHPUnit\Framework\TestCase
 {
-    /**
-     * @doesNotPerformAssertions
-     */
+    #[DoesNotPerformAssertions]
     public function testNoLookupsFail()
     {
         $di = Swift_DependencyContainer::getInstance();
diff --git a/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php b/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php
index 4c120c3..d5916f3 100644
--- a/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php
+++ b/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php
@@ -1,6 +1,7 @@
 <?php
 
 require_once __DIR__.'/AbstractStreamBufferAcceptanceTest.php';
+use PHPUnit\Framework\Attributes\DoesNotPerformAssertions;
 
 class Swift_Transport_StreamBuffer_ProcessAcceptanceTest extends Swift_Transport_StreamBuffer_AbstractStreamBufferAcceptanceTest
 {
@@ -16,9 +17,7 @@ class Swift_Transport_StreamBuffer_ProcessAcceptanceTest extends Swift_Transport
         parent::setUp();
     }
 
-    /**
-     * @doesNotPerformAssertions
-     */
+    #[DoesNotPerformAssertions]
     public function testReadLine()
     {
         if (true == getenv('GITHUB_ACTIONS')) {
@@ -28,9 +27,7 @@ class Swift_Transport_StreamBuffer_ProcessAcceptanceTest extends Swift_Transport
         }
     }
 
-    /**
-     * @doesNotPerformAssertions
-     */
+    #[DoesNotPerformAssertions]
     public function testWrite()
     {
         if (true == getenv('GITHUB_ACTIONS')) {
diff --git a/tests/bug/Swift/Bug274Test.php b/tests/bug/Swift/Bug274Test.php
index ea70312..079c33a 100644
--- a/tests/bug/Swift/Bug274Test.php
+++ b/tests/bug/Swift/Bug274Test.php
@@ -1,5 +1,7 @@
 <?php
 
+use PHPUnit\Framework\Attributes\DoesNotPerformAssertions;
+
 class Swift_Bug274Test extends \PHPUnit\Framework\TestCase
 {
     public function testEmptyFileNameAsAttachment()
@@ -11,9 +13,7 @@ class Swift_Bug274Test extends \PHPUnit\Framework\TestCase
         $message->attach(Swift_Attachment::fromPath(''));
     }
 
-    /**
-     * @doesNotPerformAssertions
-     */
+    #[DoesNotPerformAssertions]
     public function testNonEmptyFileNameAsAttachment()
     {
         $message = new Swift_Message();
diff --git a/tests/bug/Swift/Bug650Test.php b/tests/bug/Swift/Bug650Test.php
index 8050188..89319c3 100644
--- a/tests/bug/Swift/Bug650Test.php
+++ b/tests/bug/Swift/Bug650Test.php
@@ -1,16 +1,12 @@
 <?php
 
 use Egulias\EmailValidator\EmailValidator;
+use PHPUnit\Framework\Attributes\DataProvider;
 
 class Swift_Bug650Test extends \PHPUnit\Framework\TestCase
 {
-    /**
-     * @dataProvider encodingDataProvider
-     *
-     * @param string $name
-     * @param string $expectedEncodedName
-     */
-    public function testMailboxHeaderEncoding($name, $expectedEncodedName)
+    #[DataProvider('encodingDataProvider')]
+    public function testMailboxHeaderEncoding(string $name, string $expectedEncodedName)
     {
         $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory();
         $charStream = new Swift_CharacterStream_NgCharacterStream($factory, 'utf-8');
diff --git a/tests/bug/Swift/BugFileByteStreamConsecutiveReadCallsTest.php b/tests/bug/Swift/BugFileByteStreamConsecutiveReadCallsTest.php
index bffc6a5..be745fc 100644
--- a/tests/bug/Swift/BugFileByteStreamConsecutiveReadCallsTest.php
+++ b/tests/bug/Swift/BugFileByteStreamConsecutiveReadCallsTest.php
@@ -1,6 +1,6 @@
 <?php
 
-class Swift_FileByteStreamConsecutiveReadCalls extends \PHPUnit\Framework\TestCase
+class Swift_BugFileByteStreamConsecutiveReadCallsTest extends \PHPUnit\Framework\TestCase
 {
     public function testShouldThrowExceptionOnConsecutiveRead()
     {
diff --git a/tests/unit/Swift/Mime/ContentEncoder/PlainContentEncoderTest.php b/tests/unit/Swift/Mime/ContentEncoder/PlainContentEncoderTest.php
index 4b1f97c..63c518e 100644
--- a/tests/unit/Swift/Mime/ContentEncoder/PlainContentEncoderTest.php
+++ b/tests/unit/Swift/Mime/ContentEncoder/PlainContentEncoderTest.php
@@ -1,5 +1,7 @@
 <?php
 
+use PHPUnit\Framework\Attributes\DataProvider;
+
 class Swift_Mime_ContentEncoder_PlainContentEncoderTest extends \SwiftMailerTestCase
 {
     public function testNameCanBeSpecifiedInConstructor()
@@ -123,9 +125,7 @@ class Swift_Mime_ContentEncoder_PlainContentEncoderTest extends \SwiftMailerTest
         ];
     }
 
-    /**
-     * @dataProvider crlfProvider
-     */
+    #[DataProvider('crlfProvider')]
     public function testCanonicEncodeByteStreamGeneratesCorrectCrlf($test, $expected)
     {
         $encoder = $this->getEncoder('7bit', true);
diff --git a/tests/unit/Swift/Mime/EmbeddedFileTest.php b/tests/unit/Swift/Mime/EmbeddedFileTest.php
index 88d80c4..45e7235 100644
--- a/tests/unit/Swift/Mime/EmbeddedFileTest.php
+++ b/tests/unit/Swift/Mime/EmbeddedFileTest.php
@@ -2,11 +2,9 @@
 
 class Swift_Mime_EmbeddedFileTest extends Swift_Mime_AttachmentTest
 {
-    /**
-     * @doesNotPerformAssertions
-     */
     public function testNestingLevelIsAttachment()
     {
+        $this->markTestIncomplete('This test has not been implemented yet.',);
     }
 
     public function testNestingLevelIsEmbedded()
diff --git a/tests/unit/Swift/Mime/SimpleMessageTest.php b/tests/unit/Swift/Mime/SimpleMessageTest.php
index da4edac..95720b1 100644
--- a/tests/unit/Swift/Mime/SimpleMessageTest.php
+++ b/tests/unit/Swift/Mime/SimpleMessageTest.php
@@ -2,11 +2,9 @@
 
 class Swift_Mime_SimpleMessageTest extends Swift_Mime_MimePartTest
 {
-    /**
-     * @doesNotPerformAssertions
-     */
     public function testNestingLevelIsSubpart()
     {
+        $this->markTestIncomplete('This test has not been implemented yet.',);
     }
 
     public function testNestingLevelIsTop()
diff --git a/tests/unit/Swift/Transport/EsmtpTransportTest.php b/tests/unit/Swift/Transport/EsmtpTransportTest.php
index 82650f5..508fce6 100644
--- a/tests/unit/Swift/Transport/EsmtpTransportTest.php
+++ b/tests/unit/Swift/Transport/EsmtpTransportTest.php
@@ -1,5 +1,7 @@
 <?php
 
+use PHPUnit\Framework\Attributes\DataProvider;
+
 class Swift_Transport_EsmtpTransportTest extends Swift_Transport_AbstractSmtpEventSupportTest
 {
     protected function getTransport($buf, $dispatcher = null, $addressEncoder = null)
@@ -46,11 +48,9 @@ class Swift_Transport_EsmtpTransportTest extends Swift_Transport_AbstractSmtpEve
         $this->assertEquals('tls', $smtp->getEncryption(), '%s: Crypto should be returned');
     }
 
-    /**
-     * @doesNotPerformAssertions
-     */
     public function testStartSendsHeloToInitiate()
     {
+        $this->markTestIncomplete('This test has not been implemented yet.',);
     }
 
     public function testStartSendsEhloToInitiate()
@@ -589,9 +589,7 @@ class Swift_Transport_EsmtpTransportTest extends Swift_Transport_AbstractSmtpEve
         ];
     }
 
-    /**
-     * @dataProvider providerPipeliningOverride
-     */
+    #[DataProvider('providerPipeliningOverride')]
     public function testPipeliningOverride($enabled, bool $supported, bool $expected)
     {
         $buf = $this->getBuffer();
