14
14
use Symfony \Bundle \MakerBundle \Maker \MakeResetPassword ;
15
15
use Symfony \Bundle \MakerBundle \Test \MakerTestCase ;
16
16
use Symfony \Bundle \MakerBundle \Test \MakerTestDetails ;
17
+ use Symfony \Component \Filesystem \Filesystem ;
17
18
18
19
class MakeResetPasswordTest extends MakerTestCase
19
20
{
@@ -29,7 +30,30 @@ public function getTestDetails()
29
30
])
30
31
->addExtraDependencies ('security-bundle ' )
31
32
->addExtraDependencies ('twig ' )
32
- ->setFixtureFilesPath (__DIR__ .'/../fixtures/MakeResetPassword ' ),
33
+ ->setFixtureFilesPath (__DIR__ .'/../fixtures/MakeResetPassword ' )
34
+ ->assert (
35
+ function (string $ output , string $ directory ) {
36
+ $ this ->assertStringContainsString ('Success ' , $ output );
37
+
38
+ $ fs = new Filesystem ();
39
+
40
+ $ generatedFiles = [
41
+ 'src/Controller/ResetPasswordController.php ' ,
42
+ 'src/Entity/ResetPasswordRequest.php ' ,
43
+ 'src/Form/ChangePasswordFormType.php ' ,
44
+ 'src/Form/ResetPasswordRequestFormType.php ' ,
45
+ 'src/Repository/ResetPasswordRequestRepository.php ' ,
46
+ 'templates/reset_password/check_email.html.twig ' ,
47
+ 'templates/reset_password/email.html.twig ' ,
48
+ 'templates/reset_password/request.html.twig ' ,
49
+ 'templates/reset_password/reset.html.twig '
50
+ ];
51
+
52
+ foreach ($ generatedFiles as $ file ) {
53
+ $ this ->assertTrue ($ fs ->exists (sprintf ('%s/%s ' , $ directory , $ file )));
54
+ }
55
+ }
56
+ )
33
57
];
34
58
}
35
59
}
0 commit comments