Skip to content

Commit ccc5fb2

Browse files
Remove no-op ReflectionProperty::setAccessible() calls
1 parent 2cf98fa commit ccc5fb2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Tests/Transport/SendmailTransportTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ public function testThrowsTransportExceptionOnFailure()
9494
$sendmailTransport->send($mail, $envelope);
9595

9696
$streamProperty = new \ReflectionProperty(SendmailTransport::class, 'stream');
97-
$streamProperty->setAccessible(true);
9897
$stream = $streamProperty->getValue($sendmailTransport);
98+
9999
$this->assertNull($stream->stream);
100100
}
101101

@@ -112,10 +112,9 @@ public function testStreamIsClearedOnFailure()
112112
}
113113

114114
$streamProperty = new \ReflectionProperty(SendmailTransport::class, 'stream');
115-
$streamProperty->setAccessible(true);
116115
$stream = $streamProperty->getValue($sendmailTransport);
117116
$innerStreamProperty = new \ReflectionProperty(ProcessStream::class, 'stream');
118-
$innerStreamProperty->setAccessible(true);
117+
119118
$this->assertNull($innerStreamProperty->getValue($stream));
120119
}
121120

@@ -127,7 +126,6 @@ public function testDoesNotThrowWhenInteractive()
127126

128127
$sendmailTransport = new SendmailTransport(self::FAKE_INTERACTIVE_SENDMAIL);
129128
$transportProperty = new \ReflectionProperty(SendmailTransport::class, 'transport');
130-
$transportProperty->setAccessible(true);
131129

132130
// Replace the transport with an anonymous consumer that trigger the stream methods
133131
$transportProperty->setValue($sendmailTransport, new class($transportProperty->getValue($sendmailTransport)->getStream()) extends SmtpTransport {

0 commit comments

Comments
 (0)