1
1
<?php
2
2
namespace GoetasWebservices \Xsd \XsdToPhp \Tests \Converter ;
3
3
4
+ use GoetasWebservices \Xsd \XsdToPhp \AbstractConverter ;
4
5
use GoetasWebservices \Xsd \XsdToPhp \Naming \ShortNamingStrategy ;
6
+ use GoetasWebservices \Xsd \XsdToPhp \Tests \ReflectionUtils ;
7
+ use PHPUnit \Framework \Assert ;
8
+ use PHPUnit \Framework \TestCase ;
5
9
6
- class AbstractXsdConverterTest extends \PHPUnit_Framework_TestCase
10
+ class AbstractXsdConverterTest extends TestCase
7
11
{
8
12
9
13
/**
@@ -12,7 +16,7 @@ class AbstractXsdConverterTest extends \PHPUnit_Framework_TestCase
12
16
*/
13
17
protected $ converter ;
14
18
15
- public function setUp ()
19
+ public function setUp (): void
16
20
{
17
21
$ this ->converter = $ this ->getMockForAbstractClass ('GoetasWebservices\Xsd\XsdToPhp\AbstractConverter ' , [new ShortNamingStrategy ()]);
18
22
}
@@ -23,7 +27,7 @@ public function testAliases()
23
27
};
24
28
$ this ->converter ->addAliasMap ('http://www.example.com ' , "myType " , $ f );
25
29
26
- $ handlers = \PHPUnit_Framework_Assert:: readAttribute ($ this ->converter , 'typeAliases ' );
30
+ $ handlers = ReflectionUtils:: getObjectAttribute ($ this ->converter , 'typeAliases ' );
27
31
28
32
$ this ->assertArrayHasKey ('http://www.example.com ' , $ handlers );
29
33
$ this ->assertArrayHasKey ('myType ' , $ exmpleHandlers = $ handlers ['http://www.example.com ' ]);
@@ -32,7 +36,7 @@ public function testAliases()
32
36
33
37
public function testDefaultAliases ()
34
38
{
35
- $ handlers = \PHPUnit_Framework_Assert:: readAttribute ($ this ->converter , 'typeAliases ' );
39
+ $ handlers = ReflectionUtils:: getObjectAttribute ($ this ->converter , 'typeAliases ' );
36
40
37
41
$ this ->assertArrayHasKey ('http://www.w3.org/2001/XMLSchema ' , $ handlers );
38
42
$ defaultHandlers = $ handlers ['http://www.w3.org/2001/XMLSchema ' ];
@@ -46,7 +50,7 @@ public function testNamespaces()
46
50
{
47
51
$ this ->converter ->addNamespace ('http://www.example.com ' , 'some\php\ns ' );
48
52
49
- $ namespaces = \PHPUnit_Framework_Assert:: readAttribute ($ this ->converter , 'namespaces ' );
53
+ $ namespaces = ReflectionUtils:: getObjectAttribute ($ this ->converter , 'namespaces ' );
50
54
51
55
$ this ->assertArrayHasKey ('http://www.example.com ' , $ namespaces );
52
56
$ this ->assertEquals ('some\php\ns ' , $ namespaces ['http://www.example.com ' ]);
0 commit comments