Skip to content

Commit 092570a

Browse files
committed
renamed namespaces
1 parent f64c9f5 commit 092570a

File tree

7 files changed

+31
-33
lines changed

7 files changed

+31
-33
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"autoload": {
2525
"psr-4": {
26-
"RedLine\\Array2Xml\\": "src/ArrayToXml"
26+
"AlexTartan\\Array2Xml\\": "src/ArrayToXml"
2727
}
2828
},
2929
"require-dev": {
@@ -33,7 +33,7 @@
3333
},
3434
"autoload-dev": {
3535
"psr-4": {
36-
"RedLineTest\\Array2Xml\\": "test/ArrayToXml"
36+
"AlexTartanTest\\Array2Xml\\": "test/ArrayToXml"
3737
}
3838
},
3939
"scripts": {

src/ArrayToXml/ArrayToXml.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
* limitations under the License.
1818
**/
1919

20-
namespace RedLine\Array2Xml;
20+
namespace AlexTartan\Array2Xml;
2121

2222
use DOMDocument;
2323
use DOMElement;
2424
use DOMNode;
25-
use RedLine\Array2Xml\Exception\ConversionException;
25+
use AlexTartan\Array2Xml\Exception\ConversionException;
2626

2727
/**
2828
* This class converts an array into an XML file

src/ArrayToXml/Exception/ConversionException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
declare(strict_types=1);
33

4-
namespace RedLine\Array2Xml\Exception;
4+
namespace AlexTartan\Array2Xml\Exception;
55

66
class ConversionException extends \Exception
77
{

src/ArrayToXml/XmlToArray.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
* limitations under the License.
1818
**/
1919

20-
namespace RedLine\Array2Xml;
20+
namespace AlexTartan\Array2Xml;
2121

2222
use DOMDocument;
2323
use DOMNode;
24-
use RedLine\Array2Xml\Exception\ConversionException;
24+
use AlexTartan\Array2Xml\Exception\ConversionException;
2525

2626
/**
2727
* This class helps convert an XML to an array

test/ArrayToXml/ArrayToXmlTest.php

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?php
22
declare(strict_types=1);
33

4-
namespace RedLineTest\Array2Xml;
4+
namespace AlexTartanTest\Array2Xml;
55

6+
use AlexTartan\Array2Xml\ArrayToXml;
7+
use AlexTartan\Array2Xml\Exception\ConversionException;
8+
use AlexTartan\Array2Xml\XmlToArray;
69
use PHPUnit\Framework\TestCase;
7-
use RedLine\Array2Xml\ArrayToXml;
8-
use RedLine\Array2Xml\XmlToArray;
910

1011
class ArrayToXmlTest extends TestCase
1112
{
@@ -35,12 +36,11 @@ public function testSimpleConversionFromString()
3536
);
3637
}
3738

38-
/**
39-
* @expectedException \RedLine\Array2Xml\Exception\ConversionException
40-
* @expectedExceptionMessage Xml needs to have one root element
41-
*/
4239
public function testSimpleConversionFromStringFailsOnMultipleRootNodes()
4340
{
41+
$this->expectException(ConversionException::class);
42+
$this->expectExceptionMessage('Xml needs to have one root element');
43+
4444
(new ArrayToXml())->buildXml(
4545
[
4646
'note' => [
@@ -199,12 +199,11 @@ public function testWithValue()
199199
);
200200
}
201201

202-
/**
203-
* @expectedException \RedLine\Array2Xml\Exception\ConversionException
204-
* @expectedExceptionMessage Illegal character in tag name. tag: !WOW in node: note
205-
*/
206202
public function testInvalidNodeName()
207203
{
204+
$this->expectException(ConversionException::class);
205+
$this->expectExceptionMessage('Illegal character in tag name. tag: !WOW in node: note');
206+
208207
(new ArrayToXml)->buildXml(
209208
[
210209
'messages' => [
@@ -218,12 +217,11 @@ public function testInvalidNodeName()
218217
);
219218
}
220219

221-
/**
222-
* @expectedException \RedLine\Array2Xml\Exception\ConversionException
223-
* @expectedExceptionMessage Illegal character in attribute name. attribute: !id in node: note
224-
*/
225220
public function testInvalidNodeNameInAttributes()
226221
{
222+
$this->expectException(ConversionException::class);
223+
$this->expectExceptionMessage('Illegal character in attribute name. attribute: !id in node: note');
224+
227225
(new ArrayToXml)->buildXml(
228226
[
229227
'messages' => [

test/ArrayToXml/Exception/ConversionExceptionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22
declare(strict_types=1);
33

4-
namespace RedLineTest\Array2Xml\Exception;
4+
namespace AlexTartanTest\Array2Xml\Exception;
55

66
use PHPUnit\Framework\TestCase;
7-
use RedLine\Array2Xml\Exception\ConversionException;
7+
use AlexTartan\Array2Xml\Exception\ConversionException;
88

99
class ConversionExceptionTest extends TestCase
1010
{

test/ArrayToXml/XmlToArrayTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?php
22
declare(strict_types=1);
33

4-
namespace RedLineTest\Array2Xml;
4+
namespace AlexTartanTest\Array2Xml;
55

6+
use AlexTartan\Array2Xml\Exception\ConversionException;
7+
use AlexTartan\Array2Xml\XmlToArray;
68
use PHPUnit\Framework\TestCase;
7-
use RedLine\Array2Xml\XmlToArray;
89

910
class XmlToArrayTest extends TestCase
1011
{
@@ -68,12 +69,11 @@ public function testBuildFromStringWithMultipleNodes()
6869
);
6970
}
7071

71-
/**
72-
* @expectedException \RedLine\Array2Xml\Exception\ConversionException
73-
* @expectedExceptionMessage E_WARNING Start tag expected, '<' not found in Entity, line: 1
74-
*/
7572
public function testBuildFromStringThrowsExceptionOnInvalidXml()
7673
{
74+
$this->expectException(ConversionException::class);
75+
$this->expectExceptionMessage("E_WARNING Start tag expected, '<' not found in Entity, line: 1");
76+
7777
$output = (new XmlToArray())->buildArrayFromString(
7878
'no_xml'
7979
);
@@ -304,9 +304,9 @@ public function testXmlWithEmptyNodes()
304304
static::assertSame(
305305
[
306306
'table' => [
307-
'name' => '',
308-
'width' => '80',
309-
'length' => '120',
307+
'name' => '',
308+
'width' => '80',
309+
'length' => '120',
310310
],
311311
],
312312
$output

0 commit comments

Comments
 (0)