chore: remove pragmarx/countries-laravel dependency (#6237)

This commit is contained in:
Alexis Saettler
2022-07-31 10:37:15 +02:00
committed by GitHub
parent 84d0232095
commit a5ff8fc247
43 changed files with 1389 additions and 1862 deletions
@@ -0,0 +1,54 @@
<?php
namespace Tests\Commands\Scheduling;
use Carbon\Carbon;
use Tests\TestCase;
use App\Models\Account\Account;
use App\Models\Contact\Contact;
use Illuminate\Support\Facades\Bus;
use App\Jobs\StayInTouch\ScheduleStayInTouch;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class SendStayInTouchTest extends TestCase
{
use DatabaseTransactions;
/** @test */
public function it_schedules_a_stay_in_touch_job()
{
Bus::fake();
Carbon::setTestNow(Carbon::create(2017, 1, 1, 7, 0, 0));
$account = factory(Account::class)->create([]);
$contact = factory(Contact::class)->create([
'account_id' => $account->id,
'stay_in_touch_trigger_date' => '2017-01-01 07:00:00',
'stay_in_touch_frequency' => 30,
]);
$this->artisan('send:stay_in_touch')->run();
Bus::assertDispatched(ScheduleStayInTouch::class);
}
/** @test */
public function it_doesnt_schedule_stay_in_touch_jobs_if_no_date_is_found()
{
Bus::fake();
Carbon::setTestNow(Carbon::create(2017, 1, 1, 7, 0, 0));
$account = factory(Account::class)->create([]);
$contact = factory(Contact::class)->create([
'account_id' => $account->id,
'stay_in_touch_trigger_date' => '2017-03-01 07:00:00',
'stay_in_touch_frequency' => 30,
]);
$this->artisan('send:stay_in_touch')->run();
Bus::assertNotDispatched(ScheduleStayInTouch::class);
}
}