@@ -24,16 +24,43 @@ public function testDetails(): void
24
24
{
25
25
$ details = new TemplateClassDetails (MakerBundle::class, false );
26
26
27
- self ::assertSame ('use Symfony\Bundle\MakerBundle\MakerBundle; ' , $ details ->getUseStatement ());
28
- self ::assertSame (' private $makerBundle; ' , $ details ->getPropertyStatement ());
27
+ self ::assertSame (sprintf ('use Symfony\Bundle\MakerBundle\MakerBundle;%s ' , "\n" ), $ details ->getUseStatement ());
28
+ self ::assertSame (sprintf (' private $makerBundle;%s ' , "\n" ), $ details ->getPropertyStatement ());
29
+ self ::assertSame (sprintf (' $this->makerBundle = $makerBundle;%s ' , "\n" ), $ details ->getConstructorArgument ());
29
30
self ::assertSame ('MakerBundle $makerBundle ' , $ details ->getMethodArgument ());
31
+ self ::assertSame ('$this->makerBundle ' , $ details ->getProperty ());
30
32
self ::assertSame ('$makerBundle ' , $ details ->getVariable ());
31
33
}
32
34
33
35
public function testDetailsTypedProperties (): void
34
36
{
35
37
$ details = new TemplateClassDetails (MakerBundle::class, true );
36
38
37
- self ::assertSame ('private MakerBundle $makerBundle; ' , $ details ->getPropertyStatement ());
39
+ self ::assertSame (sprintf (' private MakerBundle $makerBundle;%s ' , "\n" ), $ details ->getPropertyStatement ());
40
+ }
41
+
42
+ public function testUseStatementWithoutTrailingNewLine (): void
43
+ {
44
+ $ details = new TemplateClassDetails (MakerBundle::class, false );
45
+
46
+ self ::assertSame ('use Symfony\Bundle\MakerBundle\MakerBundle; ' , $ details ->getUseStatement (false ));
47
+ }
48
+
49
+ public function testGetPropertyStatementArguments (): void
50
+ {
51
+ $ details = new TemplateClassDetails (MakerBundle::class, false );
52
+
53
+ self ::assertSame (' private $makerBundle; ' , $ details ->getPropertyStatement (false ));
54
+ self ::assertSame (sprintf ('private $makerBundle;%s ' , "\n" ), $ details ->getPropertyStatement (true , false ));
55
+ self ::assertSame ('private $makerBundle; ' , $ details ->getPropertyStatement (false , false ));
56
+ }
57
+
58
+ public function testGetConstructorArgumentArguments (): void
59
+ {
60
+ $ details = new TemplateClassDetails (MakerBundle::class, false );
61
+
62
+ self ::assertSame (' $this->makerBundle = $makerBundle; ' , $ details ->getConstructorArgument (false , true ));
63
+ self ::assertSame (sprintf ('$this->makerBundle = $makerBundle;%s ' , "\n" ), $ details ->getConstructorArgument (true , false ));
64
+ self ::assertSame ('$this->makerBundle = $makerBundle; ' , $ details ->getConstructorArgument (false , false ));
38
65
}
39
66
}
0 commit comments