@@ -305,7 +305,7 @@ public function testReturnTypeThis()
305
305
);
306
306
307
307
$ this ->assertTrue ($ fixture ->isStatic ());
308
- $ this ->assertSame ('static $this myMethod() ' , (string )$ fixture );
308
+ $ this ->assertSame ('static $this myMethod() ' , (string )$ fixture );
309
309
$ this ->assertSame ('myMethod ' , $ fixture ->getMethodName ());
310
310
$ this ->assertInstanceOf (This::class, $ fixture ->getReturnType ());
311
311
}
@@ -468,4 +468,28 @@ public function testCreateMethodParenthesisMissing()
468
468
$ this ->assertInstanceOf (Void_::class, $ fixture ->getReturnType ());
469
469
$ this ->assertSame ($ description , $ fixture ->getDescription ());
470
470
}
471
+
472
+ public function testCreateWithoutReturnType ()
473
+ {
474
+ $ descriptionFactory = m::mock (DescriptionFactory::class);
475
+ $ resolver = new TypeResolver ();
476
+ $ context = new Context ('' );
477
+
478
+ $ description = new Description ('' );
479
+
480
+ $ descriptionFactory ->shouldReceive ('create ' )->with ('' , $ context )->andReturn ($ description );
481
+
482
+ $ fixture = Method::create (
483
+ 'myMethod() ' ,
484
+ $ resolver ,
485
+ $ descriptionFactory ,
486
+ $ context
487
+ );
488
+
489
+ $ this ->assertSame ('void myMethod() ' , (string )$ fixture );
490
+ $ this ->assertSame ('myMethod ' , $ fixture ->getMethodName ());
491
+ $ this ->assertEquals ([], $ fixture ->getArguments ());
492
+ $ this ->assertInstanceOf (Void_::class, $ fixture ->getReturnType ());
493
+ $ this ->assertSame ($ description , $ fixture ->getDescription ());
494
+ }
471
495
}
0 commit comments