-
-
Notifications
You must be signed in to change notification settings - Fork 554
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use "as" instead of passing around committer - also fixes current use…
…r not applied when calling commit without event
- Loading branch information
1 parent
b9db5b6
commit caf98e1
Showing
4 changed files
with
54 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,18 +171,30 @@ public function it_gets_git_user_info() | |
$this->assertEquals('Spock', Git::gitUserName()); | ||
$this->assertEquals('[email protected]', Git::gitUserEmail()); | ||
|
||
$user = User::make() | ||
->email('[email protected]') | ||
->data(['name' => 'Chewy']) | ||
$this->actingAs( | ||
User::make() | ||
->email('[email protected]') | ||
->data(['name' => 'Chewy']) | ||
->makeSuper() | ||
); | ||
|
||
$this->assertEquals('Chewy', Git::gitUserName()); | ||
$this->assertEquals('[email protected]', Git::gitUserEmail()); | ||
|
||
$han = User::make() | ||
->email('[email protected]') | ||
->data(['name' => 'Han Solo']) | ||
->makeSuper(); | ||
|
||
$this->assertEquals('Chewy', Git::gitUserName($user)); | ||
$this->assertEquals('[email protected]', Git::gitUserEmail($user)); | ||
Git::as($han); | ||
|
||
$this->assertEquals('Han Solo', Git::gitUserName()); | ||
$this->assertEquals('[email protected]', Git::gitUserEmail()); | ||
|
||
Config::set('statamic.git.use_authenticated', false); | ||
|
||
$this->assertEquals('Spock', Git::gitUserName($user)); | ||
$this->assertEquals('[email protected]', Git::gitUserEmail($user)); | ||
$this->assertEquals('Spock', Git::gitUserName()); | ||
$this->assertEquals('[email protected]', Git::gitUserEmail()); | ||
} | ||
|
||
/** @test */ | ||
|