11<?php
22
3+ declare (strict_types=1 );
4+
35/*
46 * This file is part of PHP CS Fixer / PHPUnit Constraint XmlMatchesXsd.
57 *
2224 */
2325final class XmlMatchesXsdTest extends TestCase
2426{
25- public function testAssertXMLMatchesXSD ()
27+ public function testAssertXMLMatchesXSD (): void
2628 {
2729 $ constraint = new XmlMatchesXsd ($ this ->getXSD ());
2830 $ sampleFile = $ this ->getAssetsDir ().'xliff_sample.xml ' ;
@@ -42,14 +44,14 @@ public function testAssertXMLMatchesXSD()
4244 self ::assertTrue ($ constraint ->evaluate ($ content , '' , true ));
4345 }
4446
45- public function testXMLValidConstraintBasics ()
47+ public function testXMLValidConstraintBasics (): void
4648 {
4749 $ constraint = new XmlMatchesXsd ('' );
4850 self ::assertSame (1 , $ constraint ->count ());
4951 self ::assertSame ('matches XSD ' , $ constraint ->toString ());
5052 }
5153
52- public function testXMLValidConstraintFalse ()
54+ public function testXMLValidConstraintFalse (): void
5355 {
5456 $ this ->expectException (
5557 'PHPUnit\Framework\ExpectationFailedException '
@@ -62,7 +64,7 @@ public function testXMLValidConstraintFalse()
6264 $ constraint ->evaluate (false );
6365 }
6466
65- public function testXMLValidConstraintInt ()
67+ public function testXMLValidConstraintInt (): void
6668 {
6769 $ this ->expectException (
6870 'PHPUnit\Framework\ExpectationFailedException '
@@ -75,7 +77,7 @@ public function testXMLValidConstraintInt()
7577 $ constraint ->evaluate (1 );
7678 }
7779
78- public function testXMLValidConstraintInvalidXML ()
80+ public function testXMLValidConstraintInvalidXML (): void
7981 {
8082 $ this ->expectException (
8183 'PHPUnit\Framework\ExpectationFailedException '
@@ -88,7 +90,7 @@ public function testXMLValidConstraintInvalidXML()
8890 $ constraint ->evaluate ('<a></b> ' );
8991 }
9092
91- public function testXMLValidConstraintNotMatchingXML ()
93+ public function testXMLValidConstraintNotMatchingXML (): void
9294 {
9395 $ this ->expectException (
9496 'PHPUnit\Framework\ExpectationFailedException '
@@ -101,7 +103,7 @@ public function testXMLValidConstraintNotMatchingXML()
101103 $ constraint ->evaluate ('<a></a> ' );
102104 }
103105
104- public function testXMLValidConstraintNull ()
106+ public function testXMLValidConstraintNull (): void
105107 {
106108 $ this ->expectException (
107109 'PHPUnit\Framework\ExpectationFailedException '
@@ -114,7 +116,7 @@ public function testXMLValidConstraintNull()
114116 $ constraint ->evaluate (null );
115117 }
116118
117- public function testXMLValidConstraintObject ()
119+ public function testXMLValidConstraintObject (): void
118120 {
119121 $ this ->expectException (
120122 'PHPUnit\Framework\ExpectationFailedException '
@@ -146,10 +148,10 @@ private function getAssetsDir()
146148 /**
147149 * @param string $pattern
148150 */
149- private function expectExceptionMessageRegex ($ pattern )
151+ private function expectExceptionMessageRegex ($ pattern ): void
150152 {
151153 if (method_exists ($ this , 'expectExceptionMessageRegExp ' )) {
152- $ this ->expectExceptionMessageRegExp ($ pattern );
154+ $ this ->expectExceptionMessageMatches ($ pattern );
153155 } elseif (method_exists ($ this , 'expectExceptionMessageMatches ' )) {
154156 $ this ->expectExceptionMessageMatches ($ pattern );
155157 } elseif (method_exists ($ this , 'expectDeprecationMessageMatches ' )) {
0 commit comments