From 387e45b85dd29d133f2af8971bb9639cb8a06e10 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 10 Aug 2019 16:12:47 +0200 Subject: [PATCH] chore(deps): bump laravel/cashier from 8.0.1 to 9.3.5 (#2857) * chore(deps): bump laravel/cashier from 8.0.1 to 9.3.5 Bumps [laravel/cashier](https://github.com/laravel/cashier) from 8.0.1 to 9.3.5. - [Release notes](https://github.com/laravel/cashier/releases) - [Changelog](https://github.com/laravel/cashier/blob/9.0/CHANGELOG.md) - [Upgrade guide](https://github.com/laravel/cashier/blob/9.0/UPGRADE.md) - [Commits](https://github.com/laravel/cashier/compare/v8.0.1...v9.3.5) Signed-off-by: dependabot-preview[bot] --- app/Helpers/WeatherHelper.php | 3 +- .../Contacts/ActivitiesController.php | 2 +- app/Notifications/ConfirmEmail.php | 3 +- app/Services/Task/UpdateTask.php | 3 +- composer.json | 2 +- composer.lock | 136 +++++++----------- .../Contact/ApiConversationControllerTest.php | 2 +- .../Contact/ApiLifeEventControllerTest.php | 2 +- .../Api/Contact/ApiMessageControllerTest.php | 2 +- tests/Feature/ActivityTest.php | 34 +++++ .../Activity/ActivityStatisticServiceTest.php | 24 ++-- .../Services/Contact/Call/CreateCallTest.php | 19 ++- .../Services/Contact/Call/UpdateCallTest.php | 23 ++- .../AddMessageToConversationTest.php | 9 +- .../Conversation/CreateConversationTest.php | 9 +- .../Conversation/UpdateConversationTest.php | 3 +- .../Conversation/UpdateMessageTest.php | 7 +- .../Contact/LifeEvent/CreateLifeEventTest.php | 11 +- .../Contact/LifeEvent/UpdateLifeEventTest.php | 3 +- .../Contact/Reminder/CreateReminderTest.php | 2 +- .../Contact/Reminder/UpdateReminderTest.php | 2 +- 21 files changed, 143 insertions(+), 158 deletions(-) create mode 100644 tests/Feature/ActivityTest.php diff --git a/app/Helpers/WeatherHelper.php b/app/Helpers/WeatherHelper.php index 167368fdd..830ffbef1 100644 --- a/app/Helpers/WeatherHelper.php +++ b/app/Helpers/WeatherHelper.php @@ -2,7 +2,6 @@ namespace App\Helpers; -use Carbon\Carbon; use App\Models\Account\Weather; use App\Models\Contact\Address; use App\Services\Instance\Weather\GetWeatherInformation; @@ -28,7 +27,7 @@ class WeatherHelper if (is_null($weather)) { $weather = self::callWeatherAPI($address); } else { - if (! $weather->created_at->between(Carbon::now()->subHour(6), Carbon::now())) { + if (! $weather->created_at->between(now()->subHours(6), now())) { $weather = self::callWeatherAPI($address); } } diff --git a/app/Http/Controllers/Contacts/ActivitiesController.php b/app/Http/Controllers/Contacts/ActivitiesController.php index a1a36e634..846e46425 100644 --- a/app/Http/Controllers/Contacts/ActivitiesController.php +++ b/app/Http/Controllers/Contacts/ActivitiesController.php @@ -42,7 +42,7 @@ class ActivitiesController extends Controller $endDate = Carbon::create($year, 12, 31); $activitiesLastTwelveMonths = $this->activityStatisticService - ->activitiesWithContactInTimeRange($contact, Carbon::now()->subMonths(12), Carbon::now()) + ->activitiesWithContactInTimeRange($contact, now()->subMonths(12), now()) ->count(); $uniqueActivityTypes = $this->activityStatisticService diff --git a/app/Notifications/ConfirmEmail.php b/app/Notifications/ConfirmEmail.php index 722ea9cb9..448d45652 100644 --- a/app/Notifications/ConfirmEmail.php +++ b/app/Notifications/ConfirmEmail.php @@ -4,7 +4,6 @@ namespace App\Notifications; use App\Models\User\User; use Illuminate\Bus\Queueable; -use Illuminate\Support\Carbon; use App\Models\Account\Account; use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\URL; @@ -75,7 +74,7 @@ class ConfirmEmail extends LaravelNotification implements ShouldQueue, MailNotif protected function verificationUrl($notifiable) { return URL::temporarySignedRoute( - 'verification.verify', Carbon::now()->addMinutes(60), ['id' => $notifiable->getKey()] + 'verification.verify', now()->addMinutes(60), ['id' => $notifiable->getKey()] ); } } diff --git a/app/Services/Task/UpdateTask.php b/app/Services/Task/UpdateTask.php index 3b6d82c50..919261478 100644 --- a/app/Services/Task/UpdateTask.php +++ b/app/Services/Task/UpdateTask.php @@ -2,7 +2,6 @@ namespace App\Services\Task; -use Carbon\Carbon; use App\Models\Contact\Task; use App\Services\BaseService; @@ -48,7 +47,7 @@ class UpdateTask extends BaseService 'title' => $data['title'], 'description' => (! empty($data['description']) ? $data['description'] : null), 'completed' => $data['completed'], - 'completed_at' => ($data['completed'] == true ? Carbon::now() : null), + 'completed_at' => ($data['completed'] == true ? now() : null), ]); return $task; diff --git a/composer.json b/composer.json index 5bb4f7f87..2fb8d73ab 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "intervention/image": "^2.3", "jenssegers/date": "^3.3", "lahaxearnaud/laravel-u2f": "^1.5", - "laravel/cashier": "~8.0", + "laravel/cashier": "~9.3", "laravel/framework": "5.8.*", "laravel/passport": "^7.2", "laravel/socialite": "^4.0", diff --git a/composer.lock b/composer.lock index cd4d7e9ca..83e386b70 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "520581f1bc9f53bb5d0cbd83b82af392", + "content-hash": "f5b24678e91d4e96493769868ef2f40b", "packages": [ { "name": "asbiin/laravel-webauthn", @@ -2144,51 +2144,6 @@ ], "time": "2019-03-10T08:50:58+00:00" }, - { - "name": "kylekatarnls/update-helper", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/kylekatarnls/update-helper.git", - "reference": "5786fa188e0361b9adf9e8199d7280d1b2db165e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/kylekatarnls/update-helper/zipball/5786fa188e0361b9adf9e8199d7280d1b2db165e", - "reference": "5786fa188e0361b9adf9e8199d7280d1b2db165e", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1.0 || ^2.0.0", - "php": ">=5.3.0" - }, - "require-dev": { - "codeclimate/php-test-reporter": "dev-master", - "composer/composer": "2.0.x-dev || ^2.0.0-dev", - "phpunit/phpunit": ">=4.8.35 <6.0" - }, - "type": "composer-plugin", - "extra": { - "class": "UpdateHelper\\ComposerPlugin" - }, - "autoload": { - "psr-0": { - "UpdateHelper\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kyle", - "email": "kylekatarnls@gmail.com" - } - ], - "description": "Update helper", - "time": "2019-07-29T11:03:54+00:00" - }, { "name": "lahaxearnaud/laravel-u2f", "version": "1.5.3", @@ -2258,39 +2213,40 @@ }, { "name": "laravel/cashier", - "version": "v8.0.1", + "version": "v9.3.5", "source": { "type": "git", "url": "https://github.com/laravel/cashier.git", - "reference": "52bdcbe4c911d1075651d529fa40059abbd96139" + "reference": "77e7ebabd2f71c1059c4829fcbc1e4e662610b2a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/cashier/zipball/52bdcbe4c911d1075651d529fa40059abbd96139", - "reference": "52bdcbe4c911d1075651d529fa40059abbd96139", + "url": "https://api.github.com/repos/laravel/cashier/zipball/77e7ebabd2f71c1059c4829fcbc1e4e662610b2a", + "reference": "77e7ebabd2f71c1059c4829fcbc1e4e662610b2a", "shasum": "" }, "require": { "dompdf/dompdf": "^0.8.0", - "illuminate/database": "~5.3", - "illuminate/support": "~5.3", - "nesbot/carbon": "~1.0", - "php": ">=7.0", + "ext-json": "*", + "illuminate/contracts": "~5.7.0|~5.8.0|^6.0", + "illuminate/database": "~5.7.0|~5.8.0|^6.0", + "illuminate/http": "~5.7.0|~5.8.0|^6.0", + "illuminate/routing": "~5.7.0|~5.8.0|^6.0", + "illuminate/support": "~5.7.0|~5.8.0|^6.0", + "illuminate/view": "~5.7.0|~5.8.0|^6.0", + "nesbot/carbon": "^1.26.3|^2.0", + "php": "^7.1.3", "stripe/stripe-php": "~6.0", - "symfony/http-kernel": "~2.7|~3.0|~4.0" + "symfony/http-kernel": "~4.0" }, "require-dev": { - "illuminate/http": "~5.3", - "illuminate/routing": "~5.3", - "illuminate/view": "~5.3", "mockery/mockery": "~1.0", - "phpunit/phpunit": "~6.0", - "vlucas/phpdotenv": "~2.0" + "phpunit/phpunit": "~7.4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.0-dev" + "dev-master": "9.0-dev" }, "laravel": { "providers": [ @@ -2319,7 +2275,7 @@ "laravel", "stripe" ], - "time": "2018-11-21T13:42:39+00:00" + "time": "2019-07-30T15:18:35+00:00" }, { "name": "laravel/framework", @@ -3651,34 +3607,36 @@ }, { "name": "nesbot/carbon", - "version": "1.39.0", + "version": "2.22.3", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "dd62a58af4e0775a45ea5f99d0363d81b7d9a1e0" + "reference": "738fbd8d80b2c5e158fda76c29c2de432fcc6f7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/dd62a58af4e0775a45ea5f99d0363d81b7d9a1e0", - "reference": "dd62a58af4e0775a45ea5f99d0363d81b7d9a1e0", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/738fbd8d80b2c5e158fda76c29c2de432fcc6f7e", + "reference": "738fbd8d80b2c5e158fda76c29c2de432fcc6f7e", "shasum": "" }, "require": { - "kylekatarnls/update-helper": "^1.1", - "php": ">=5.3.9", - "symfony/translation": "~2.6 || ~3.0 || ~4.0" + "ext-json": "*", + "php": "^7.1.8 || ^8.0", + "symfony/translation": "^3.4 || ^4.0" }, "require-dev": { - "composer/composer": "^1.2", - "friendsofphp/php-cs-fixer": "~2", - "phpunit/phpunit": "^4.8.35 || ^5.7" + "friendsofphp/php-cs-fixer": "^2.14 || ^3.0", + "kylekatarnls/multi-tester": "^1.1", + "phpmd/phpmd": "dev-php-7.1-compatibility", + "phpstan/phpstan": "^0.11", + "phpunit/phpunit": "^7.5 || ^8.0", + "squizlabs/php_codesniffer": "^3.4" }, "bin": [ - "bin/upgrade-carbon" + "bin/carbon" ], "type": "library", "extra": { - "update-helper": "Carbon\\Upgrade", "laravel": { "providers": [ "Carbon\\Laravel\\ServiceProvider" @@ -3687,7 +3645,7 @@ }, "autoload": { "psr-4": { - "": "src/" + "Carbon\\": "src/Carbon/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3699,6 +3657,10 @@ "name": "Brian Nesbitt", "email": "brian@nesbot.com", "homepage": "http://nesbot.com" + }, + { + "name": "kylekatarnls", + "homepage": "http://github.com/kylekatarnls" } ], "description": "A simple API extension for DateTime.", @@ -3708,7 +3670,7 @@ "datetime", "time" ], - "time": "2019-06-11T09:07:59+00:00" + "time": "2019-08-07T12:36:44+00:00" }, { "name": "nette/caching", @@ -6486,21 +6448,21 @@ "authors": [ { "name": "Evert Pot", + "role": "Developer", "email": "me@evertpot.com", - "homepage": "http://evertpot.com/", - "role": "Developer" + "homepage": "http://evertpot.com/" }, { "name": "Dominik Tobschall", + "role": "Developer", "email": "dominik@fruux.com", - "homepage": "http://tobschall.de/", - "role": "Developer" + "homepage": "http://tobschall.de/" }, { "name": "Ivan Enderlin", + "role": "Developer", "email": "ivan.enderlin@hoa-project.net", - "homepage": "http://mnt.io/", - "role": "Developer" + "homepage": "http://mnt.io/" } ], "description": "The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects", @@ -6960,16 +6922,16 @@ }, { "name": "stripe/stripe-php", - "version": "v6.30.5", + "version": "v6.43.0", "source": { "type": "git", "url": "https://github.com/stripe/stripe-php.git", - "reference": "1ffc751e7ee2d68b3e4a0068f5537b8334945467" + "reference": "c06eb0da0e73750cab75948dd9ca4a15cf829e68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stripe/stripe-php/zipball/1ffc751e7ee2d68b3e4a0068f5537b8334945467", - "reference": "1ffc751e7ee2d68b3e4a0068f5537b8334945467", + "url": "https://api.github.com/repos/stripe/stripe-php/zipball/c06eb0da0e73750cab75948dd9ca4a15cf829e68", + "reference": "c06eb0da0e73750cab75948dd9ca4a15cf829e68", "shasum": "" }, "require": { @@ -7012,7 +6974,7 @@ "payment processing", "stripe" ], - "time": "2019-03-11T20:45:23+00:00" + "time": "2019-08-09T20:54:08+00:00" }, { "name": "swiftmailer/swiftmailer", diff --git a/tests/Api/Contact/ApiConversationControllerTest.php b/tests/Api/Contact/ApiConversationControllerTest.php index 68c18ef26..a7359fb84 100644 --- a/tests/Api/Contact/ApiConversationControllerTest.php +++ b/tests/Api/Contact/ApiConversationControllerTest.php @@ -44,7 +44,7 @@ class ApiConversationControllerTest extends ApiTestCase 'account_id' => $user->account_id, 'contact_id' => $contact->id, 'contact_field_type_id' => $contactFieldType->id, - 'happened_at' => \Carbon\Carbon::now(), + 'happened_at' => now(), ]); return $conversation; diff --git a/tests/Api/Contact/ApiLifeEventControllerTest.php b/tests/Api/Contact/ApiLifeEventControllerTest.php index f5be4b80c..26496e148 100644 --- a/tests/Api/Contact/ApiLifeEventControllerTest.php +++ b/tests/Api/Contact/ApiLifeEventControllerTest.php @@ -46,7 +46,7 @@ class ApiLifeEventControllerTest extends ApiTestCase 'account_id' => $user->account_id, 'contact_id' => $contact->id, 'life_event_type_id' => $lifeEventType->id, - 'happened_at' => \Carbon\Carbon::now(), + 'happened_at' => now(), 'name' => 'This is a text', 'note' => 'This is a text', ]); diff --git a/tests/Api/Contact/ApiMessageControllerTest.php b/tests/Api/Contact/ApiMessageControllerTest.php index 064b600c1..5d804b8bb 100644 --- a/tests/Api/Contact/ApiMessageControllerTest.php +++ b/tests/Api/Contact/ApiMessageControllerTest.php @@ -49,7 +49,7 @@ class ApiMessageControllerTest extends ApiTestCase 'account_id' => $user->account_id, 'contact_id' => $contact->id, 'contact_field_type_id' => $contactFieldType->id, - 'happened_at' => \Carbon\Carbon::now(), + 'happened_at' => now(), ]); return $conversation; diff --git a/tests/Feature/ActivityTest.php b/tests/Feature/ActivityTest.php new file mode 100644 index 000000000..c7da8df82 --- /dev/null +++ b/tests/Feature/ActivityTest.php @@ -0,0 +1,34 @@ +signin(); + + $contact = factory(Contact::class)->create([ + 'account_id' => $user->account_id, + ]); + + $activity1 = factory(Activity::class)->create([ + 'date_it_happened' => '2015-10-29 10:10:10', + 'account_id' => $contact->account_id, + 'description' => 'that happen', + ]); + $contact->activities()->attach($activity1, ['account_id' => $contact->account_id]); + + $response = $this->get("/people/{$contact->hashID()}/activities/2015"); + + $response->assertStatus(200); + $response->assertSee('that happen'); + } +} diff --git a/tests/Unit/Services/Account/Activity/ActivityStatisticServiceTest.php b/tests/Unit/Services/Account/Activity/ActivityStatisticServiceTest.php index 17d6acbd1..7d441bde5 100644 --- a/tests/Unit/Services/Account/Activity/ActivityStatisticServiceTest.php +++ b/tests/Unit/Services/Account/Activity/ActivityStatisticServiceTest.php @@ -23,7 +23,7 @@ class ActivityStatisticServiceTest extends TestCase for ($i = 0; $i <= 2; $i++) { $activity = factory(Activity::class)->create([ - 'date_it_happened' => Carbon::now()->subMonth(), + 'date_it_happened' => now()->subMonth(), 'account_id' => $contact->account_id, ]); $contact->activities()->attach($activity, ['account_id' => $contact->account_id]); @@ -31,12 +31,12 @@ class ActivityStatisticServiceTest extends TestCase $this->assertCount( 3, - $service->activitiesWithContactInTimeRange($contact, Carbon::now()->subMonths(2), Carbon::now()) + $service->activitiesWithContactInTimeRange($contact, now()->subMonths(2), now()) ); $this->assertInstanceOf( Activity::class, - $service->activitiesWithContactInTimeRange($contact, Carbon::now()->subMonths(2), Carbon::now())[1] + $service->activitiesWithContactInTimeRange($contact, now()->subMonths(2), now())[1] ); } @@ -47,7 +47,7 @@ class ActivityStatisticServiceTest extends TestCase for ($i = 0; $i <= 2; $i++) { $activity = factory(Activity::class)->create([ - 'date_it_happened' => Carbon::now()->subYears(2), + 'date_it_happened' => now()->subYears(2), 'account_id' => $contact->account_id, ]); $contact->activities()->attach($activity, ['account_id' => $contact->account_id]); @@ -55,7 +55,7 @@ class ActivityStatisticServiceTest extends TestCase $this->assertCount( 0, - $service->activitiesWithContactInTimeRange($contact, Carbon::now()->subMonths(2), Carbon::now()) + $service->activitiesWithContactInTimeRange($contact, now()->subMonths(2), now()) ); } @@ -74,7 +74,7 @@ class ActivityStatisticServiceTest extends TestCase for ($i = 0; $i <= 2; $i++) { $activity = factory(Activity::class)->create([ - 'date_it_happened' => Carbon::now(), + 'date_it_happened' => now(), 'account_id' => $account->id, 'activity_type_id' => $activityType->id, ]); @@ -87,14 +87,14 @@ class ActivityStatisticServiceTest extends TestCase ]); $activity = factory(Activity::class)->create([ - 'date_it_happened' => Carbon::now(), + 'date_it_happened' => now(), 'account_id' => $account->id, 'activity_type_id' => $activityType->id, ]); $contact->activities()->attach($activity, ['account_id' => $contact->account_id]); // here we should have 2 uniques activity types, one with 3 and the other with 1 occurence - $response = $service->uniqueActivityTypesInTimeRange($contact, Carbon::now()->subMonths(2), Carbon::now()); + $response = $service->uniqueActivityTypesInTimeRange($contact, now()->subMonths(2), now()); $this->assertCount( 2, @@ -132,7 +132,7 @@ class ActivityStatisticServiceTest extends TestCase for ($i = 0; $i <= 2; $i++) { $activity = factory(Activity::class)->create([ - 'date_it_happened' => Carbon::now()->subYears(2), + 'date_it_happened' => now()->subYears(2), 'account_id' => $account->id, ]); $contact->activities()->attach($activity, ['account_id' => $contact->account_id]); @@ -140,7 +140,7 @@ class ActivityStatisticServiceTest extends TestCase for ($i = 0; $i <= 5; $i++) { $activity = factory(Activity::class)->create([ - 'date_it_happened' => Carbon::now(), + 'date_it_happened' => now(), 'account_id' => $account->id, ]); $contact->activities()->attach($activity, ['account_id' => $contact->account_id]); @@ -149,14 +149,14 @@ class ActivityStatisticServiceTest extends TestCase $activityStatistic = $contact->activityStatistics()->make(); $activityStatistic->account_id = $contact->account_id; $activityStatistic->contact_id = $contact->id; - $activityStatistic->year = Carbon::now()->year; + $activityStatistic->year = now()->year; $activityStatistic->count = 6; $activityStatistic->save(); $activityStatistic = $contact->activityStatistics()->make(); $activityStatistic->account_id = $contact->account_id; $activityStatistic->contact_id = $contact->id; - $activityStatistic->year = Carbon::now()->subYears(2)->year; + $activityStatistic->year = now()->subYears(2)->year; $activityStatistic->count = 3; $activityStatistic->save(); diff --git a/tests/Unit/Services/Contact/Call/CreateCallTest.php b/tests/Unit/Services/Contact/Call/CreateCallTest.php index 0baaa5805..b7a8a7cd5 100644 --- a/tests/Unit/Services/Contact/Call/CreateCallTest.php +++ b/tests/Unit/Services/Contact/Call/CreateCallTest.php @@ -2,7 +2,6 @@ namespace Tests\Unit\Services\Contact\Conversation; -use Carbon\Carbon; use Tests\TestCase; use App\Models\Contact\Call; use App\Models\Account\Account; @@ -24,7 +23,7 @@ class CreateCallTest extends TestCase $request = [ 'contact_id' => $contact->id, 'account_id' => $contact->account->id, - 'called_at' => Carbon::now(), + 'called_at' => now(), 'content' => 'this is the content', ]; @@ -51,7 +50,7 @@ class CreateCallTest extends TestCase $request = [ 'contact_id' => $contact->id, 'account_id' => $contact->account->id, - 'called_at' => Carbon::now(), + 'called_at' => now(), 'content' => 'this is the content', 'contact_called' => true, ]; @@ -80,7 +79,7 @@ class CreateCallTest extends TestCase $request = [ 'contact_id' => $contact->id, 'account_id' => $contact->account->id, - 'called_at' => Carbon::now(), + 'called_at' => now(), 'content' => 'this is the content', 'contact_called' => true, 'emotions' => $emotionArray, @@ -120,7 +119,7 @@ class CreateCallTest extends TestCase $request = [ 'contact_id' => $contact->id, 'account_id' => $contact->account->id, - 'called_at' => Carbon::now(), + 'called_at' => now(), 'content' => 'this is the content', 'contact_called' => true, 'emotions' => $emotionArray, @@ -138,7 +137,7 @@ class CreateCallTest extends TestCase $request = [ 'contact_id' => $contact->id, 'account_id' => $contact->account->id, - 'called_at' => Carbon::now(), + 'called_at' => now(), ]; $call = app(CreateCall::class)->execute($request); @@ -157,7 +156,7 @@ class CreateCallTest extends TestCase 'last_talked_to' => '1900-01-01 00:00:00', ]); - $date = Carbon::now(); + $date = now(); $request = [ 'contact_id' => $contact->id, @@ -179,7 +178,7 @@ class CreateCallTest extends TestCase 'last_talked_to' => '2200-01-01 00:00:00', ]); - $date = Carbon::now(); + $date = now(); $request = [ 'contact_id' => $contact->id, @@ -201,7 +200,7 @@ class CreateCallTest extends TestCase $request = [ 'contact_id' => $contact->id, - 'called_at' => Carbon::now(), + 'called_at' => now(), ]; $this->expectException(ValidationException::class); @@ -216,7 +215,7 @@ class CreateCallTest extends TestCase $request = [ 'contact_id' => $contact->id, 'account_id' => $account->id, - 'called_at' => Carbon::now(), + 'called_at' => now(), 'content' => 'this is the content', ]; diff --git a/tests/Unit/Services/Contact/Call/UpdateCallTest.php b/tests/Unit/Services/Contact/Call/UpdateCallTest.php index 43b1eddae..1da8241ef 100644 --- a/tests/Unit/Services/Contact/Call/UpdateCallTest.php +++ b/tests/Unit/Services/Contact/Call/UpdateCallTest.php @@ -2,7 +2,6 @@ namespace Tests\Unit\Services\Contact\Conversation; -use Carbon\Carbon; use Tests\TestCase; use App\Models\Contact\Call; use App\Models\Account\Account; @@ -29,7 +28,7 @@ class UpdateCallTest extends TestCase $request = [ 'account_id' => $call->account->id, 'call_id' => $call->id, - 'called_at' => Carbon::now(), + 'called_at' => now(), 'content' => 'this is the content', ]; @@ -60,7 +59,7 @@ class UpdateCallTest extends TestCase $request = [ 'account_id' => $call->account->id, 'call_id' => $call->id, - 'called_at' => Carbon::now(), + 'called_at' => now(), 'content' => 'this is the content', 'contact_called' => 1, ]; @@ -87,7 +86,7 @@ class UpdateCallTest extends TestCase $request = [ 'account_id' => $call->account->id, 'call_id' => $call->id, - 'called_at' => Carbon::now(), + 'called_at' => now(), ]; $call = app(UpdateCall::class)->execute($request); @@ -126,7 +125,7 @@ class UpdateCallTest extends TestCase $request = [ 'account_id' => $call->account->id, 'call_id' => $call->id, - 'called_at' => Carbon::now(), + 'called_at' => now(), 'content' => 'this is the content', 'contact_called' => 1, 'emotions' => $emotionArray, @@ -184,7 +183,7 @@ class UpdateCallTest extends TestCase $request = [ 'account_id' => $call->account->id, 'call_id' => $call->id, - 'called_at' => Carbon::now(), + 'called_at' => now(), 'content' => 'this is the content', 'contact_called' => 1, 'emotions' => $emotionArray, @@ -231,12 +230,12 @@ class UpdateCallTest extends TestCase 'account_id' => $contact->account->id, ]); - $date = Carbon::now(); + $date = now(); $request = [ 'account_id' => $call->account->id, 'call_id' => $call->id, - 'called_at' => Carbon::now(), + 'called_at' => now(), ]; app(UpdateCall::class)->execute($request); @@ -257,12 +256,12 @@ class UpdateCallTest extends TestCase 'account_id' => $contact->account->id, ]); - $date = Carbon::now(); + $date = now(); $request = [ 'account_id' => $call->account->id, 'call_id' => $call->id, - 'called_at' => Carbon::now(), + 'called_at' => now(), ]; app(UpdateCall::class)->execute($request); @@ -279,7 +278,7 @@ class UpdateCallTest extends TestCase $request = [ 'contact_id' => $contact->id, - 'called_at' => Carbon::now(), + 'called_at' => now(), ]; $this->expectException(ValidationException::class); @@ -294,7 +293,7 @@ class UpdateCallTest extends TestCase $request = [ 'account_id' => $account->id, 'call_id' => $call->id, - 'called_at' => Carbon::now(), + 'called_at' => now(), ]; $this->expectException(ModelNotFoundException::class); diff --git a/tests/Unit/Services/Contact/Conversation/AddMessageToConversationTest.php b/tests/Unit/Services/Contact/Conversation/AddMessageToConversationTest.php index 87c1151a8..4b396fc04 100644 --- a/tests/Unit/Services/Contact/Conversation/AddMessageToConversationTest.php +++ b/tests/Unit/Services/Contact/Conversation/AddMessageToConversationTest.php @@ -2,7 +2,6 @@ namespace Tests\Unit\Services\Contact\Conversation; -use Carbon\Carbon; use Tests\TestCase; use App\Models\Account\Account; use App\Models\Contact\Contact; @@ -21,7 +20,7 @@ class AddMessageToConversationTest extends TestCase { $request = [ 'contact_id' => 1, - 'happened_at' => Carbon::now(), + 'happened_at' => now(), ]; $this->expectException(ValidationException::class); @@ -38,7 +37,7 @@ class AddMessageToConversationTest extends TestCase 'contact_id' => $conversation->contact->id, 'conversation_id' => $conversation->id, 'written_by_me' => true, - 'written_at' => Carbon::now(), + 'written_at' => now(), 'content' => 'lorem ipsum', ]; @@ -68,7 +67,7 @@ class AddMessageToConversationTest extends TestCase 'contact_id' => $contact->id, 'account_id' => $account->id, 'written_by_me' => true, - 'written_at' => Carbon::now(), + 'written_at' => now(), 'content' => 'lorem ipsum', ]; @@ -92,7 +91,7 @@ class AddMessageToConversationTest extends TestCase 'contact_id' => $contact->id, 'account_id' => $account->id, 'written_by_me' => true, - 'written_at' => Carbon::now(), + 'written_at' => now(), 'content' => 'lorem ipsum', ]; diff --git a/tests/Unit/Services/Contact/Conversation/CreateConversationTest.php b/tests/Unit/Services/Contact/Conversation/CreateConversationTest.php index 8ea3ebd60..a5b8dac3b 100644 --- a/tests/Unit/Services/Contact/Conversation/CreateConversationTest.php +++ b/tests/Unit/Services/Contact/Conversation/CreateConversationTest.php @@ -2,7 +2,6 @@ namespace Tests\Unit\Services\Contact\Conversation; -use Carbon\Carbon; use Tests\TestCase; use App\Models\Account\Account; use App\Models\Contact\Contact; @@ -27,7 +26,7 @@ class CreateConversationTest extends TestCase $request = [ 'contact_id' => $contact->id, 'account_id' => $contact->account->id, - 'happened_at' => Carbon::now(), + 'happened_at' => now(), 'contact_field_type_id' => $contactFieldType->id, ]; @@ -52,7 +51,7 @@ class CreateConversationTest extends TestCase $request = [ 'contact_id' => $contact->id, - 'happened_at' => Carbon::now(), + 'happened_at' => now(), ]; $this->expectException(ValidationException::class); @@ -71,7 +70,7 @@ class CreateConversationTest extends TestCase $request = [ 'contact_id' => $contact->id, 'account_id' => $account->id, - 'happened_at' => Carbon::now(), + 'happened_at' => now(), 'contact_field_type_id' => $contactFieldType->id, ]; @@ -88,7 +87,7 @@ class CreateConversationTest extends TestCase $request = [ 'contact_id' => $contact->id, 'account_id' => $contact->account->id, - 'happened_at' => Carbon::now(), + 'happened_at' => now(), 'contact_field_type_id' => $contactFieldType->id, ]; diff --git a/tests/Unit/Services/Contact/Conversation/UpdateConversationTest.php b/tests/Unit/Services/Contact/Conversation/UpdateConversationTest.php index 5e12422d5..a394bf202 100644 --- a/tests/Unit/Services/Contact/Conversation/UpdateConversationTest.php +++ b/tests/Unit/Services/Contact/Conversation/UpdateConversationTest.php @@ -2,7 +2,6 @@ namespace Tests\Unit\Services\Contact\Conversation; -use Carbon\Carbon; use Tests\TestCase; use App\Models\Account\Account; use App\Models\Contact\Contact; @@ -53,7 +52,7 @@ class UpdateConversationTest extends TestCase $request = [ 'contact_id' => $contact->id, - 'happened_at' => Carbon::now(), + 'happened_at' => now(), ]; $this->expectException(ValidationException::class); diff --git a/tests/Unit/Services/Contact/Conversation/UpdateMessageTest.php b/tests/Unit/Services/Contact/Conversation/UpdateMessageTest.php index b811a1066..23d219720 100644 --- a/tests/Unit/Services/Contact/Conversation/UpdateMessageTest.php +++ b/tests/Unit/Services/Contact/Conversation/UpdateMessageTest.php @@ -2,7 +2,6 @@ namespace Tests\Unit\Services\Contact\Conversation; -use Carbon\Carbon; use Tests\TestCase; use App\Models\Account\Account; use App\Models\Contact\Message; @@ -34,7 +33,7 @@ class UpdateMessageTest extends TestCase 'contact_id' => $conversation->contact->id, 'conversation_id' => $conversation->id, 'message_id' => $message->id, - 'written_at' => Carbon::now(), + 'written_at' => now(), 'written_by_me' => true, 'content' => 'lorem', ]; @@ -62,7 +61,7 @@ class UpdateMessageTest extends TestCase 'account_id' => 1, 'conversation_id' => 2, 'message_id' => 3, - 'written_at' => Carbon::now(), + 'written_at' => now(), 'written_by_me' => true, 'content' => 'lorem', ]; @@ -82,7 +81,7 @@ class UpdateMessageTest extends TestCase 'contact_id' => 123, 'conversation_id' => 123, 'message_id' => $message->id, - 'written_at' => Carbon::now(), + 'written_at' => now(), 'written_by_me' => true, 'content' => 'lorem', ]; diff --git a/tests/Unit/Services/Contact/LifeEvent/CreateLifeEventTest.php b/tests/Unit/Services/Contact/LifeEvent/CreateLifeEventTest.php index bcae84fb8..06676263f 100644 --- a/tests/Unit/Services/Contact/LifeEvent/CreateLifeEventTest.php +++ b/tests/Unit/Services/Contact/LifeEvent/CreateLifeEventTest.php @@ -2,7 +2,6 @@ namespace Tests\Unit\Services\Contact\LifeEvent; -use Carbon\Carbon; use Tests\TestCase; use App\Models\Account\Account; use App\Models\Contact\Contact; @@ -28,7 +27,7 @@ class CreateLifeEventTest extends TestCase 'contact_id' => $contact->id, 'account_id' => $contact->account->id, 'life_event_type_id' => $lifeEventType->id, - 'happened_at' => Carbon::now(), + 'happened_at' => now(), 'name' => 'This is a name', 'note' => 'This is a note', 'has_reminder' => false, @@ -65,7 +64,7 @@ class CreateLifeEventTest extends TestCase 'contact_id' => $contact->id, 'account_id' => $contact->account->id, 'life_event_type_id' => $lifeEventType->id, - 'happened_at' => Carbon::now(), + 'happened_at' => now(), 'name' => 'This is a name', 'note' => 'This is a note', 'has_reminder' => true, @@ -90,7 +89,7 @@ class CreateLifeEventTest extends TestCase $request = [ 'contact_id' => $contact->id, - 'happened_at' => Carbon::now(), + 'happened_at' => now(), ]; $this->expectException(ValidationException::class); @@ -112,7 +111,7 @@ class CreateLifeEventTest extends TestCase 'has_reminder' => false, 'happened_at_day_unknown' => false, 'happened_at_month_unknown' => false, - 'happened_at' => Carbon::now(), + 'happened_at' => now(), ]; $this->expectException(ModelNotFoundException::class); @@ -134,7 +133,7 @@ class CreateLifeEventTest extends TestCase 'has_reminder' => false, 'happened_at_day_unknown' => false, 'happened_at_month_unknown' => false, - 'happened_at' => Carbon::now(), + 'happened_at' => now(), ]; $this->expectException(ModelNotFoundException::class); diff --git a/tests/Unit/Services/Contact/LifeEvent/UpdateLifeEventTest.php b/tests/Unit/Services/Contact/LifeEvent/UpdateLifeEventTest.php index 791639aaf..1523c766e 100644 --- a/tests/Unit/Services/Contact/LifeEvent/UpdateLifeEventTest.php +++ b/tests/Unit/Services/Contact/LifeEvent/UpdateLifeEventTest.php @@ -2,7 +2,6 @@ namespace Tests\Unit\Services\Contact\LifeEvent; -use Carbon\Carbon; use Tests\TestCase; use App\Models\Account\Account; use App\Models\Contact\Contact; @@ -59,7 +58,7 @@ class UpdateLifeEventTest extends TestCase $request = [ 'contact_id' => $contact->id, - 'happened_at' => Carbon::now(), + 'happened_at' => now(), ]; $this->expectException(ValidationException::class); diff --git a/tests/Unit/Services/Contact/Reminder/CreateReminderTest.php b/tests/Unit/Services/Contact/Reminder/CreateReminderTest.php index 8a6de2e76..c00eff949 100644 --- a/tests/Unit/Services/Contact/Reminder/CreateReminderTest.php +++ b/tests/Unit/Services/Contact/Reminder/CreateReminderTest.php @@ -154,7 +154,7 @@ class CreateReminderTest extends TestCase $request = [ 'contact_id' => $contact->id, - 'initial_date' => Carbon::now(), + 'initial_date' => now(), ]; $this->expectException(ValidationException::class); diff --git a/tests/Unit/Services/Contact/Reminder/UpdateReminderTest.php b/tests/Unit/Services/Contact/Reminder/UpdateReminderTest.php index 9580c6b49..e0ae3a791 100644 --- a/tests/Unit/Services/Contact/Reminder/UpdateReminderTest.php +++ b/tests/Unit/Services/Contact/Reminder/UpdateReminderTest.php @@ -66,7 +66,7 @@ class UpdateReminderTest extends TestCase $request = [ 'contact_id' => $contact->id, - 'initial_date' => Carbon::now(), + 'initial_date' => now(), ]; $this->expectException(ValidationException::class);