From: Joe Nahmias <jello@debian.org>
Date: Thu, 11 Sep 2025 22:36:05 -0400
Subject: do not use addToAssertionCount() in empty tests

label tests that do not make assertions appropriately
or mark them as incomplete if empty
---
 tests/acceptance/Swift/DependencyContainerAcceptanceTest.php        | 5 +++--
 .../Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php          | 6 ++++++
 tests/bug/Swift/Bug274Test.php                                      | 4 +++-
 tests/unit/Swift/MessageTest.php                                    | 4 ----
 tests/unit/Swift/Mime/EmbeddedFileTest.php                          | 5 +++--
 tests/unit/Swift/Mime/SimpleMessageTest.php                         | 5 +++--
 tests/unit/Swift/Signers/OpenDKIMSignerTest.php                     | 6 ++++++
 tests/unit/Swift/Transport/EsmtpTransportTest.php                   | 5 +++--
 8 files changed, 27 insertions(+), 13 deletions(-)

diff --git a/tests/acceptance/Swift/DependencyContainerAcceptanceTest.php b/tests/acceptance/Swift/DependencyContainerAcceptanceTest.php
index 3c1b515..9c488e9 100644
--- a/tests/acceptance/Swift/DependencyContainerAcceptanceTest.php
+++ b/tests/acceptance/Swift/DependencyContainerAcceptanceTest.php
@@ -6,6 +6,9 @@ require_once 'swift_required.php';
 
 class Swift_DependencyContainerAcceptanceTest extends PHPUnit\Framework\TestCase
 {
+    /**
+     * @doesNotPerformAssertions
+     */
     public function testNoLookupsFail()
     {
         $di = Swift_DependencyContainer::getInstance();
@@ -16,7 +19,5 @@ class Swift_DependencyContainerAcceptanceTest extends PHPUnit\Framework\TestCase
                 $this->fail($e->getMessage());
             }
         }
-        // previous loop would fail if there is an issue
-        $this->addToAssertionCount(1);
     }
 }
diff --git a/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php b/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php
index 68ad21e..4c120c3 100644
--- a/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php
+++ b/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php
@@ -16,6 +16,9 @@ class Swift_Transport_StreamBuffer_ProcessAcceptanceTest extends Swift_Transport
         parent::setUp();
     }
 
+    /**
+     * @doesNotPerformAssertions
+     */
     public function testReadLine()
     {
         if (true == getenv('GITHUB_ACTIONS')) {
@@ -25,6 +28,9 @@ class Swift_Transport_StreamBuffer_ProcessAcceptanceTest extends Swift_Transport
         }
     }
 
+    /**
+     * @doesNotPerformAssertions
+     */
     public function testWrite()
     {
         if (true == getenv('GITHUB_ACTIONS')) {
diff --git a/tests/bug/Swift/Bug274Test.php b/tests/bug/Swift/Bug274Test.php
index 9fff072..ea70312 100644
--- a/tests/bug/Swift/Bug274Test.php
+++ b/tests/bug/Swift/Bug274Test.php
@@ -11,6 +11,9 @@ class Swift_Bug274Test extends \PHPUnit\Framework\TestCase
         $message->attach(Swift_Attachment::fromPath(''));
     }
 
+    /**
+     * @doesNotPerformAssertions
+     */
     public function testNonEmptyFileNameAsAttachment()
     {
         $message = new Swift_Message();
@@ -19,6 +22,5 @@ class Swift_Bug274Test extends \PHPUnit\Framework\TestCase
         } catch (Exception $e) {
             $this->fail('Path should not be empty');
         }
-        $this->addToAssertionCount(1);
     }
 }
diff --git a/tests/unit/Swift/MessageTest.php b/tests/unit/Swift/MessageTest.php
index 1c3f894..7b2d3cc 100644
--- a/tests/unit/Swift/MessageTest.php
+++ b/tests/unit/Swift/MessageTest.php
@@ -9,8 +9,6 @@ class Swift_MessageTest extends \PHPUnit\Framework\TestCase
         $message1_clone = clone $message1;
 
         $this->recursiveObjectCloningCheck($message1, $message2, $message1_clone);
-        // the test above will fail if the two messages are not identical
-        $this->addToAssertionCount(1);
     }
 
     public function testCloningWithSigners()
