30 lines
672 B
PHP
30 lines
672 B
PHP
<?php
|
|
|
|
use App\Models\Doubler;
|
|
use App\Models\Entry;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
beforeEach(function () {
|
|
$this->entry = Entry::factory()->create();
|
|
app()->forgetInstance(Doubler::class);
|
|
|
|
});
|
|
|
|
afterEach(function () {
|
|
Mockery::close();
|
|
\Mockery::getConfiguration()->allowMockingNonExistentMethods(true);
|
|
Cache::flush();
|
|
});
|
|
|
|
it('syncs doublers when a flag is added', function () {
|
|
Mockery::mock('overload:App\Models\Doubler')
|
|
->shouldReceive('syncDoublers')
|
|
->once()
|
|
->andReturn(null);
|
|
|
|
$this->entry->addFlag('declined');
|
|
})->skip();
|
|
// TODO Figure out how to test
|