@@ -16,7 +16,7 @@ public function testConstructorArray(): void
16
16
'bar ' => 'foo '
17
17
]);
18
18
19
- $ this ->assertSame ((string )$ attr , 'bar="foo" foo="bar" ' );
19
+ $ this ->assertSame ((string ) $ attr , 'bar="foo" foo="bar" ' );
20
20
}
21
21
22
22
public function testConstrucorNamedArguments (): void
@@ -26,7 +26,7 @@ public function testConstrucorNamedArguments(): void
26
26
bar: 'foo ' ,
27
27
);
28
28
29
- $ this ->assertSame ((string )$ attr , 'bar="foo" foo="bar" ' );
29
+ $ this ->assertSame ((string ) $ attr , 'bar="foo" foo="bar" ' );
30
30
}
31
31
32
32
public function testConversionToLowerCase (): void
@@ -35,17 +35,17 @@ public function testConversionToLowerCase(): void
35
35
fooBar: 'baz ' ,
36
36
);
37
37
38
- $ this ->assertSame ((string )$ attr , 'foobar="baz" ' );
38
+ $ this ->assertSame ((string ) $ attr , 'foobar="baz" ' );
39
39
}
40
40
41
41
public function testToHtml (): void
42
42
{
43
43
$ attr = new Attributes ([
44
+ 'standalone ' ,
44
45
'fooBar ' => 'baz ' ,
45
- 'standalone '
46
46
]);
47
47
48
- $ this ->assertSame ($ attr ->toHtml (), 'foobar="baz" standalone ' );
48
+ $ this ->assertSame ($ attr ->toHtml (), 'standalone foobar="baz" ' );
49
49
}
50
50
51
51
public function testEmptyInputArray (): void
@@ -54,27 +54,27 @@ public function testEmptyInputArray(): void
54
54
55
55
$ this ->assertSame ($ attr ->toHtml (), null );
56
56
$ this ->assertSame ($ attr ->toXml (), null );
57
- $ this ->assertSame ((string )$ attr , '' );
57
+ $ this ->assertSame ((string ) $ attr , '' );
58
58
}
59
59
60
60
public function testEmptyAttributes (): void
61
61
{
62
62
$ attr = new Attributes (['foo ' => '' ]);
63
- $ this ->assertSame ((string )$ attr , 'foo="" ' );
64
- $ this ->assertSame ((string )$ attr ->toXml (), 'foo="" ' );
63
+ $ this ->assertSame ((string ) $ attr , 'foo="" ' );
64
+ $ this ->assertSame ((string ) $ attr ->toXml (), 'foo="" ' );
65
65
66
66
$ attr = new Attributes (['foo ' ]);
67
- $ this ->assertSame ((string )$ attr , 'foo ' );
68
- $ this ->assertSame ((string )$ attr ->toXml (), 'foo="foo" ' );
67
+ $ this ->assertSame ((string ) $ attr , 'foo ' );
68
+ $ this ->assertSame ((string ) $ attr ->toXml (), 'foo="foo" ' );
69
69
70
70
$ attr = new Attributes (['foo ' => null , 'bar ' => false ]);
71
- $ this ->assertSame ((string )$ attr , '' );
71
+ $ this ->assertSame ((string ) $ attr , '' );
72
72
}
73
73
74
74
public function testSingleSpaceAttribute (): void
75
75
{
76
76
// should trigger e deprecated error
77
- @(string )(new Attributes (['foo ' => ' ' ]));
77
+ @(string ) (new Attributes (['foo ' => ' ' ]));
78
78
$ this ->assertTrue (error_get_last () !== null );
79
79
}
80
80
@@ -85,35 +85,35 @@ public function testToXml(): void
85
85
'standalone '
86
86
]);
87
87
88
- $ this ->assertSame ($ attr ->toXml (), 'fooBar="baz" standalone="standalone " ' );
88
+ $ this ->assertSame ($ attr ->toXml (), 'standalone="standalone" fooBar="baz " ' );
89
89
}
90
90
91
91
public function testAfter (): void
92
92
{
93
93
$ attr = (new Attributes (foo: 'bar ' ))->after (' ' );
94
94
95
- $ this ->assertSame ((string )$ attr , 'foo="bar" ' );
95
+ $ this ->assertSame ((string ) $ attr , 'foo="bar" ' );
96
96
}
97
97
98
98
public function testBefore (): void
99
99
{
100
100
$ attr = (new Attributes (foo: 'bar ' ))->before (' ' );
101
101
102
- $ this ->assertSame ((string )$ attr , ' foo="bar" ' );
102
+ $ this ->assertSame ((string ) $ attr , ' foo="bar" ' );
103
103
}
104
104
105
105
public function testCreateClassValue (): void
106
106
{
107
107
$ value = $ this ->_callProtectedStaticMethod ('createClassValue ' , 'foo bar ' );
108
108
109
- $ this ->assertSame ((string )$ value , 'foo bar ' );
109
+ $ this ->assertSame ((string ) $ value , 'foo bar ' );
110
110
}
111
111
112
112
public function testNullClassValue (): void
113
113
{
114
114
$ attributes = new Attributes (class: null );
115
115
$ this ->assertSame ($ attributes ->get ('class ' )->value (), null );
116
- $ this ->assertSame ((string )$ attributes , '' );
116
+ $ this ->assertSame ((string ) $ attributes , '' );
117
117
}
118
118
119
119
public function testCreateClassValueWhiteSurplusWhiteSpace (): void
@@ -123,14 +123,14 @@ public function testCreateClassValueWhiteSurplusWhiteSpace(): void
123
123
qux
124
124
' );
125
125
126
- $ this ->assertSame ((string )$ value , 'foo bar baz qux ' );
126
+ $ this ->assertSame ((string ) $ value , 'foo bar baz qux ' );
127
127
}
128
128
129
129
public function testNormalizeClassValueFromNumericArray (): void
130
130
{
131
131
$ value = $ this ->_callProtectedStaticMethod ('normalizeClassValue ' , ['foo ' , 'bar ' ]);
132
132
133
- $ this ->assertSame ((string )$ value , 'foo bar ' );
133
+ $ this ->assertSame ((string ) $ value , 'foo bar ' );
134
134
}
135
135
136
136
public function testNormalizeClassValueFromConditionalArray (): void
@@ -141,7 +141,7 @@ public function testNormalizeClassValueFromConditionalArray(): void
141
141
'baz '
142
142
]);
143
143
144
- $ this ->assertSame ((string )$ value , 'foo baz ' );
144
+ $ this ->assertSame ((string ) $ value , 'foo baz ' );
145
145
}
146
146
147
147
public function testAttributesWithClassesArray (): void
@@ -155,17 +155,15 @@ public function testAttributesWithClassesArray(): void
155
155
]
156
156
]);
157
157
158
- echo $ attr ;
159
-
160
- $ this ->assertSame ((string )$ attr , 'class="foo bar" foo="bar" ' );
158
+ $ this ->assertSame ((string ) $ attr , 'class="foo bar" foo="bar" ' );
161
159
}
162
160
163
161
public function testMerge (): void
164
162
{
165
163
$ attr = new Attributes (foo: 'bar ' );
166
164
$ attr = $ attr ->merge (bar: 'foo ' );
167
165
168
- $ this ->assertSame ((string )$ attr , 'bar="foo" foo="bar" ' );
166
+ $ this ->assertSame ((string ) $ attr , 'bar="foo" foo="bar" ' );
169
167
}
170
168
171
169
public function testMergeClassAttribute (): void
@@ -174,22 +172,22 @@ public function testMergeClassAttribute(): void
174
172
$ attr = $ attr ->merge (['class ' => 'bar ' ]);
175
173
$ attr = $ attr ->class ('baz ' );
176
174
177
- $ this ->assertSame ((string )$ attr , 'class="foo bar baz" ' );
175
+ $ this ->assertSame ((string ) $ attr , 'class="foo bar baz" ' );
178
176
}
179
177
180
178
public function testRepeatedSetClassAttribute (): void
181
179
{
182
180
$ attr = new Attributes (['class ' => 'foo ' ]);
183
181
$ attr = $ attr ->class ('bar ' );
184
182
185
- $ this ->assertSame ((string )$ attr , 'class="foo bar" ' );
183
+ $ this ->assertSame ((string ) $ attr , 'class="foo bar" ' );
186
184
}
187
185
188
186
public function testCreateStyleValue (): void
189
187
{
190
188
$ value = $ this ->_callProtectedStaticMethod ('createStyleValue ' , 'foo: bar; bar: foo; ' );
191
189
192
- $ this ->assertSame ((string )$ value , 'foo: bar; bar: foo; ' );
190
+ $ this ->assertSame ((string ) $ value , 'foo: bar; bar: foo; ' );
193
191
}
194
192
195
193
public function testNullStyleValue (): void
@@ -205,7 +203,7 @@ public function testNormalizeStyleValue(): void
205
203
'bar: foo ' ,
206
204
]);
207
205
208
- $ this ->assertSame ((string )$ value , 'foo: bar; bar: foo ' );
206
+ $ this ->assertSame ((string ) $ value , 'foo: bar; bar: foo ' );
209
207
}
210
208
211
209
public function testMergeStyleAttribute (): void
@@ -214,7 +212,7 @@ public function testMergeStyleAttribute(): void
214
212
$ attr = $ attr ->merge (['style ' => 'bar: foo ' ]);
215
213
$ attr = $ attr ->style ('baz: qux ' );
216
214
217
- $ this ->assertSame ((string )$ attr , 'style="foo: bar; bar: foo; baz: qux" ' );
215
+ $ this ->assertSame ((string ) $ attr , 'style="foo: bar; bar: foo; baz: qux" ' );
218
216
}
219
217
220
218
public function testGet (): void
@@ -233,7 +231,7 @@ public function testSet(): void
233
231
$ attr = $ attr ->baz ('qux ' );
234
232
$ attr = $ attr ->merge (['qux ' => 'bar ' ]);
235
233
236
- $ this ->assertSame ((string )$ attr , 'baz="qux" foo="bar" qux="bar" ' );
234
+ $ this ->assertSame ((string ) $ attr , 'baz="qux" foo="bar" qux="bar" ' );
237
235
}
238
236
239
237
public function testAppend (): void
@@ -263,16 +261,10 @@ public function testProtect(): void
263
261
$ this ->assertSame ($ attr ->get ('foo ' )->value (), 'bar ' );
264
262
}
265
263
266
- public function testInvoke (): void
267
- {
268
- $ attr = (new Attributes ())(foo: 'bar ' )(baz: 'qux ' );
269
- $ this ->assertSame ((string )$ attr , 'baz="qux" foo="bar" ' );
270
- }
271
-
272
264
public function testOffsetGet (): void
273
265
{
274
266
$ attr = new Attributes (foo: 'bar ' );
275
- $ this ->assertSame ((string )$ attr ['foo ' ], 'bar ' );
267
+ $ this ->assertSame ((string ) $ attr ['foo ' ], 'bar ' );
276
268
}
277
269
278
270
public function testOffsetGetNonExisting (): void
@@ -285,7 +277,7 @@ public function testOffsetSet(): void
285
277
{
286
278
$ attr = new Attributes ();
287
279
$ attr ['foo ' ] = 'bar ' ;
288
- $ this ->assertSame ((string )$ attr , 'foo="bar" ' );
280
+ $ this ->assertSame ((string ) $ attr , 'foo="bar" ' );
289
281
}
290
282
291
283
@@ -306,7 +298,7 @@ public function testOffsetUnset(): void
306
298
{
307
299
$ attr = new Attributes (foo: 'bar ' );
308
300
unset($ attr ['foo ' ]);
309
- $ this ->assertSame ((string )$ attr , '' );
301
+ $ this ->assertSame ((string ) $ attr , '' );
310
302
}
311
303
312
304
0 commit comments