Files
monica/tests/Commands/Scheduling/DavClientsUpdateTest.php
T
2022-07-31 10:37:15 +02:00

29 lines
731 B
PHP

<?php
namespace Tests\Commands\Scheduling;
use Tests\TestCase;
use App\Jobs\SynchronizeAddressBooks;
use Illuminate\Support\Facades\Queue;
use App\Models\Account\AddressBookSubscription;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class DavClientsUpdateTest extends TestCase
{
use DatabaseTransactions;
/** @test */
public function it_dispatch_subscription_update()
{
Queue::fake();
$subscription = AddressBookSubscription::factory()->create();
$this->artisan('monica:davclients')->run();
Queue::assertPushed(SynchronizeAddressBooks::class, function ($job) use ($subscription) {
return $job->subscription->id === $subscription->id;
});
}
}