1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
|
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();
|