1
1
<?php
2
2
declare (strict_types=1 );
3
3
4
- namespace RedLineTest \Array2Xml ;
4
+ namespace AlexTartanTest \Array2Xml ;
5
5
6
+ use AlexTartan \Array2Xml \ArrayToXml ;
7
+ use AlexTartan \Array2Xml \Exception \ConversionException ;
8
+ use AlexTartan \Array2Xml \XmlToArray ;
6
9
use PHPUnit \Framework \TestCase ;
7
- use RedLine \Array2Xml \ArrayToXml ;
8
- use RedLine \Array2Xml \XmlToArray ;
9
10
10
11
class ArrayToXmlTest extends TestCase
11
12
{
@@ -35,12 +36,11 @@ public function testSimpleConversionFromString()
35
36
);
36
37
}
37
38
38
- /**
39
- * @expectedException \RedLine\Array2Xml\Exception\ConversionException
40
- * @expectedExceptionMessage Xml needs to have one root element
41
- */
42
39
public function testSimpleConversionFromStringFailsOnMultipleRootNodes ()
43
40
{
41
+ $ this ->expectException (ConversionException::class);
42
+ $ this ->expectExceptionMessage ('Xml needs to have one root element ' );
43
+
44
44
(new ArrayToXml ())->buildXml (
45
45
[
46
46
'note ' => [
@@ -199,12 +199,11 @@ public function testWithValue()
199
199
);
200
200
}
201
201
202
- /**
203
- * @expectedException \RedLine\Array2Xml\Exception\ConversionException
204
- * @expectedExceptionMessage Illegal character in tag name. tag: !WOW in node: note
205
- */
206
202
public function testInvalidNodeName ()
207
203
{
204
+ $ this ->expectException (ConversionException::class);
205
+ $ this ->expectExceptionMessage ('Illegal character in tag name. tag: !WOW in node: note ' );
206
+
208
207
(new ArrayToXml )->buildXml (
209
208
[
210
209
'messages ' => [
@@ -218,12 +217,11 @@ public function testInvalidNodeName()
218
217
);
219
218
}
220
219
221
- /**
222
- * @expectedException \RedLine\Array2Xml\Exception\ConversionException
223
- * @expectedExceptionMessage Illegal character in attribute name. attribute: !id in node: note
224
- */
225
220
public function testInvalidNodeNameInAttributes ()
226
221
{
222
+ $ this ->expectException (ConversionException::class);
223
+ $ this ->expectExceptionMessage ('Illegal character in attribute name. attribute: !id in node: note ' );
224
+
227
225
(new ArrayToXml )->buildXml (
228
226
[
229
227
'messages ' => [
0 commit comments