@@ -24,6 +24,7 @@ public function toArray()
24
24
25
25
class Json implements \JsonSerializable
26
26
{
27
+ #[\ReturnTypeWillChange]
27
28
public function jsonSerialize ()
28
29
{
29
30
return ['a ' => 1 , 'b ' => 2 , 'c ' => 3 ];
@@ -74,7 +75,7 @@ public function test_underscore()
74
75
75
76
public function test_now ()
76
77
{
77
- $ this ->assertInternalType ( ' float ' , _::_ ()->now ());
78
+ $ this ->assertNotEmpty ( _::_ ()->now ());
78
79
}
79
80
80
81
public function test_keys_values ()
@@ -126,10 +127,6 @@ public function test_clone_tap()
126
127
$ this ->assertSame ($ main , $ tap , 'hard equal ' );
127
128
}
128
129
129
- /**
130
- * @expectedException \Ahc\Underscore\UnderscoreException
131
- * @expectedExceptionMessage The mixin with name 'notMixedIn' is not defined
132
- */
133
130
public function test_mixin ()
134
131
{
135
132
_::mixin ('double ' , function () {
@@ -140,9 +137,12 @@ public function test_mixin()
140
137
141
138
$ und = underscore ([10 , 20 , 30 ]);
142
139
143
- $ this ->assertInternalType ( ' callable ' , [$ und , 'double ' ]);
140
+ $ this ->assertIsCallable ( [$ und , 'double ' ]);
144
141
$ this ->assertSame ([20 , 40 , 60 ], $ und ->double ()->toArray ());
145
142
143
+ $ this ->expectException (\Ahc \Underscore \UnderscoreException::class);
144
+ $ this ->expectExceptionMessage ("The mixin with name 'notMixedIn' is not defined " );
145
+
146
146
$ und ->notMixedIn ();
147
147
}
148
148
@@ -168,12 +168,11 @@ public function test_hom()
168
168
$ this ->assertSame ([1 => 64 , 3 => 36 , 5 => 16 , 7 => 4 , 9 => 0 ], $ sq );
169
169
}
170
170
171
- /**
172
- * @expectedException \Ahc\Underscore\UnderscoreException
173
- * @expectedExceptionMessage The 'anon' is not defined
174
- */
175
171
public function test_hom_throws ()
176
172
{
173
+ $ this ->expectException (\Ahc \Underscore \UnderscoreException::class);
174
+ $ this ->expectExceptionMessage ("The 'anon' is not defined " );
175
+
177
176
underscore ()->anon ->value ();
178
177
}
179
178
}
0 commit comments