Create test for app/Observers/ScoreSheetObserver

This commit is contained in:
Matt Young 2025-07-04 14:03:26 -05:00
parent fbe74571f6
commit f9cb50a445
1 changed files with 4 additions and 4 deletions

View File

@ -21,17 +21,17 @@ afterEach(function () {
it('totals an entries scores when a score sheet is created', function () { it('totals an entries scores when a score sheet is created', function () {
$this->mock->shouldReceive('__invoke') $this->mock->shouldReceive('__invoke')
->once() ->once()
->with(\Mockery::type(Entry::class), true) ->with(Mockery::type(Entry::class), true)
->andReturn(null); ->andReturn(null);
Cache::shouldReceive('forget')->twice(); Cache::shouldReceive('forget')->twice();
$sheet = ScoreSheet::factory()->create(); ScoreSheet::factory()->create();
}); });
it('totals an entries scores when a score sheet is update', function () { it('totals an entries scores when a score sheet is update', function () {
$this->mock->shouldReceive('__invoke') $this->mock->shouldReceive('__invoke')
->twice() ->twice()
->with(\Mockery::type(Entry::class), true) ->with(Mockery::type(Entry::class), true)
->andReturn(null); ->andReturn(null);
Cache::shouldReceive('forget')->times(4); Cache::shouldReceive('forget')->times(4);
$sheet = ScoreSheet::factory()->create(); $sheet = ScoreSheet::factory()->create();
@ -41,7 +41,7 @@ it('totals an entries scores when a score sheet is update', function () {
it('totals an entries scores when a score sheet is deleted', function () { it('totals an entries scores when a score sheet is deleted', function () {
$this->mock->shouldReceive('__invoke') $this->mock->shouldReceive('__invoke')
->twice() ->twice()
->with(\Mockery::type(Entry::class), true) ->with(Mockery::type(Entry::class), true)
->andReturn(null); ->andReturn(null);
Cache::shouldReceive('forget')->times(4); Cache::shouldReceive('forget')->times(4);
$sheet = ScoreSheet::factory()->create(); $sheet = ScoreSheet::factory()->create();