@@ -58,7 +58,7 @@ public function setUp(): void
5858 $ this ->io = $ this ->createMock (IO ::class);
5959 $ this ->repository = $ this ->createMock (Repository::class);
6060 $ this ->action = $ this ->createMock (Action::class);
61- $ this ->hook = $ this ->createPartialMock (ValidateAuthorAction::class, ['getConfig ' ]);
61+ $ this ->hook = $ this ->createPartialMock (ValidateAuthorAction::class, ['getGitAuthorIdentity ' ]);
6262 }
6363
6464 /**
@@ -71,7 +71,7 @@ public function missingConfigurationStopsExecution(): void
7171 ->willReturn (new Options ([]));
7272
7373 $ this ->hook ->expects (self ::never ())
74- ->method ('getConfig ' );
74+ ->method ('getGitAuthorIdentity ' );
7575
7676 $ this ->hook ->execute ($ this ->config , $ this ->io , $ this ->repository , $ this ->action );
7777 }
@@ -86,9 +86,9 @@ public function configuredNameRegexWillTriggerValidation(): void
8686 ->willReturn (new Options (['name ' => '/Some author name/ ' ]));
8787
8888 $ this ->hook ->expects (self ::once ())
89- ->method ('getConfig ' )
90- ->with ($ this ->repository , ' user.name ' )
91- ->willReturn ('Some author name ' );
89+ ->method ('getGitAuthorIdentity ' )
90+ ->with ($ this ->repository )
91+ ->
willReturn (
new GitIdentity ( 'Some author name ' , ' [email protected] ' ) );
9292
9393 $ this ->hook ->execute ($ this ->config , $ this ->io , $ this ->repository , $ this ->action );
9494 }
@@ -103,9 +103,9 @@ public function nameValidationWillNotThrowExceptionIfMatches(): void
103103 ->willReturn (new Options (['name ' => '/[A-F]+/ ' ]));
104104
105105 $ this ->hook ->expects (self ::once ())
106- ->method ('getConfig ' )
107- ->with ($ this ->repository , ' user.name ' )
108- ->willReturn ('ABCDEF ' );
106+ ->method ('getGitAuthorIdentity ' )
107+ ->with ($ this ->repository )
108+ ->
willReturn (
new GitIdentity ( 'ABCDEF ' , ' [email protected] ' ) );
109109
110110 $ this ->hook ->execute ($ this ->config , $ this ->io , $ this ->repository , $ this ->action );
111111 }
@@ -122,9 +122,9 @@ public function nameValidationWillThrowExceptionIfNotMatches(): void
122122 ->willReturn (new Options (['name ' => '/^[1-9]+$/ ' ]));
123123
124124 $ this ->hook ->expects (self ::once ())
125- ->method ('getConfig ' )
126- ->with ($ this ->repository , ' user.name ' )
127- ->willReturn ('ABCDEF ' );
125+ ->method ('getGitAuthorIdentity ' )
126+ ->with ($ this ->repository )
127+ ->
willReturn (
new GitIdentity ( 'ABCDEF ' , ' [email protected] ' ) );
128128
129129 $ this ->hook ->execute ($ this ->config , $ this ->io , $ this ->repository , $ this ->action );
130130 }
@@ -139,9 +139,9 @@ public function configuredEmailRegexWillTriggerValidation(): void
139139 ->
willReturn (
new Options ([
'email ' =>
'/[email protected] / ' ]));
140140
141141 $ this ->hook ->expects (self ::once ())
142- ->method ('getConfig ' )
143- ->with ($ this ->repository , ' user.email ' )
144- ->
willReturn (
' [email protected] ');
142+ ->method ('getGitAuthorIdentity ' )
143+ ->with ($ this ->repository )
144+ ->
willReturn (
new GitIdentity ( ' Some author name ' , ' [email protected] ') );
145145
146146 $ this ->hook ->execute ($ this ->config , $ this ->io , $ this ->repository , $ this ->action );
147147 }
@@ -156,9 +156,9 @@ public function emailValidationWillNotThrowExceptionIfMatches(): void
156156 ->willReturn (new Options (['email ' => '/@/ ' ]));
157157
158158 $ this ->hook ->expects (self ::once ())
159- ->method ('getConfig ' )
160- ->with ($ this ->repository , ' user.email ' )
161- ->
willReturn (
' [email protected] ');
159+ ->method ('getGitAuthorIdentity ' )
160+ ->with ($ this ->repository )
161+ ->
willReturn (
new GitIdentity ( ' Some author name ' , ' [email protected] ') );
162162
163163 $ this ->hook ->execute ($ this ->config , $ this ->io , $ this ->repository , $ this ->action );
164164 }
@@ -175,9 +175,9 @@ public function emailValidationWillThrowExceptionIfNotMatches(): void
175175 ->willReturn (new Options (['email ' => '/^[1-9]+$/ ' ]));
176176
177177 $ this ->hook ->expects (self ::once ())
178- ->method ('getConfig ' )
179- ->with ($ this ->repository , ' user.email ' )
180- ->
willReturn (
' [email protected] ');
178+ ->method ('getGitAuthorIdentity ' )
179+ ->with ($ this ->repository )
180+ ->
willReturn (
new GitIdentity ( ' Some author name ' , ' [email protected] ') );
181181
182182 $ this ->hook ->execute ($ this ->config , $ this ->io , $ this ->repository , $ this ->action );
183183 }
0 commit comments