File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
src/test/php/text/json/unittest Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -70,19 +70,16 @@ public function calling_pairs_after_resetting_with_bom($input) {
7070
7171 #[Test]
7272 public function cannot_reset_unseekable () {
73- $ input = new StreamInput (newinstance (InputStream:: class, [], [
74- ' read ' => function ($ size = 8192 ) { return '[1] ' ; },
75- ' available ' => function () { return true ; },
76- ' close ' => function () { }
77- ]) );
73+ $ input = new StreamInput (new class () implements InputStream {
74+ public function read ($ size = 8192 ) { return '[1] ' ; }
75+ public function available () { return true ; }
76+ public function close () { }
77+ } );
7878 Assert::equals ([1 ], iterator_to_array ($ input ->elements ()), '#1 ' );
79- try {
79+ Assert:: throws (IOException::class, function () use ( $ input ) {
8080 $ input ->reset ();
8181 iterator_to_array ($ input ->elements ());
82- $ this ->fail ('Expected exception not caught ' , null , 'io.IOException ' );
83- } catch (IOException $ expected ) {
84- // OK
85- }
82+ });
8683 }
8784
8885 #[Test]
You can’t perform that action at this time.
0 commit comments