2
2
3
3
namespace SMS \FluidComponents \Tests \Unit \Utility ;
4
4
5
+ use SMS \FluidComponents \Interfaces \ConstructibleFromArray ;
6
+ use SMS \FluidComponents \Utility \ComponentArgumentConverter ;
5
7
use SMS \FluidComponents \Tests \Helpers \ComponentArgumentConverter \BaseObject ;
6
- use SMS \FluidComponents \Tests \Helpers \ComponentArgumentConverter \BaseObjectConversionInterface ;
7
- use SMS \FluidComponents \Tests \Helpers \ComponentArgumentConverter \DummyConversionInterface ;
8
8
use SMS \FluidComponents \Tests \Helpers \ComponentArgumentConverter \DummyValue ;
9
9
use SMS \FluidComponents \Tests \Helpers \ComponentArgumentConverter \SpecificObject ;
10
- use SMS \FluidComponents \Utility \ComponentArgumentConverter ;
10
+ use SMS \FluidComponents \Tests \Helpers \ComponentArgumentConverter \DummyConversionInterface ;
11
+ use SMS \FluidComponents \Tests \Helpers \ComponentArgumentConverter \BaseObjectConversionInterface ;
11
12
12
13
class ComponentArgumentConverterTest extends \TYPO3 \TestingFramework \Core \Unit \UnitTestCase
13
14
{
@@ -66,8 +67,9 @@ public function resolveTypeAliasCollection()
66
67
public function addRemoveConversionInterface ()
67
68
{
68
69
$ this ->assertEquals (
69
- false ,
70
- $ this ->converter ->canTypeBeConvertedToType ('string ' , DummyValue::class)
70
+ [],
71
+ $ this ->converter ->canTypeBeConvertedToType ('string ' , DummyValue::class),
72
+ 'before conversion interface registration '
71
73
);
72
74
73
75
$ this ->converter ->addConversionInterface (
@@ -77,15 +79,17 @@ public function addRemoveConversionInterface()
77
79
);
78
80
79
81
$ this ->assertEquals (
80
- true ,
81
- $ this ->converter ->canTypeBeConvertedToType ('string ' , DummyValue::class)
82
+ [DummyConversionInterface::class, 'fromString ' ],
83
+ $ this ->converter ->canTypeBeConvertedToType ('string ' , DummyValue::class),
84
+ 'after conversion interface registration '
82
85
);
83
86
84
87
$ this ->converter ->removeConversionInterface ('string ' );
85
88
86
89
$ this ->assertEquals (
87
- false ,
88
- $ this ->converter ->canTypeBeConvertedToType ('string ' , DummyValue::class)
90
+ [],
91
+ $ this ->converter ->canTypeBeConvertedToType ('string ' , DummyValue::class),
92
+ 'after conversion interface removal '
89
93
);
90
94
}
91
95
@@ -130,11 +134,11 @@ public function canTypeBeConvertedToType()
130
134
131
135
// Collections
132
136
$ this ->assertEquals (
133
- [DummyConversionInterface ::class, 'fromString ' ],
137
+ [ConstructibleFromArray ::class, 'fromArray ' ],
134
138
$ this ->converter ->canTypeBeConvertedToType ('array ' , DummyValue::class . '[] ' )
135
139
);
136
140
$ this ->assertEquals (
137
- [DummyConversionInterface ::class, 'fromString ' ],
141
+ [ConstructibleFromArray ::class, 'fromArray ' ],
138
142
$ this ->converter ->canTypeBeConvertedToType (\ArrayIterator::class, DummyValue::class . '[] ' )
139
143
);
140
144
$ this ->assertEquals (
0 commit comments