Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Jan 5, 2024
1 parent 5bd2163 commit 9af1fed
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/Git/GitEventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ public function setUp(): void
Config::set('statamic.git', $defaultConfig);
Config::set('statamic.git.enabled', true);

$this->user = User::make()
->id('chewbacca')
->email('[email protected]')
->data(['name' => 'Chewbacca'])
->makeSuper();

$this->actingAs($this->user);
$this->actingAs(
$user = User::make()
->id('chewbacca')
->email('[email protected]')
->data(['name' => 'Chewbacca'])
->makeSuper()
);

Config::set('filesystems.disks.test', [
'driver' => 'local',
Expand All @@ -49,13 +49,13 @@ public function setUp(): void
Storage::fake('test');

Git::shouldReceive('statuses');
Git::shouldReceive('as')->with($this->user);
Git::shouldReceive('as')->with($user);
}

/** @test */
public function it_doesnt_commit_when_git_is_disabled()
{
Git::shouldReceive('as')->with($this->user)->never();
Git::shouldReceive('as')->never();
Git::shouldReceive('dispatchCommit')->with('Collection saved')->never();
Git::shouldReceive('dispatchCommit')->with('Collection deleted')->never();

Expand All @@ -70,7 +70,7 @@ public function it_doesnt_commit_when_git_is_disabled()
/** @test */
public function it_doesnt_commit_when_automatic_is_disabled()
{
Git::shouldReceive('as')->with($this->user)->never();
Git::shouldReceive('as')->never();
Git::shouldReceive('dispatchCommit')->with('Collection saved')->never();
Git::shouldReceive('dispatchCommit')->with('Collection deleted')->never();

Expand All @@ -85,7 +85,7 @@ public function it_doesnt_commit_when_automatic_is_disabled()
/** @test */
public function it_doesnt_commit_ignored_events()
{
Git::shouldReceive('as')->with($this->user)->never();
Git::shouldReceive('as')->never();
Git::shouldReceive('dispatchCommit')->with('Collection saved')->never();
Git::shouldReceive('dispatchCommit')->with('Collection deleted')->once();

Expand All @@ -102,7 +102,7 @@ public function it_doesnt_commit_ignored_events()
/** @test */
public function it_doesnt_commit_when_event_subscriber_is_disabled()
{
Git::shouldReceive('as')->with($this->user)->never();
Git::shouldReceive('as')->never();
Git::shouldReceive('dispatchCommit')->with('Collection saved')->never();
Git::shouldReceive('dispatchCommit')->with('Collection deleted')->once();

Expand Down

0 comments on commit 9af1fed

Please sign in to comment.