@@ -305,7 +305,7 @@ public function testReturnTypeThis()
305305 );
306306
307307 $ this ->assertTrue ($ fixture ->isStatic ());
308- $ this ->assertSame ('static $this myMethod() ' , (string )$ fixture );
308+ $ this ->assertSame ('static $this myMethod() ' , (string )$ fixture );
309309 $ this ->assertSame ('myMethod ' , $ fixture ->getMethodName ());
310310 $ this ->assertInstanceOf (This::class, $ fixture ->getReturnType ());
311311 }
@@ -468,4 +468,28 @@ public function testCreateMethodParenthesisMissing()
468468 $ this ->assertInstanceOf (Void_::class, $ fixture ->getReturnType ());
469469 $ this ->assertSame ($ description , $ fixture ->getDescription ());
470470 }
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+ }
471495}
0 commit comments