Skip to content

Commit fa5e291

Browse files
committed
Do not perform useless assertions.
1 parent 81644bd commit fa5e291

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

tests/XML/SchemaValidatableElementTraitTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace SimpleSAML\Test\XML;
66

7-
use DOMDocument;
7+
use PHPUnit\Framework\Attributes\DoesNotPerformAssertions;
88
use PHPUnit\Framework\TestCase;
99
use SimpleSAML\Test\Helper\Base64BinaryElement;
1010
use SimpleSAML\Test\Helper\BooleanElement;
@@ -20,14 +20,13 @@
2020
*/
2121
final class SchemaValidatableElementTraitTest extends TestCase
2222
{
23+
#[DoesNotPerformAssertions]
2324
public function testSchemaValidationPasses(): void
2425
{
2526
$file = 'tests/resources/xml/ssp_StringElement.xml';
2627
$chunk = DOMDocumentFactory::fromFile($file);
2728

2829
$document = StringElement::schemaValidate($chunk);
29-
// @phpstan-ignore-next-line
30-
$this->assertInstanceOf(DOMDocument::class, $document);
3130
}
3231

3332

tests/XML/TypedTextContentTraitTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace SimpleSAML\Test\XML;
66

7+
use PHPUnit\Framework\Attributes\DoesNotPerformAssertions;
78
use PHPUnit\Framework\TestCase;
89
use SimpleSAML\Test\Helper\Base64BinaryElement;
910
use SimpleSAML\Test\Helper\BooleanElement;
@@ -19,6 +20,7 @@
1920
*/
2021
final class TypedTextContentTraitTest extends TestCase
2122
{
23+
#[DoesNotPerformAssertions]
2224
public function testTypedContentPassesForString(): void
2325
{
2426
$file = 'tests/resources/xml/ssp_StringElement.xml';
@@ -27,11 +29,10 @@ public function testTypedContentPassesForString(): void
2729
$elt = $doc->documentElement;
2830

2931
$stringElt = StringElement::fromXML($elt);
30-
// @phpstan-ignore-next-line
31-
$this->assertInstanceOf(StringElement::class, $stringElt);
3232
}
3333

3434

35+
#[DoesNotPerformAssertions]
3536
public function testTypedContentPassesForBoolean(): void
3637
{
3738
$file = 'tests/resources/xml/ssp_BooleanElement.xml';
@@ -40,8 +41,6 @@ public function testTypedContentPassesForBoolean(): void
4041
$elt = $doc->documentElement;
4142

4243
$stringElt = BooleanElement::fromXML($elt);
43-
// @phpstan-ignore-next-line
44-
$this->assertInstanceOf(BooleanElement::class, $stringElt);
4544
}
4645

4746

0 commit comments

Comments
 (0)