@@ -59,6 +59,41 @@ public function testWillSetReturnType(): void
5959 $ this ->assertSame ('self ' , $ declaration ->getReturnType ());
6060 }
6161
62+ public function testWillRenderParameters (): void
63+ {
64+ $ declaration = new Declaration ($ this ->declarationName );
65+ $ this ->assertSame ('' , $ declaration ->renderParameters ());
66+
67+ $ declaration ->addParameter (
68+ new Parameter ('param ' , 'string ' )
69+ );
70+ $ this ->assertSame (' string $param, ' , $ declaration ->renderParameters ());
71+
72+ $ declaration ->addParameter (
73+ new Parameter ('other ' , 'string ' )
74+ );
75+ $ this ->assertSame (<<<BODY
76+ string \$param,
77+ string \$other,
78+ BODY , $ declaration ->renderParameters ());
79+ }
80+
81+ public function testWillRenderSignature (): void
82+ {
83+ $ declaration = new Declaration ($ this ->declarationName );
84+ $ this ->assertSame (': void ' , $ declaration ->renderSignature ());
85+
86+ $ declaration ->setReturnType ('' );
87+ $ this ->assertSame ('' , $ declaration ->renderSignature ());
88+
89+ $ declaration ->setReturnType ('self ' );
90+ $ this ->assertSame (': self ' , $ declaration ->renderSignature ());
91+
92+ $ declaration ->setReturnType ('string ' );
93+ $ declaration ->setNullable (true );
94+ $ this ->assertSame (': ?string ' , $ declaration ->renderSignature ());
95+ }
96+
6297 public function testWillRender (): void
6398 {
6499 $ comment = <<<COMM
@@ -74,7 +109,7 @@ public function testWillRender(): void
74109 ->addParameter (
75110 new Parameter ('param ' , 'string ' )
76111 );
77- $ this ->assertSame ($ this ->dataProviderRenderedDeclaration (), $ declaration -> render () );
112+ $ this ->assertSame ($ this ->dataProviderRenderedDeclaration (), ( string ) $ declaration );
78113 }
79114
80115 private function dataProviderRenderedDeclaration (): string
0 commit comments