Commit caf6942 1 parent d2b0100 commit caf6942 Copy full SHA for caf6942
File tree 2 files changed +12
-6
lines changed
2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -29,5 +29,10 @@ final class Base64BinaryElement extends AbstractElement implements SchemaValidat
29
29
public const SCHEMA = 'tests/resources/schemas/deliberately-wrong-file.xsd ' ;
30
30
31
31
/** @var string */
32
- public const TEXTCONTENT_TYPE = Base64BinaryValue::class;
32
+ public const TEXTCONTENT_TYPE = AbstractElement::class; // Deliberately wrong class
33
+
34
+
35
+ /**
36
+ * NOTE: This class has some deliberately wrong values for testing purposes!!
37
+ */
33
38
}
Original file line number Diff line number Diff line change @@ -40,17 +40,18 @@ public function testTypedContentPassesForBoolean(): void
40
40
}
41
41
42
42
43
- public function testTypedContentForBase64Binary (): void
43
+ public function testTypedContentFailsForWrongType (): void
44
44
{
45
- $ file = 'tests/resources/xml/ssp_Base64BinaryElement .xml ' ;
45
+ $ file = 'tests/resources/xml/ssp_BooleanElement .xml ' ;
46
46
$ chunk = DOMDocumentFactory::fromFile ($ file );
47
+ $ chunk ->documentElement ->textContent = 'not-a-boolean ' ;
47
48
48
- $ stringElt = Base64BinaryElement:: fromXML ( $ chunk -> documentElement );
49
- $ this -> assertInstanceOf (Base64BinaryElement::class, $ stringElt );
49
+ $ this -> expectException (SchemaViolationException::class );
50
+ BooleanElement:: fromXML ( $ chunk -> documentElement );
50
51
}
51
52
52
53
53
- public function testTypedContentFailsForWrongType (): void
54
+ public function testTypedContentFailsForWrongClass (): void
54
55
{
55
56
$ file = 'tests/resources/xml/ssp_BooleanElement.xml ' ;
56
57
$ chunk = DOMDocumentFactory::fromFile ($ file );
You can’t perform that action at this time.
0 commit comments