@@ -76,6 +76,49 @@ public function getTestDetails()
76
76
}),
77
77
];
78
78
79
+ yield 'it_generates_with_translator_installed ' => [$ this ->createResetPasswordTest ()
80
+ ->addExtraDependencies ('symfony/translation ' )
81
+ ->run (function (MakerTestRunner $ runner ) {
82
+ $ this ->makeUser ($ runner );
83
+
84
+ $ output = $ runner ->runMaker ([
85
+ 'App\Entity\User ' ,
86
+ 'app_home ' ,
87
+ 'victor@symfonycasts.com ' ,
88
+ 'SymfonyCasts ' ,
89
+ ]);
90
+
91
+ $ this ->assertStringContainsString ('Success ' , $ output );
92
+
93
+ $ generatedFiles = [
94
+ 'src/Controller/ResetPasswordController.php ' ,
95
+ 'src/Entity/ResetPasswordRequest.php ' ,
96
+ 'src/Form/ChangePasswordFormType.php ' ,
97
+ 'src/Form/ResetPasswordRequestFormType.php ' ,
98
+ 'src/Repository/ResetPasswordRequestRepository.php ' ,
99
+ 'templates/reset_password/check_email.html.twig ' ,
100
+ 'templates/reset_password/email.html.twig ' ,
101
+ 'templates/reset_password/request.html.twig ' ,
102
+ 'templates/reset_password/reset.html.twig ' ,
103
+ ];
104
+
105
+ foreach ($ generatedFiles as $ file ) {
106
+ $ this ->assertFileExists ($ runner ->getPath ($ file ));
107
+ }
108
+
109
+ $ configFileContents = file_get_contents ($ runner ->getPath ('config/packages/reset_password.yaml ' ));
110
+
111
+ // Flex recipe adds comments in reset_password.yaml, check file was replaced by maker
112
+ $ this ->assertStringNotContainsString ('# ' , $ configFileContents );
113
+
114
+ $ resetPasswordConfig = $ runner ->readYaml ('config/packages/reset_password.yaml ' );
115
+
116
+ $ this ->assertSame ('App\Repository\ResetPasswordRequestRepository ' , $ resetPasswordConfig ['symfonycasts_reset_password ' ]['request_password_repository ' ]);
117
+
118
+ $ this ->runResetPasswordTest ($ runner , 'it_generates_with_normal_setup.php ' );
119
+ }),
120
+ ];
121
+
79
122
yield 'it_generates_with_custom_config ' => [$ this ->createResetPasswordTest ()
80
123
->run (function (MakerTestRunner $ runner ) {
81
124
$ runner ->deleteFile ('config/packages/reset_password.yaml ' );
0 commit comments