66
77use LogicException ;
88use PHPUnit \Framework \Attributes \Depends ;
9+ use PHPUnit \Framework \Attributes \DoesNotPerformAssertions ;
910use PHPUnit \Framework \Attributes \Group ;
1011use PHPUnit \Framework \TestCase ;
1112use SimpleSAML \XMLSecurity \CryptoEncoding \PEM ;
@@ -35,11 +36,10 @@ public static function setUpBeforeClass(): void
3536 /**
3637 * @return \SimpleSAML\XMLSecurity\CryptoEncoding\PEMBundle
3738 */
39+ #[DoesNotPerformAssertions]
3840 public function testBundle (): PEMBundle
3941 {
40- $ bundle = PEMBundle::fromFile (self ::$ baseDir . '/resources/certificates/cacert.pem ' );
41- $ this ->assertInstanceOf (PEMBundle::class, $ bundle );
42- return $ bundle ;
42+ return PEMBundle::fromFile (self ::$ baseDir . '/resources/certificates/cacert.pem ' );
4343 }
4444
4545
@@ -49,7 +49,6 @@ public function testBundle(): PEMBundle
4949 #[Depends('testBundle ' )]
5050 public function testAll (PEMBundle $ bundle ): void
5151 {
52- // @phpstan-ignore method.alreadyNarrowedType
5352 $ this ->assertContainsOnlyInstancesOf (PEM ::class, $ bundle ->all ());
5453 }
5554
@@ -60,7 +59,6 @@ public function testAll(PEMBundle $bundle): void
6059 #[Depends('testBundle ' )]
6160 public function testFirst (PEMBundle $ bundle ): void
6261 {
63- $ this ->assertInstanceOf (PEM ::class, $ bundle ->first ());
6462 $ this ->assertEquals ($ bundle ->all ()[0 ], $ bundle ->first ());
6563 }
6664
@@ -71,7 +69,6 @@ public function testFirst(PEMBundle $bundle): void
7169 #[Depends('testBundle ' )]
7270 public function testLast (PEMBundle $ bundle ): void
7371 {
74- $ this ->assertInstanceOf (PEM ::class, $ bundle ->last ());
7572 $ this ->assertEquals ($ bundle ->all ()[149 ], $ bundle ->last ());
7673 }
7774
@@ -96,7 +93,6 @@ public function testIterator(PEMBundle $bundle): void
9693 foreach ($ bundle as $ pem ) {
9794 $ values [] = $ pem ;
9895 }
99- // @phpstan-ignore method.alreadyNarrowedType
10096 $ this ->assertContainsOnlyInstancesOf (PEM ::class, $ values );
10197 }
10298
0 commit comments