Skip to content

Commit 30f0153

Browse files
committed
Implement generic version of testUnmarshalling
1 parent 5a07d07 commit 30f0153

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+11
-647
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"ext-spl": "*",
4444

4545
"simplesamlphp/assert": "^1.0",
46-
"simplesamlphp/xml-common": "^1.13"
46+
"simplesamlphp/xml-common": "^1.14"
4747
},
4848
"require-dev": {
4949
"simplesamlphp/simplesamlphp-test-framework": "^1.5"

phpunit.xml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" bootstrap="./tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" bootstrap="./tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
33
<coverage>
4-
<include>
5-
<directory suffix=".php">./src/</directory>
6-
</include>
7-
<exclude>
8-
<directory>./vendor/</directory>
9-
<directory>./tests/</directory>
10-
</exclude>
114
<report>
125
<clover outputFile="build/logs/clover.xml"/>
136
</report>
@@ -17,4 +10,13 @@
1710
<directory>./tests</directory>
1811
</testsuite>
1912
</testsuites>
13+
<source>
14+
<include>
15+
<directory suffix=".php">./src/</directory>
16+
</include>
17+
<exclude>
18+
<directory>./vendor/</directory>
19+
<directory>./tests/</directory>
20+
</exclude>
21+
</source>
2022
</phpunit>

tests/XML/CustomSignableTest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,4 @@ public function testMarshalling(): void
6060
strval($customSignable),
6161
);
6262
}
63-
64-
65-
/**
66-
*/
67-
public function testUnmarshalling(): void
68-
{
69-
$customSignable = CustomSignable::fromXML(self::$xmlRepresentation->documentElement);
70-
71-
$this->assertEquals(
72-
self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement),
73-
strval($customSignable),
74-
);
75-
}
7663
}

tests/XML/SignableElementTest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -253,17 +253,4 @@ public function testSigningWithDifferentRoot(): void
253253
);
254254
$customSignable->toXML($doc->documentElement);
255255
}
256-
257-
258-
/**
259-
*/
260-
public function testUnmarshalling(): void
261-
{
262-
$customSignable = CustomSignable::fromXML(self::$xmlRepresentation->documentElement);
263-
264-
$this->assertEquals(
265-
self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement),
266-
strval($customSignable),
267-
);
268-
}
269256
}

tests/XML/ds/CanonicalizationMethodTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,4 @@ public function testMarshalling(): void
5252
strval($canonicalizationMethod),
5353
);
5454
}
55-
56-
57-
/**
58-
*/
59-
public function testUnmarshalling(): void
60-
{
61-
$canonicalizationMethod = CanonicalizationMethod::fromXML(self::$xmlRepresentation->documentElement);
62-
63-
$this->assertEquals(C::C14N_EXCLUSIVE_WITHOUT_COMMENTS, $canonicalizationMethod->getAlgorithm());
64-
}
6555
}

tests/XML/ds/DigestMethodTest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,4 @@ public function testMarshalling(): void
6161
strval($digestMethod),
6262
);
6363
}
64-
65-
66-
/**
67-
*/
68-
public function testUnmarshalling(): void
69-
{
70-
$digestMethod = DigestMethod::fromXML(self::$xmlRepresentation->documentElement);
71-
72-
$this->assertEquals(
73-
self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement),
74-
strval($digestMethod),
75-
);
76-
}
7764
}

tests/XML/ds/DigestValueTest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,4 @@ public function testMarshallingNotBase64(): void
6363
$this->expectException(AssertionFailedException::class);
6464
new DigestValue('/CTj3d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=');
6565
}
66-
67-
68-
/**
69-
*/
70-
public function testUnmarshalling(): void
71-
{
72-
$digestValue = DigestValue::fromXML(self::$xmlRepresentation->documentElement);
73-
74-
$this->assertEquals(
75-
self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement),
76-
strval($digestValue),
77-
);
78-
}
7966
}

tests/XML/ds/ExponentTest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,4 @@ public function testMarshallingNotBase64(): void
5959
$this->expectException(SchemaViolationException::class);
6060
new Exponent('/CTj3d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=');
6161
}
62-
63-
64-
/**
65-
*/
66-
public function testUnmarshalling(): void
67-
{
68-
$exponent = Exponent::fromXML(self::$xmlRepresentation->documentElement);
69-
70-
$this->assertEquals(
71-
self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement),
72-
strval($exponent),
73-
);
74-
}
7562
}

tests/XML/ds/KeyInfoTest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -120,19 +120,6 @@ public function testMarshallingEmpty(): void
120120
}
121121

122122

123-
/**
124-
*/
125-
public function testUnmarshalling(): void
126-
{
127-
$keyInfo = KeyInfo::fromXML(self::$xmlRepresentation->documentElement);
128-
129-
$this->assertEquals(
130-
self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement),
131-
strval($keyInfo),
132-
);
133-
}
134-
135-
136123
/**
137124
*/
138125
public function testUnmarshallingEmpty(): void

tests/XML/ds/KeyNameTest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,4 @@ public function testMarshalling(): void
5151
strval($keyName),
5252
);
5353
}
54-
55-
56-
/**
57-
*/
58-
public function testUnmarshalling(): void
59-
{
60-
$keyName = KeyName::fromXML(self::$xmlRepresentation->documentElement);
61-
62-
$this->assertEquals(
63-
self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement),
64-
strval($keyName),
65-
);
66-
}
6754
}

0 commit comments

Comments
 (0)