@@ -24,8 +22,6 @@ class Swift_MessageTest extends \PHPUnit\Framework\TestCase
         $message1_clone = clone $message1;
 
         $this->recursiveObjectCloningCheck($message1, $message2, $message1_clone);
-        // the test above will fail if the two messages are not identical
-        $this->addToAssertionCount(1);
     }
 
     public function testBodySwap()
diff --git a/tests/unit/Swift/Mime/EmbeddedFileTest.php b/tests/unit/Swift/Mime/EmbeddedFileTest.php
index 5476fad..88d80c4 100644
--- a/tests/unit/Swift/Mime/EmbeddedFileTest.php
+++ b/tests/unit/Swift/Mime/EmbeddedFileTest.php
@@ -2,10 +2,11 @@
 
 class Swift_Mime_EmbeddedFileTest extends Swift_Mime_AttachmentTest
 {
+    /**
+     * @doesNotPerformAssertions
+     */
     public function testNestingLevelIsAttachment()
     {
-        // previous loop would fail if there is an issue
-        $this->addToAssertionCount(1);
     }
 
     public function testNestingLevelIsEmbedded()
diff --git a/tests/unit/Swift/Mime/SimpleMessageTest.php b/tests/unit/Swift/Mime/SimpleMessageTest.php
index 1b6687a..da4edac 100644
--- a/tests/unit/Swift/Mime/SimpleMessageTest.php
+++ b/tests/unit/Swift/Mime/SimpleMessageTest.php
@@ -2,10 +2,11 @@
 
 class Swift_Mime_SimpleMessageTest extends Swift_Mime_MimePartTest
 {
+    /**
+     * @doesNotPerformAssertions
+     */
     public function testNestingLevelIsSubpart()
     {
-        // not relevant
-        $this->addToAssertionCount(1);
     }
 
     public function testNestingLevelIsTop()
diff --git a/tests/unit/Swift/Signers/OpenDKIMSignerTest.php b/tests/unit/Swift/Signers/OpenDKIMSignerTest.php
index 894a433..88cada5 100644
--- a/tests/unit/Swift/Signers/OpenDKIMSignerTest.php
+++ b/tests/unit/Swift/Signers/OpenDKIMSignerTest.php
@@ -16,30 +16,36 @@ class Swift_Signers_OpenDKIMSignerTest extends \SwiftMailerTestCase
 
     public function testBasicSigningHeaderManipulation()
     {
+        $this->markTestIncomplete('This test has not been implemented yet.');
     }
 
     // Default Signing
     public function testSigningDefaults()
     {
+        $this->markTestIncomplete('This test has not been implemented yet.');
     }
 
     // SHA256 Signing
     public function testSigning256()
     {
+        $this->markTestIncomplete('This test has not been implemented yet.');
     }
 
     // Relaxed/Relaxed Hash Signing
     public function testSigningRelaxedRelaxed256()
     {
+        $this->markTestIncomplete('This test has not been implemented yet.');
     }
 
     // Relaxed/Simple Hash Signing
     public function testSigningRelaxedSimple256()
     {
+        $this->markTestIncomplete('This test has not been implemented yet.');
     }
 
     // Simple/Relaxed Hash Signing
     public function testSigningSimpleRelaxed256()
     {
+        $this->markTestIncomplete('This test has not been implemented yet.');
     }
 }
diff --git a/tests/unit/Swift/Transport/EsmtpTransportTest.php b/tests/unit/Swift/Transport/EsmtpTransportTest.php
index 31cfa12..82650f5 100644
--- a/tests/unit/Swift/Transport/EsmtpTransportTest.php
+++ b/tests/unit/Swift/Transport/EsmtpTransportTest.php
@@ -46,10 +46,11 @@ class Swift_Transport_EsmtpTransportTest extends Swift_Transport_AbstractSmtpEve
         $this->assertEquals('tls', $smtp->getEncryption(), '%s: Crypto should be returned');
     }
 
+    /**
+     * @doesNotPerformAssertions
+     */
     public function testStartSendsHeloToInitiate()
     {
-        // previous loop would fail if there is an issue
-        $this->addToAssertionCount(1);
     }
 
     public function testStartSendsEhloToInitiate()
