diff --git a/app/Http/Resources/Contact/Contact.php b/app/Http/Resources/Contact/Contact.php index 6e366c4d2..c803e9f47 100644 --- a/app/Http/Resources/Contact/Contact.php +++ b/app/Http/Resources/Contact/Contact.php @@ -32,7 +32,7 @@ class Contact extends Resource 'is_active' => (bool) $this->is_active, 'is_dead' => (bool) $this->is_dead, 'is_me' => $this->isMe(), - 'last_called' => $this->when(! $this->is_partial, $this->getLastCalled()), + 'last_called' => $this->when(! $this->is_partial, $this->last_talked_to), 'last_activity_together' => $this->when(! $this->is_partial, $this->getLastActivityDate()), 'stay_in_touch_frequency' => $this->when(! $this->is_partial, $this->stay_in_touch_frequency), 'stay_in_touch_trigger_date' => $this->when(! $this->is_partial, DateHelper::getTimestamp($this->stay_in_touch_trigger_date)), diff --git a/app/Http/Resources/Contact/ContactWithContactFields.php b/app/Http/Resources/Contact/ContactWithContactFields.php index c04c4dc05..9ec65e206 100644 --- a/app/Http/Resources/Contact/ContactWithContactFields.php +++ b/app/Http/Resources/Contact/ContactWithContactFields.php @@ -29,7 +29,7 @@ class ContactWithContactFields extends Contact 'is_active' => (bool) $this->is_active, 'is_dead' => (bool) $this->is_dead, 'is_me' => $this->isMe(), - 'last_called' => $this->when(! $this->is_partial, $this->getLastCalled()), + 'last_called' => $this->when(! $this->is_partial, $this->last_talked_to), 'last_activity_together' => $this->when(! $this->is_partial, $this->getLastActivityDate()), 'stay_in_touch_frequency' => $this->when(! $this->is_partial, $this->stay_in_touch_frequency), 'stay_in_touch_trigger_date' => $this->when(! $this->is_partial, DateHelper::getTimestamp($this->stay_in_touch_trigger_date)), diff --git a/app/Models/Contact/Contact.php b/app/Models/Contact/Contact.php index 6f1660aa1..109547cad 100644 --- a/app/Models/Contact/Contact.php +++ b/app/Models/Contact/Contact.php @@ -764,20 +764,6 @@ class Contact extends Model return $lastActivity->happened_at; } - /** - * Get the last talked to date. - * - * @return string - */ - public function getLastCalled() - { - if (is_null($this->last_talked_to)) { - return; - } - - return $this->last_talked_to; - } - /** * Get all the contacts related to the current contact by a specific * relationship type group. @@ -1103,6 +1089,7 @@ class Contact extends Model /** * How much is the debt. + * * @return int */ public function totalOutstandingDebtAmount() diff --git a/resources/views/people/_header.blade.php b/resources/views/people/_header.blade.php index d7401a94f..a07022cc9 100644 --- a/resources/views/people/_header.blade.php +++ b/resources/views/people/_header.blade.php @@ -91,10 +91,10 @@ @if (! $contact->isMe())
content post
', ]); - $this->assertGreaterThan(0, $entry_id); + $this->assertGreaterThan(0, $entryId); $this->assertDatabaseHas('entries', [ - 'account_id' => $user->account->id, - 'id' => $entry_id, + 'account_id' => $user->account_id, + 'id' => $entryId, 'title' => 'my title', 'post' => 'content post', ]); } - public function test_journal_create_journal_error() + /** @test */ + public function it_cant_create_a_journal_entry_with_missing_parameters() { $user = $this->signin(); @@ -125,11 +130,12 @@ class ApiJournalTest extends ApiTestCase ]); } - public function test_journal_update_journal() + /** @test */ + public function it_updates_a_journal_entry() { $user = $this->signin(); $entry = factory(Entry::class)->create([ - 'account_id' => $user->account->id, + 'account_id' => $user->account_id, 'title' => 'xxx', ]); @@ -142,29 +148,30 @@ class ApiJournalTest extends ApiTestCase $response->assertJsonStructure([ 'data' => $this->jsonJournal, ]); - $entry_id = $response->json('data.id'); - $this->assertEquals($entry->id, $entry_id); + $entryId = $response->json('data.id'); + $this->assertEquals($entry->id, $entryId); $response->assertJsonFragment([ 'object' => 'entry', - 'id' => $entry_id, + 'id' => $entryId, 'title' => 'my title', 'post' => 'content post
', ]); - $this->assertGreaterThan(0, $entry_id); + $this->assertGreaterThan(0, $entryId); $this->assertDatabaseHas('entries', [ - 'account_id' => $user->account->id, - 'id' => $entry_id, + 'account_id' => $user->account_id, + 'id' => $entryId, 'title' => 'my title', 'post' => 'content post', ]); } - public function test_journal_update_error() + /** @test */ + public function it_cant_update_a_journal_entry_with_missing_parameters() { $user = $this->signin(); $entry = factory(Entry::class)->create([ - 'account_id' => $user->account->id, + 'account_id' => $user->account_id, ]); $response = $this->json('PUT', '/api/journal/'.$entry->id, []); @@ -175,30 +182,15 @@ class ApiJournalTest extends ApiTestCase ]); } - public function test_journal_update_error2() + /** @test */ + public function it_deletes_a_journal_entry() { $user = $this->signin(); $entry = factory(Entry::class)->create([ - 'account_id' => $user->account->id, - 'title' => 'xxx', - ]); - - $response = $this->json('PUT', '/api/journal/'.$entry->id, []); - - $this->expectDataError($response, [ - 'The title field is required.', - 'The post field is required.', - ]); - } - - public function test_journal_delete_journal() - { - $user = $this->signin(); - $entry = factory(Entry::class)->create([ - 'account_id' => $user->account->id, + 'account_id' => $user->account_id, ]); $this->assertDatabaseHas('entries', [ - 'account_id' => $user->account->id, + 'account_id' => $user->account_id, 'id' => $entry->id, ]); @@ -206,12 +198,13 @@ class ApiJournalTest extends ApiTestCase $response->assertStatus(200); $this->assertDatabaseMissing('entries', [ - 'account_id' => $user->account->id, + 'account_id' => $user->account_id, 'id' => $entry->id, ]); } - public function test_journal_delete_error() + /** @test */ + public function it_cant_delete_a_journal_entry_with_an_invalid_id() { $user = $this->signin(); diff --git a/tests/Api/ApiNotesTest.php b/tests/Api/ApiNotesTest.php index 70a548ea8..dcc3811ca 100644 --- a/tests/Api/ApiNotesTest.php +++ b/tests/Api/ApiNotesTest.php @@ -29,7 +29,8 @@ class ApiNotesTest extends ApiTestCase 'updated_at', ]; - public function test_notes_get_all() + /** @test */ + public function it_gets_all_the_notes() { $user = $this->signin(); $contact1 = factory(Contact::class)->create([ @@ -63,7 +64,8 @@ class ApiNotesTest extends ApiTestCase ]); } - public function test_notes_get_contact_all() + /** @test */ + public function it_gets_all_the_notes_of_a_given_contact() { $user = $this->signin(); $contact1 = factory(Contact::class)->create([ @@ -97,7 +99,8 @@ class ApiNotesTest extends ApiTestCase ]); } - public function test_notes_get_contact_all_error() + /** @test */ + public function it_cant_get_notes_from_a_contact_with_invalid_id() { $user = $this->signin(); @@ -106,7 +109,8 @@ class ApiNotesTest extends ApiTestCase $this->expectNotFound($response); } - public function test_notes_get_one() + /** @test */ + public function it_gets_one_note() { $user = $this->signin(); $contact1 = factory(Contact::class)->create([ @@ -137,7 +141,8 @@ class ApiNotesTest extends ApiTestCase ]); } - public function test_notes_get_one_error() + /** @test */ + public function it_gets_a_note_with_an_invalid_id() { $user = $this->signin(); @@ -146,7 +151,8 @@ class ApiNotesTest extends ApiTestCase $this->expectNotFound($response); } - public function test_notes_create() + /** @test */ + public function it_creates_a_note() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -181,7 +187,8 @@ class ApiNotesTest extends ApiTestCase ]); } - public function test_notes_create_favorite() + /** @test */ + public function it_creates_a_note_and_marks_as_favorite() { Carbon::setTestNow(Carbon::create(2018, 1, 1, 7, 0, 0)); @@ -220,7 +227,8 @@ class ApiNotesTest extends ApiTestCase ]); } - public function test_notes_create_error() + /** @test */ + public function it_cant_create_a_note_with_missing_parameters() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -236,7 +244,8 @@ class ApiNotesTest extends ApiTestCase ]); } - public function test_notes_create_error_bad_account() + /** @test */ + public function it_cant_create_a_note_with_an_invalid_account() { $user = $this->signin(); @@ -254,7 +263,8 @@ class ApiNotesTest extends ApiTestCase $this->expectNotFound($response); } - public function test_notes_update() + /** @test */ + public function it_updates_a_note() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -294,7 +304,8 @@ class ApiNotesTest extends ApiTestCase ]); } - public function test_notes_update_favorite() + /** @test */ + public function it_updates_a_note_and_marks_it_as_favorite() { Carbon::setTestNow(Carbon::create(2018, 1, 1, 7, 0, 0)); @@ -338,7 +349,8 @@ class ApiNotesTest extends ApiTestCase ]); } - public function test_notes_update_error() + /** @test */ + public function it_cant_update_a_note_with_missing_parameters() { $user = $this->signin(); $note = factory(Note::class)->create([ @@ -354,7 +366,8 @@ class ApiNotesTest extends ApiTestCase ]); } - public function test_notes_update_error_bad_account() + /** @test */ + public function it_cant_update_a_note_with_an_invalid_account() { $user = $this->signin(); @@ -376,7 +389,8 @@ class ApiNotesTest extends ApiTestCase $this->expectNotFound($response); } - public function test_notes_delete() + /** @test */ + public function it_deletes_a_note() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -402,7 +416,8 @@ class ApiNotesTest extends ApiTestCase ]); } - public function test_notes_delete_error() + /** @test */ + public function it_cant_delete_a_note_with_an_invalid_id() { $user = $this->signin(); diff --git a/tests/Api/ApiPetsTest.php b/tests/Api/ApiPetsTest.php index 270dd15c3..03be8935b 100644 --- a/tests/Api/ApiPetsTest.php +++ b/tests/Api/ApiPetsTest.php @@ -33,7 +33,8 @@ class ApiPetsTest extends ApiTestCase 'updated_at', ]; - public function test_pets_get_all() + /** @test */ + public function pets_get_all() { $user = $this->signin(); $contact1 = factory(Contact::class)->create([ @@ -67,7 +68,8 @@ class ApiPetsTest extends ApiTestCase ]); } - public function test_pets_get_contact_all() + /** @test */ + public function pets_get_contact_all() { $user = $this->signin(); $contact1 = factory(Contact::class)->create([ @@ -101,7 +103,8 @@ class ApiPetsTest extends ApiTestCase ]); } - public function test_pets_get_contact_all_error() + /** @test */ + public function pets_get_contact_all_error() { $user = $this->signin(); @@ -110,7 +113,8 @@ class ApiPetsTest extends ApiTestCase $this->expectNotFound($response); } - public function test_pets_get_one() + /** @test */ + public function pets_get_one() { $user = $this->signin(); $contact1 = factory(Contact::class)->create([ @@ -141,7 +145,8 @@ class ApiPetsTest extends ApiTestCase ]); } - public function test_pets_get_one_error() + /** @test */ + public function pets_get_one_error() { $user = $this->signin(); @@ -150,7 +155,8 @@ class ApiPetsTest extends ApiTestCase $this->expectNotFound($response); } - public function test_pets_create() + /** @test */ + public function pets_create() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -185,7 +191,8 @@ class ApiPetsTest extends ApiTestCase ]); } - public function test_pets_create_error() + /** @test */ + public function pets_create_error() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -201,7 +208,8 @@ class ApiPetsTest extends ApiTestCase ]); } - public function test_pets_create_error_bad_account() + /** @test */ + public function pets_create_error_bad_account() { $user = $this->signin(); @@ -219,7 +227,8 @@ class ApiPetsTest extends ApiTestCase $this->expectNotFound($response); } - public function test_pets_update() + /** @test */ + public function pets_update() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -259,7 +268,8 @@ class ApiPetsTest extends ApiTestCase ]); } - public function test_pets_update_error() + /** @test */ + public function pets_update_error() { $user = $this->signin(); $pet = factory(Pet::class)->create([ @@ -275,7 +285,8 @@ class ApiPetsTest extends ApiTestCase ]); } - public function test_pets_update_error_bad_account() + /** @test */ + public function pets_update_error_bad_account() { $user = $this->signin(); @@ -297,7 +308,8 @@ class ApiPetsTest extends ApiTestCase $this->expectNotFound($response); } - public function test_pets_delete() + /** @test */ + public function pets_delete() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -323,7 +335,8 @@ class ApiPetsTest extends ApiTestCase ]); } - public function test_pets_delete_error() + /** @test */ + public function pets_delete_error() { $user = $this->signin(); diff --git a/tests/Api/ApiRelationshipControllerTest.php b/tests/Api/ApiRelationshipControllerTest.php index 4e9cc8cc7..186aa0d86 100644 --- a/tests/Api/ApiRelationshipControllerTest.php +++ b/tests/Api/ApiRelationshipControllerTest.php @@ -12,7 +12,8 @@ class ApiRelationshipControllerTest extends ApiTestCase { use DatabaseTransactions; - public function test_it_rejects_the_api_call_if_parameters_are_not_right() + /** @test */ + public function it_rejects_the_api_call_if_parameters_are_not_right() { $user = $this->signin(); $contactA = factory(Contact::class)->create([ @@ -53,7 +54,8 @@ class ApiRelationshipControllerTest extends ApiTestCase $this->expectDataError($response, ['The of contact must be an integer.']); } - public function test_it_fails_if_relationship_type_id_is_invalid() + /** @test */ + public function it_fails_if_relationship_type_id_is_invalid() { $user = $this->signin(); $contactA = factory(Contact::class)->create([ @@ -73,7 +75,8 @@ class ApiRelationshipControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_fails_if_contact_is_id_is_invalid() + /** @test */ + public function it_fails_if_contact_is_id_is_invalid() { $user = $this->signin(); $contactA = factory(Contact::class)->create(); @@ -93,7 +96,8 @@ class ApiRelationshipControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_fails_if_of_contact_id_is_invalid() + /** @test */ + public function it_fails_if_of_contact_id_is_invalid() { $user = $this->signin(); $contactA = factory(Contact::class)->create([ @@ -113,7 +117,8 @@ class ApiRelationshipControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_creates_a_new_resource() + /** @test */ + public function it_creates_a_new_resource() { $user = $this->signin(); $contactA = factory(Contact::class)->create(['account_id' => $user->account->id]); @@ -153,7 +158,8 @@ class ApiRelationshipControllerTest extends ApiTestCase ]); } - public function test_it_displays_a_relationship() + /** @test */ + public function it_displays_a_relationship() { $user = $this->signin(); $contactA = factory(Contact::class)->create(['account_id' => $user->account->id]); @@ -186,7 +192,8 @@ class ApiRelationshipControllerTest extends ApiTestCase ]); } - public function test_it_deletes_a_relationship() + /** @test */ + public function it_deletes_a_relationship() { $user = $this->signin(); $contactA = factory(Contact::class)->create(['account_id' => $user->account->id]); @@ -234,7 +241,8 @@ class ApiRelationshipControllerTest extends ApiTestCase ]); } - public function test_it_rejects_the_delete_api_call_if_parameters_are_not_right() + /** @test */ + public function it_rejects_the_delete_api_call_if_parameters_are_not_right() { $user = $this->signin(); @@ -252,7 +260,8 @@ class ApiRelationshipControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_rejects_the_update_api_call_if_parameters_are_not_right() + /** @test */ + public function it_rejects_the_update_api_call_if_parameters_are_not_right() { $user = $this->signin(); $relationship = factory(Relationship::class)->create([ @@ -268,7 +277,8 @@ class ApiRelationshipControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_rejects_the_update_api_call_if_parameters_are_not_right2() + /** @test */ + public function it_rejects_the_update_api_call_if_parameters_are_not_right2() { $user = $this->signin(); $relationship = factory(Relationship::class)->create([ @@ -283,7 +293,8 @@ class ApiRelationshipControllerTest extends ApiTestCase $this->expectDataError($response, ['The relationship type id must be an integer.']); } - public function test_it_fails_the_update_if_relationship_type_id_is_invalid() + /** @test */ + public function it_fails_the_update_if_relationship_type_id_is_invalid() { $user = $this->signin(); $relationship = factory(Relationship::class)->create([ @@ -298,7 +309,8 @@ class ApiRelationshipControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_updates_a_relationship() + /** @test */ + public function it_updates_a_relationship() { $user = $this->signin(); $contactA = factory(Contact::class)->create(['account_id' => $user->account->id]); @@ -338,7 +350,8 @@ class ApiRelationshipControllerTest extends ApiTestCase ]); } - public function test_it_displays_all_relationships_of_a_contact() + /** @test */ + public function it_displays_all_relationships_of_a_contact() { $user = $this->signin(); $contactA = factory(Contact::class)->create(['account_id' => $user->account->id]); diff --git a/tests/Api/ApiRelationshipTypeControllerTest.php b/tests/Api/ApiRelationshipTypeControllerTest.php index 793b123e3..4447abb4a 100644 --- a/tests/Api/ApiRelationshipTypeControllerTest.php +++ b/tests/Api/ApiRelationshipTypeControllerTest.php @@ -11,11 +11,12 @@ class ApiRelationshipTypeControllerTest extends ApiTestCase { use DatabaseTransactions; - public function test_it_gets_the_right_number_of_relationship_types() + /** @test */ + public function it_gets_the_right_number_of_relationship_types() { $user = $this->signin(); - $relationshipType = factory(RelationshipType::class, 10)->create([ + factory(RelationshipType::class, 10)->create([ 'account_id' => $user->account_id, ]); @@ -30,7 +31,8 @@ class ApiRelationshipTypeControllerTest extends ApiTestCase ); } - public function test_it_gets_the_list_of_relationship_types() + /** @test */ + public function it_gets_the_list_of_relationship_types() { $user = $this->signin(); @@ -38,7 +40,7 @@ class ApiRelationshipTypeControllerTest extends ApiTestCase 'account_id' => $user->account_id, ]); - $relationshipType = factory(RelationshipType::class)->create([ + factory(RelationshipType::class)->create([ 'account_id' => $user->account_id, 'name' => 'father', 'name_reverse_relationship' => 'son', @@ -65,7 +67,8 @@ class ApiRelationshipTypeControllerTest extends ApiTestCase ]); } - public function test_it_gets_a_specific_relationship_type_group() + /** @test */ + public function it_gets_a_specific_relationship_type_group() { $user = $this->signin(); diff --git a/tests/Api/ApiRelationshipTypeGroupControllerTest.php b/tests/Api/ApiRelationshipTypeGroupControllerTest.php index 0c31da230..ffe3d1fdd 100644 --- a/tests/Api/ApiRelationshipTypeGroupControllerTest.php +++ b/tests/Api/ApiRelationshipTypeGroupControllerTest.php @@ -10,11 +10,12 @@ class ApiRelationshipTypeGroupControllerTest extends ApiTestCase { use DatabaseTransactions; - public function test_it_gets_the_right_number_of_relationship_type_groups() + /** @test */ + public function it_gets_the_right_number_of_relationship_type_groups() { $user = $this->signin(); - $relationshipTypeGroup = factory(RelationshipTypeGroup::class, 10)->create([ + factory(RelationshipTypeGroup::class, 10)->create([ 'account_id' => $user->account_id, ]); @@ -29,11 +30,12 @@ class ApiRelationshipTypeGroupControllerTest extends ApiTestCase ); } - public function test_it_gets_the_list_of_relationship_type_groups() + /** @test */ + public function it_gets_the_list_of_relationship_type_groups() { $user = $this->signin(); - $relationshipTypeGroup = factory(RelationshipTypeGroup::class)->create([ + factory(RelationshipTypeGroup::class)->create([ 'account_id' => $user->account_id, 'name' => 'love', 'delible' => 0, @@ -56,7 +58,8 @@ class ApiRelationshipTypeGroupControllerTest extends ApiTestCase ]); } - public function test_it_gets_a_specific_relationship_type_group() + /** @test */ + public function it_gets_a_specific_relationship_type_group() { $user = $this->signin(); diff --git a/tests/Api/ApiReminderControllerTest.php b/tests/Api/ApiReminderControllerTest.php index 08cda64ac..961e75f0b 100644 --- a/tests/Api/ApiReminderControllerTest.php +++ b/tests/Api/ApiReminderControllerTest.php @@ -32,7 +32,8 @@ class ApiReminderControllerTest extends ApiTestCase 'updated_at', ]; - public function test_reminders_get_all() + /** @test */ + public function it_gets_all_reminders() { $user = $this->signin(); $contact1 = factory(Contact::class)->create([ @@ -69,7 +70,8 @@ class ApiReminderControllerTest extends ApiTestCase ]); } - public function test_reminders_get_contact_all() + /** @test */ + public function it_gets_all_the_reminders_of_a_contact() { $user = $this->signin(); $contact1 = factory(Contact::class)->create([ @@ -103,7 +105,8 @@ class ApiReminderControllerTest extends ApiTestCase ]); } - public function test_reminders_get_contact_all_error() + /** @test */ + public function it_cant_get_a_reminder_of_a_contact_with_an_invalid_id() { $user = $this->signin(); @@ -112,7 +115,8 @@ class ApiReminderControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_reminders_get_one() + /** @test */ + public function it_gets_one_reminder() { $user = $this->signin(); $contact1 = factory(Contact::class)->create([ @@ -143,7 +147,8 @@ class ApiReminderControllerTest extends ApiTestCase ]); } - public function test_reminders_get_one_error() + /** @test */ + public function it_cant_get_a_reminder_with_an_invalid_id() { $user = $this->signin(); @@ -152,7 +157,8 @@ class ApiReminderControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_creates_a_reminder() + /** @test */ + public function it_creates_a_reminder() { Carbon::setTestNow(Carbon::create(2018, 1, 1, 7, 0, 0)); @@ -192,7 +198,8 @@ class ApiReminderControllerTest extends ApiTestCase ]); } - public function test_create_reminders_gets_an_error_if_fields_are_missing() + /** @test */ + public function create_reminders_gets_an_error_if_fields_are_missing() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -211,7 +218,8 @@ class ApiReminderControllerTest extends ApiTestCase ]); } - public function test_reminders_create_error_bad_account() + /** @test */ + public function reminders_create_error_bad_account() { Carbon::setTestNow(Carbon::create(2018, 1, 1, 7, 0, 0)); @@ -234,7 +242,8 @@ class ApiReminderControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_updates_a_reminder() + /** @test */ + public function it_updates_a_reminder() { Carbon::setTestNow(Carbon::create(2018, 1, 1, 7, 0, 0)); @@ -282,7 +291,8 @@ class ApiReminderControllerTest extends ApiTestCase ]); } - public function test_updating_reminder_generates_an_error() + /** @test */ + public function updating_reminder_generates_an_error() { $user = $this->signin(); $reminder = factory(Reminder::class)->create([ @@ -300,7 +310,8 @@ class ApiReminderControllerTest extends ApiTestCase ]); } - public function test_reminders_update_error_bad_account() + /** @test */ + public function reminders_update_error_bad_account() { Carbon::setTestNow(Carbon::create(2018, 1, 1, 7, 0, 0)); @@ -323,7 +334,8 @@ class ApiReminderControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_deletes_a_reminder() + /** @test */ + public function it_deletes_a_reminder() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -344,7 +356,8 @@ class ApiReminderControllerTest extends ApiTestCase ]); } - public function test_reminders_delete_error() + /** @test */ + public function reminders_delete_error() { $user = $this->signin(); diff --git a/tests/Api/ApiStatisticsControllerTest.php b/tests/Api/ApiStatisticsControllerTest.php index c7f8cea6d..fa87214b0 100644 --- a/tests/Api/ApiStatisticsControllerTest.php +++ b/tests/Api/ApiStatisticsControllerTest.php @@ -18,7 +18,8 @@ class ApiStatisticsControllerTest extends ApiTestCase 'number_of_new_users_last_week', ]; - public function test_it_gets_the_right_structure_of_the_public_statistics() + /** @test */ + public function it_gets_the_right_structure_of_the_public_statistics() { config(['monica.allow_statistics_through_public_api_access' => true]); @@ -33,7 +34,8 @@ class ApiStatisticsControllerTest extends ApiTestCase ]); } - public function test_it_returns_an_error_if_public_statistics_are_not_available() + /** @test */ + public function it_returns_an_error_if_public_statistics_are_not_available() { config(['monica.allow_statistics_through_public_api_access' => false]); diff --git a/tests/Api/ApiTagControllerTest.php b/tests/Api/ApiTagControllerTest.php index 2d9820ad9..5891bd7ee 100644 --- a/tests/Api/ApiTagControllerTest.php +++ b/tests/Api/ApiTagControllerTest.php @@ -23,7 +23,8 @@ class ApiTagControllerTest extends ApiTestCase 'updated_at', ]; - public function test_it_get_all_tags() + /** @test */ + public function it_get_all_tags() { $user = $this->signin(); $tag1 = factory(Tag::class)->create([ @@ -53,7 +54,8 @@ class ApiTagControllerTest extends ApiTestCase ]); } - public function test_it_gets_a_specific_tag() + /** @test */ + public function it_gets_a_specific_tag() { $user = $this->signin(); $tag = factory(Tag::class)->create([ @@ -74,7 +76,8 @@ class ApiTagControllerTest extends ApiTestCase ]); } - public function test_it_triggers_error_if_tag_unknown() + /** @test */ + public function it_triggers_error_if_tag_unknown() { $user = $this->signin(); @@ -83,7 +86,8 @@ class ApiTagControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_creates_a_tag() + /** @test */ + public function it_creates_a_tag() { $user = $this->signin(); @@ -110,7 +114,8 @@ class ApiTagControllerTest extends ApiTestCase ]); } - public function test_it_updates_a_tag() + /** @test */ + public function it_updates_a_tag() { $user = $this->signin(); $tag = factory(Tag::class)->create([ @@ -143,7 +148,8 @@ class ApiTagControllerTest extends ApiTestCase ]); } - public function test_it_deletes_a_tag() + /** @test */ + public function it_deletes_a_tag() { $user = $this->signin(); $tag = factory(Tag::class)->create([ @@ -164,7 +170,8 @@ class ApiTagControllerTest extends ApiTestCase ]); } - public function test_it_deletes_a_tag_associated() + /** @test */ + public function it_deletes_a_tag_associated() { $user = $this->signin(); $tag = factory(Tag::class)->create([ diff --git a/tests/Api/ApiTaskControllerTest.php b/tests/Api/ApiTaskControllerTest.php index b2b02f66e..c1786e968 100644 --- a/tests/Api/ApiTaskControllerTest.php +++ b/tests/Api/ApiTaskControllerTest.php @@ -29,7 +29,8 @@ class ApiTaskControllerTest extends ApiTestCase 'updated_at', ]; - public function test_tasks_get_all() + /** @test */ + public function it_gets_all_the_tasks() { $user = $this->signin(); $contact1 = factory(Contact::class)->create([ @@ -63,7 +64,8 @@ class ApiTaskControllerTest extends ApiTestCase ]); } - public function test_tasks_get_contact_all() + /** @test */ + public function it_gets_all_the_tasks_of_a_contact() { $user = $this->signin(); $contact1 = factory(Contact::class)->create([ @@ -97,7 +99,8 @@ class ApiTaskControllerTest extends ApiTestCase ]); } - public function test_tasks_get_contact_all_error() + /** @test */ + public function it_cant_get_the_tasks_of_a_contact_with_an_invalid_id() { $user = $this->signin(); @@ -106,7 +109,8 @@ class ApiTaskControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_tasks_get_one() + /** @test */ + public function it_gets_a_specific_task() { $user = $this->signin(); $contact1 = factory(Contact::class)->create([ @@ -137,7 +141,8 @@ class ApiTaskControllerTest extends ApiTestCase ]); } - public function test_tasks_get_one_error() + /** @test */ + public function it_cant_get_a_task_with_an_invalid_id() { $user = $this->signin(); @@ -146,7 +151,8 @@ class ApiTaskControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_create_a_task_associated_to_a_contact() + /** @test */ + public function it_create_a_task_associated_to_a_contact() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -180,7 +186,8 @@ class ApiTaskControllerTest extends ApiTestCase ]); } - public function test_it_create_a_task_not_associated_to_a_contact() + /** @test */ + public function it_create_a_task_not_associated_to_a_contact() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -214,7 +221,8 @@ class ApiTaskControllerTest extends ApiTestCase ]); } - public function test_creating_a_task_triggers_invalid_parameter_error() + /** @test */ + public function creating_a_task_triggers_invalid_parameter_error() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -230,7 +238,8 @@ class ApiTaskControllerTest extends ApiTestCase ]); } - public function test_creating_a_task_with_a_wrong_account_id_triggers_an_error() + /** @test */ + public function creating_a_task_with_a_wrong_account_id_triggers_an_error() { $user = $this->signin(); @@ -248,7 +257,8 @@ class ApiTaskControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_updates_a_task() + /** @test */ + public function it_updates_a_task() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -286,7 +296,8 @@ class ApiTaskControllerTest extends ApiTestCase ]); } - public function test_updating_a_task_with_missing_parameters_triggers_an_error() + /** @test */ + public function updating_a_task_with_missing_parameters_triggers_an_error() { $user = $this->signin(); $task = factory(Task::class)->create([ @@ -303,7 +314,8 @@ class ApiTaskControllerTest extends ApiTestCase ]); } - public function test_updating_a_task_with_wrong_account_triggers_an_error() + /** @test */ + public function updating_a_task_with_wrong_account_triggers_an_error() { $user = $this->signin(); @@ -322,7 +334,8 @@ class ApiTaskControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_deletes_a_task() + /** @test */ + public function it_deletes_a_task() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -344,7 +357,8 @@ class ApiTaskControllerTest extends ApiTestCase ]); } - public function test_it_cant_delete_a_task_if_wrong_task_id() + /** @test */ + public function it_cant_delete_a_task_if_wrong_task_id() { $user = $this->signin(); diff --git a/tests/Api/Authentication/ApiAuthenticateTest.php b/tests/Api/Authentication/ApiAuthenticateTest.php index f7cb90fc9..ffe69666e 100644 --- a/tests/Api/Authentication/ApiAuthenticateTest.php +++ b/tests/Api/Authentication/ApiAuthenticateTest.php @@ -6,7 +6,8 @@ use Tests\ApiTestCase; class ApiAuthenticateTest extends ApiTestCase { - public function test_guest_is_rejected() + /** @test */ + public function guest_is_rejected() { $response = $this->json('GET', '/api/contacts'); diff --git a/tests/Api/Contact/ApiAdressesControllerTest.php b/tests/Api/Contact/ApiAdressesControllerTest.php index f522d3c35..0268dc282 100644 --- a/tests/Api/Contact/ApiAdressesControllerTest.php +++ b/tests/Api/Contact/ApiAdressesControllerTest.php @@ -33,7 +33,8 @@ class ApiAdressesControllerTest extends ApiTestCase 'updated_at', ]; - public function test_it_gets_a_list_of_addresses() + /** @test */ + public function it_gets_a_list_of_addresses() { $user = $this->signin(); $contact = factory(Contact::class)->create(['account_id' => $user->account->id]); @@ -61,7 +62,8 @@ class ApiAdressesControllerTest extends ApiTestCase ]); } - public function test_it_applies_the_limit_parameter_in_search() + /** @test */ + public function it_applies_the_limit_parameter_in_search() { $user = $this->signin(); @@ -94,7 +96,8 @@ class ApiAdressesControllerTest extends ApiTestCase ]); } - public function test_it_gets_addresses_for_a_specific_contact() + /** @test */ + public function it_gets_addresses_for_a_specific_contact() { $user = $this->signin(); $contact = factory(Contact::class)->create(['account_id' => $user->account->id]); @@ -114,7 +117,8 @@ class ApiAdressesControllerTest extends ApiTestCase ]); } - public function test_calling_addresses_gets_an_error_if_contact_doesnt_exist() + /** @test */ + public function calling_addresses_gets_an_error_if_contact_doesnt_exist() { $user = $this->signin(); @@ -123,7 +127,8 @@ class ApiAdressesControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_gets_a_specific_address() + /** @test */ + public function it_gets_a_specific_address() { $user = $this->signin(); $contact = factory(Contact::class)->create(['account_id' => $user->account->id]); @@ -148,7 +153,8 @@ class ApiAdressesControllerTest extends ApiTestCase ]); } - public function test_it_creates_an_address() + /** @test */ + public function it_creates_an_address() { $user = $this->signin(); $contact = factory(Contact::class)->create(['account_id' => $user->account->id]); @@ -186,7 +192,8 @@ class ApiAdressesControllerTest extends ApiTestCase $this->assertGreaterThan(0, $addressId); } - public function test_create_addresses_gets_an_error_if_fields_are_missing() + /** @test */ + public function create_addresses_gets_an_error_if_fields_are_missing() { $user = $this->signin(); $contact = factory(Contact::class)->create(['account_id' => $user->account->id]); @@ -199,7 +206,8 @@ class ApiAdressesControllerTest extends ApiTestCase ]); } - public function test_create_addresses_gets_an_error_if_contact_is_not_linked_to_user() + /** @test */ + public function create_addresses_gets_an_error_if_contact_is_not_linked_to_user() { $user = $this->signin(); @@ -219,7 +227,8 @@ class ApiAdressesControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_updates_an_address() + /** @test */ + public function it_updates_an_address() { $user = $this->signin(); $contact = factory(Contact::class)->create(['account_id' => $user->account->id]); @@ -259,7 +268,8 @@ class ApiAdressesControllerTest extends ApiTestCase ]); } - public function test_updating_address_generates_an_error() + /** @test */ + public function updating_address_generates_an_error() { $user = $this->signin(); $address = factory(Address::class)->create([ @@ -273,7 +283,8 @@ class ApiAdressesControllerTest extends ApiTestCase ]); } - public function test_it_cant_update_an_address_if_account_is_not_linked_to_address() + /** @test */ + public function it_cant_update_an_address_if_account_is_not_linked_to_address() { $user = $this->signin(); @@ -289,7 +300,8 @@ class ApiAdressesControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_deletes_an_address() + /** @test */ + public function it_deletes_an_address() { $user = $this->signin(); $contact = factory(Contact::class)->create(['account_id' => $user->account->id]); @@ -314,7 +326,8 @@ class ApiAdressesControllerTest extends ApiTestCase ]); } - public function test_address_delete_error() + /** @test */ + public function address_delete_error() { $user = $this->signin(); diff --git a/tests/Api/Contact/ApiAvatarControllerTest.php b/tests/Api/Contact/ApiAvatarControllerTest.php index 0a90b1e73..6ee510266 100644 --- a/tests/Api/Contact/ApiAvatarControllerTest.php +++ b/tests/Api/Contact/ApiAvatarControllerTest.php @@ -29,7 +29,8 @@ class ApiAvatarControllerTest extends ApiTestCase 'updated_at', ]; - public function test_it_update_avatar_as_photo() + /** @test */ + public function it_updates_the_photo_avatar() { Storage::fake(); @@ -73,7 +74,8 @@ class ApiAvatarControllerTest extends ApiTestCase ]); } - public function test_it_update_avatar_as_gravatar() + /** @test */ + public function it_updates_the_gravatar_avatar() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -97,7 +99,8 @@ class ApiAvatarControllerTest extends ApiTestCase ]); } - public function test_it_update_avatar_as_adorable() + /** @test */ + public function it_updates_the_adorable_avatar() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -120,7 +123,8 @@ class ApiAvatarControllerTest extends ApiTestCase ]); } - public function test_it_update_avatar_as_default() + /** @test */ + public function it_updates_the_default_avatar() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -143,7 +147,8 @@ class ApiAvatarControllerTest extends ApiTestCase ]); } - public function test_avatar_update_gets_an_error_if_fields_are_missing() + /** @test */ + public function avatar_update_gets_an_error_if_fields_are_missing() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -159,7 +164,8 @@ class ApiAvatarControllerTest extends ApiTestCase ]); } - public function test_avatar_update_gets_an_error_if_contact_is_not_linked_to_user() + /** @test */ + public function avatar_update_gets_an_error_if_contact_is_not_linked_to_user() { $user = $this->signin(); diff --git a/tests/Api/Contact/ApiCallControllerTest.php b/tests/Api/Contact/ApiCallControllerTest.php index 3259aa454..aa953d1ff 100644 --- a/tests/Api/Contact/ApiCallControllerTest.php +++ b/tests/Api/Contact/ApiCallControllerTest.php @@ -27,7 +27,8 @@ class ApiCallControllerTest extends ApiTestCase 'updated_at', ]; - public function test_it_gets_a_list_of_calls() + /** @test */ + public function it_gets_a_list_of_calls() { $user = $this->signin(); $contact1 = factory(Contact::class)->create([ @@ -61,7 +62,8 @@ class ApiCallControllerTest extends ApiTestCase ]); } - public function test_it_gets_the_calls_of_a_contact() + /** @test */ + public function it_gets_the_calls_of_a_contact() { $user = $this->signin(); $contact1 = factory(Contact::class)->create([ @@ -95,7 +97,8 @@ class ApiCallControllerTest extends ApiTestCase ]); } - public function test_calling_calls_get_error() + /** @test */ + public function calling_calls_get_error() { $user = $this->signin(); @@ -104,7 +107,8 @@ class ApiCallControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_gets_one_call() + /** @test */ + public function it_gets_one_call() { $user = $this->signin(); $contact1 = factory(Contact::class)->create([ @@ -135,7 +139,8 @@ class ApiCallControllerTest extends ApiTestCase ]); } - public function test_calling_one_call_gets_an_error() + /** @test */ + public function calling_one_call_gets_an_error() { $user = $this->signin(); @@ -144,7 +149,8 @@ class ApiCallControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_creates_a_call() + /** @test */ + public function it_creates_a_call() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -177,7 +183,8 @@ class ApiCallControllerTest extends ApiTestCase ]); } - public function test_create_calls_gets_an_error_if_fields_are_missing() + /** @test */ + public function create_calls_gets_an_error_if_fields_are_missing() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -193,7 +200,8 @@ class ApiCallControllerTest extends ApiTestCase ]); } - public function test_it_cant_create_a_call_if_account_is_wrong() + /** @test */ + public function it_cant_create_a_call_if_account_is_wrong() { $user = $this->signin(); @@ -211,7 +219,8 @@ class ApiCallControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_updates_a_call() + /** @test */ + public function it_updates_a_call() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -249,7 +258,8 @@ class ApiCallControllerTest extends ApiTestCase ]); } - public function test_updating_call_generates_an_error() + /** @test */ + public function updating_call_generates_an_error() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -269,7 +279,8 @@ class ApiCallControllerTest extends ApiTestCase ]); } - public function test_it_cant_update_a_call_if_account_is_not_linked_to_call() + /** @test */ + public function it_cant_update_a_call_if_account_is_not_linked_to_call() { $user = $this->signin(); @@ -287,7 +298,8 @@ class ApiCallControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_deletes_a_call() + /** @test */ + public function it_deletes_a_call() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -313,7 +325,8 @@ class ApiCallControllerTest extends ApiTestCase ]); } - public function test_it_cant_delete_a_call_if_call_doesnt_exist() + /** @test */ + public function it_cant_delete_a_call_if_call_doesnt_exist() { $user = $this->signin(); @@ -322,7 +335,8 @@ class ApiCallControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_cant_delete_a_call_if_account_is_not_linked() + /** @test */ + public function it_cant_delete_a_call_if_account_is_not_linked() { $user = $this->signin(); $contact = factory(Contact::class)->create([]); diff --git a/tests/Api/Contact/ApiContactControllerTest.php b/tests/Api/Contact/ApiContactControllerTest.php index eb867f855..c5c53dd9d 100644 --- a/tests/Api/Contact/ApiContactControllerTest.php +++ b/tests/Api/Contact/ApiContactControllerTest.php @@ -221,7 +221,8 @@ class ApiContactControllerTest extends ApiTestCase 'updated_at', ]; - public function test_it_gets_a_list_of_contacts() + /** @test */ + public function it_gets_a_list_of_contacts() { $user = $this->signin(); @@ -242,7 +243,8 @@ class ApiContactControllerTest extends ApiTestCase ); } - public function test_it_gets_a_list_of_contacts_without_gender() + /** @test */ + public function it_gets_a_list_of_contacts_without_gender() { $user = $this->signin(); @@ -263,7 +265,8 @@ class ApiContactControllerTest extends ApiTestCase ); } - public function test_it_contains_pagination_when_fetching_contacts() + /** @test */ + public function it_contains_pagination_when_fetching_contacts() { $user = $this->signin(); @@ -284,7 +287,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_it_applies_the_limit_parameter_in_search() + /** @test */ + public function it_applies_the_limit_parameter_in_search() { $user = $this->signin(); @@ -319,7 +323,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_it_is_possible_to_search_contacts_with_query() + /** @test */ + public function it_is_possible_to_search_contacts_with_query() { $user = $this->signin(); @@ -348,7 +353,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_it_is_possible_to_search_contacts_and_limit_query() + /** @test */ + public function it_is_possible_to_search_contacts_and_limit_query() { $user = $this->signin(); @@ -379,7 +385,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_it_is_possible_to_search_contacts_and_limit_query_and_paginate() + /** @test */ + public function it_is_possible_to_search_contacts_and_limit_query_and_paginate() { $user = $this->signin(); @@ -410,7 +417,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_it_gets_a_contact() + /** @test */ + public function it_gets_a_contact() { $user = $this->signin(); @@ -432,7 +440,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_getting_a_contact_matches_a_specific_json_structure() + /** @test */ + public function getting_a_contact_matches_a_specific_json_structure() { $user = $this->signin(); @@ -450,7 +459,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_getting_a_partial_contact_matches_a_specific_json_structure() + /** @test */ + public function getting_a_partial_contact_matches_a_specific_json_structure() { $user = $this->signin(); @@ -469,7 +479,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_getting_a_contact_with_the_parameter_with_matches_a_specific_json_structure() + /** @test */ + public function getting_a_contact_with_the_parameter_with_matches_a_specific_json_structure() { $user = $this->signin(); @@ -504,7 +515,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_it_gets_list_of_contacts_with_parameter_and_limit_and_page() + /** @test */ + public function it_gets_list_of_contacts_with_parameter_and_limit_and_page() { $user = $this->signin(); @@ -560,7 +572,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_contact_query_injection() + /** @test */ + public function it_prevents_a_contact_query_injection() { $firstuser = $this->signin(); $firstcontact = factory(Contact::class)->create([ @@ -575,7 +588,7 @@ class ApiContactControllerTest extends ApiTestCase $response = $this->json('GET', "/api/contacts?with=contactfields&page=1&limit=100&query=1')%20or%20('%'='"); $response->assertStatus(200); - // Assure that firstcontact from other account is not get (SQL injection) + // Ensure that firstcontact from other account is not get (SQL injection) $response->assertJsonMissing([ 'id' => $firstcontact->id, 'first_name' => 'Bad', @@ -585,7 +598,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_contact_get_withcontactfields() + /** @test */ + public function it_gets_a_contact_with_the_contact_fields() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -628,7 +642,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_contact_field_query_all_account() + /** @test */ + public function contact_field_query_all_account() { $firstuser = $this->signin(); $firstcontact = factory(Contact::class)->create([ @@ -670,7 +685,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_contact_query_internationalphone() + /** @test */ + public function contact_query_internationalphone() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -702,7 +718,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_it_creates_a_contact() + /** @test */ + public function it_creates_a_contact() { $user = $this->signin(); $gender = factory(Gender::class)->create([ @@ -747,7 +764,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_creating_contact_is_not_possible_if_parameters_are_missing() + /** @test */ + public function creating_contact_is_not_possible_if_parameters_are_missing() { $user = $this->signin(); @@ -763,7 +781,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_it_creates_a_birthdate() + /** @test */ + public function it_creates_a_birthdate() { $user = $this->signin(); $gender = factory(Gender::class)->create([ @@ -817,7 +836,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_contact_create_birthdate_year_unknown() + /** @test */ + public function contact_create_birthdate_year_unknown() { Carbon::setTestNow(Carbon::create(2018, 1, 1, 7, 0, 0)); $user = $this->signin(); @@ -872,7 +892,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_contact_create_birthdate_age_based() + /** @test */ + public function contact_create_birthdate_age_based() { Carbon::setTestNow(Carbon::create(2018, 1, 1, 7, 0, 0)); $user = $this->signin(); @@ -928,7 +949,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_contact_create_deceased_date() + /** @test */ + public function contact_create_deceased_date() { Carbon::setTestNow(Carbon::create(2018, 1, 1, 7, 0, 0)); $user = $this->signin(); @@ -982,7 +1004,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_contact_create_deceased_date_year_unknown() + /** @test */ + public function contact_create_deceased_date_year_unknown() { Carbon::setTestNow(Carbon::create(2018, 1, 1, 7, 0, 0)); $user = $this->signin(); @@ -1036,7 +1059,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_it_updates_a_contact() + /** @test */ + public function it_updates_a_contact() { Carbon::setTestNow(Carbon::create(2018, 1, 1, 7, 0, 0)); $user = $this->signin(); @@ -1093,7 +1117,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_contact_update_bad_account() + /** @test */ + public function contact_update_bad_account() { $user = $this->signin(); $gender = factory(Gender::class)->create([ @@ -1124,7 +1149,8 @@ class ApiContactControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_cant_update_the_contact_if_parameters_are_missing() + /** @test */ + public function it_cant_update_the_contact_if_parameters_are_missing() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -1142,7 +1168,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_contact_update_birthdate() + /** @test */ + public function contact_update_birthdate() { Carbon::setTestNow(Carbon::create(2018, 1, 1, 7, 0, 0)); $user = $this->signin(); @@ -1191,7 +1218,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_contact_update_birthdate_year_unknown() + /** @test */ + public function contact_update_birthdate_year_unknown() { Carbon::setTestNow(Carbon::create(2018, 1, 1, 7, 0, 0)); $user = $this->signin(); @@ -1240,7 +1268,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_contact_update_birthdate_age_based() + /** @test */ + public function contact_update_birthdate_age_based() { Carbon::setTestNow(Carbon::create(2018, 1, 1, 7, 0, 0)); $user = $this->signin(); @@ -1290,7 +1319,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_contact_update_deceased_date() + /** @test */ + public function contact_update_deceased_date() { Carbon::setTestNow(Carbon::create(2018, 1, 1, 7, 0, 0)); $user = $this->signin(); @@ -1338,7 +1368,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_it_deletes_a_contact() + /** @test */ + public function it_deletes_a_contact() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -1354,7 +1385,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_it_sets_me_contact() + /** @test */ + public function it_sets_me_contact() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -1371,7 +1403,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_it_gets_me_contact() + /** @test */ + public function it_gets_me_contact() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -1394,7 +1427,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_it_sets_career() + /** @test */ + public function it_sets_career() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -1442,7 +1476,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_it_get_an_error_when_set_career_with_wrong_params() + /** @test */ + public function it_get_an_error_when_set_career_with_wrong_params() { $user = $this->signin(); $contact = factory(Contact::class)->create(); @@ -1454,7 +1489,8 @@ class ApiContactControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_get_an_error_when_set_career_on_partial_contact() + /** @test */ + public function it_get_an_error_when_set_career_on_partial_contact() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -1469,7 +1505,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_it_sets_food_preferences() + /** @test */ + public function it_sets_food_preferences() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -1507,7 +1544,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_it_get_an_error_when_set_food_preferences_with_wrong_params() + /** @test */ + public function it_get_an_error_when_set_food_preferences_with_wrong_params() { $user = $this->signin(); $contact = factory(Contact::class)->create(); @@ -1516,7 +1554,8 @@ class ApiContactControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_get_an_error_when_set_food_preferences_on_partial_contact() + /** @test */ + public function it_get_an_error_when_set_food_preferences_on_partial_contact() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -1531,7 +1570,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_it_sets_first_met() + /** @test */ + public function it_sets_first_met() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -1565,7 +1605,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_it_sets_first_met_age() + /** @test */ + public function it_sets_first_met_age() { Carbon::setTestNow(Carbon::create(2019, 12, 1, 7, 0, 0)); $user = $this->signin(); @@ -1599,7 +1640,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_it_sets_first_met_reminder() + /** @test */ + public function it_sets_first_met_reminder() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -1631,7 +1673,8 @@ class ApiContactControllerTest extends ApiTestCase ]); } - public function test_it_get_an_error_when_set_first_met_with_wrong_params() + /** @test */ + public function it_get_an_error_when_set_first_met_with_wrong_params() { $user = $this->signin(); $contact = factory(Contact::class)->create(); @@ -1646,7 +1689,8 @@ class ApiContactControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_get_an_error_when_set_first_met_on_partial_contact() + /** @test */ + public function it_get_an_error_when_set_first_met_on_partial_contact() { $user = $this->signin(); $contact = factory(Contact::class)->create([ diff --git a/tests/Api/Contact/ApiContactTagControllerTest.php b/tests/Api/Contact/ApiContactTagControllerTest.php index 7280cd831..c7a5accfc 100644 --- a/tests/Api/Contact/ApiContactTagControllerTest.php +++ b/tests/Api/Contact/ApiContactTagControllerTest.php @@ -11,7 +11,8 @@ class ApiContactTagControllerTest extends ApiTestCase { use DatabaseTransactions; - public function test_tags_are_required_to_associate_tags_to_a_contact() + /** @test */ + public function tags_are_required_to_associate_tags_to_a_contact() { $user = $this->signin(); @@ -24,7 +25,8 @@ class ApiContactTagControllerTest extends ApiTestCase $this->expectDataError($response, ['The tags field is required.']); } - public function test_it_associates_tags_to_a_contact() + /** @test */ + public function it_associates_tags_to_a_contact() { $user = $this->signin(); @@ -65,7 +67,8 @@ class ApiContactTagControllerTest extends ApiTestCase ]); } - public function test_tags_ignore_empty_tags() + /** @test */ + public function tags_ignore_empty_tags() { $user = $this->signin(); @@ -110,7 +113,8 @@ class ApiContactTagControllerTest extends ApiTestCase ]); } - public function test_a_list_of_tags_are_required_to_remove_a_tag_from_a_contact() + /** @test */ + public function a_list_of_tags_are_required_to_remove_a_tag_from_a_contact() { $user = $this->signin(); @@ -123,7 +127,8 @@ class ApiContactTagControllerTest extends ApiTestCase $this->expectDataError($response, ['The tags field is required.']); } - public function test_it_removes_one_tag_from_a_contact() + /** @test */ + public function it_removes_one_tag_from_a_contact() { $user = $this->signin(); @@ -176,7 +181,8 @@ class ApiContactTagControllerTest extends ApiTestCase ]); } - public function test_it_removes_multiple_tags_from_a_contact() + /** @test */ + public function it_removes_multiple_tags_from_a_contact() { $user = $this->signin(); @@ -240,7 +246,8 @@ class ApiContactTagControllerTest extends ApiTestCase ]); } - public function test_it_removes_all_tags_from_a_contact() + /** @test */ + public function it_removes_all_tags_from_a_contact() { $user = $this->signin(); diff --git a/tests/Api/Contact/ApiConversationControllerTest.php b/tests/Api/Contact/ApiConversationControllerTest.php index a7359fb84..0d637e3fb 100644 --- a/tests/Api/Contact/ApiConversationControllerTest.php +++ b/tests/Api/Contact/ApiConversationControllerTest.php @@ -50,7 +50,8 @@ class ApiConversationControllerTest extends ApiTestCase return $conversation; } - public function test_it_gets_a_list_of_conversations() + /** @test */ + public function it_gets_a_list_of_conversations() { $user = $this->signin(); @@ -79,7 +80,8 @@ class ApiConversationControllerTest extends ApiTestCase ]); } - public function test_it_applies_the_limit_parameter_in_search() + /** @test */ + public function it_applies_the_limit_parameter_in_search() { $user = $this->signin(); @@ -106,7 +108,8 @@ class ApiConversationControllerTest extends ApiTestCase ]); } - public function test_it_gets_a_conversation() + /** @test */ + public function it_gets_a_conversation() { $user = $this->signin(); @@ -121,7 +124,8 @@ class ApiConversationControllerTest extends ApiTestCase ]); } - public function test_it_gets_a_conversation_for_a_specific_contact() + /** @test */ + public function it_gets_a_conversation_for_a_specific_contact() { $user = $this->signin(); @@ -138,7 +142,8 @@ class ApiConversationControllerTest extends ApiTestCase ]); } - public function test_it_creates_a_conversation() + /** @test */ + public function it_creates_a_conversation() { $user = $this->signin(); @@ -162,7 +167,8 @@ class ApiConversationControllerTest extends ApiTestCase ]); } - public function test_it_updates_a_conversation() + /** @test */ + public function it_updates_a_conversation() { $user = $this->signin(); @@ -183,7 +189,8 @@ class ApiConversationControllerTest extends ApiTestCase ]); } - public function test_it_destroys_a_conversation() + /** @test */ + public function it_destroys_a_conversation() { $user = $this->signin(); diff --git a/tests/Api/Contact/ApiDocumentControllerTest.php b/tests/Api/Contact/ApiDocumentControllerTest.php index 6300d85e9..0b74d28cc 100644 --- a/tests/Api/Contact/ApiDocumentControllerTest.php +++ b/tests/Api/Contact/ApiDocumentControllerTest.php @@ -48,7 +48,8 @@ class ApiDocumentControllerTest extends ApiTestCase return $document; } - public function test_it_gets_a_list_of_documents() + /** @test */ + public function it_gets_a_list_of_documents() { $user = $this->signin(); @@ -77,7 +78,8 @@ class ApiDocumentControllerTest extends ApiTestCase ]); } - public function test_it_applies_the_limit_parameter_in_search() + /** @test */ + public function it_applies_the_limit_parameter_in_search() { $user = $this->signin(); @@ -104,7 +106,8 @@ class ApiDocumentControllerTest extends ApiTestCase ]); } - public function test_it_gets_a_document() + /** @test */ + public function it_gets_a_document() { $user = $this->signin(); @@ -119,7 +122,8 @@ class ApiDocumentControllerTest extends ApiTestCase ]); } - public function test_document_show_gets_an_error_if_document_is_not_linked_to_account() + /** @test */ + public function document_show_gets_an_error_if_document_is_not_linked_to_account() { $user = $this->signin(); @@ -134,7 +138,8 @@ class ApiDocumentControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_gets_a_document_for_a_specific_contact() + /** @test */ + public function it_gets_a_document_for_a_specific_contact() { $user = $this->signin(); @@ -158,7 +163,8 @@ class ApiDocumentControllerTest extends ApiTestCase ]); } - public function test_it_store_a_document_for_a_specific_contact() + /** @test */ + public function it_store_a_document_for_a_specific_contact() { Storage::fake(); @@ -187,7 +193,8 @@ class ApiDocumentControllerTest extends ApiTestCase Storage::disk('public')->assertExists($response->json('data.new_filename')); } - public function test_document_store_gets_an_error_if_fields_are_missing() + /** @test */ + public function document_store_gets_an_error_if_fields_are_missing() { $user = $this->signin(); @@ -199,7 +206,8 @@ class ApiDocumentControllerTest extends ApiTestCase ]); } - public function test_document_store_gets_an_error_if_contact_is_not_linked_to_user() + /** @test */ + public function document_store_gets_an_error_if_contact_is_not_linked_to_user() { $user = $this->signin(); @@ -213,7 +221,8 @@ class ApiDocumentControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_destroy_a_document() + /** @test */ + public function it_destroy_a_document() { $user = $this->signin(); @@ -229,7 +238,8 @@ class ApiDocumentControllerTest extends ApiTestCase ]); } - public function test_document_destroy_gets_an_error_if_document_is_not_linked_to_user() + /** @test */ + public function document_destroy_gets_an_error_if_document_is_not_linked_to_user() { $user = $this->signin(); diff --git a/tests/Api/Contact/ApiLifeEventControllerTest.php b/tests/Api/Contact/ApiLifeEventControllerTest.php index 26496e148..e56433c83 100644 --- a/tests/Api/Contact/ApiLifeEventControllerTest.php +++ b/tests/Api/Contact/ApiLifeEventControllerTest.php @@ -54,7 +54,8 @@ class ApiLifeEventControllerTest extends ApiTestCase return $lifeEvent; } - public function test_it_gets_a_list_of_life_events() + /** @test */ + public function it_gets_a_list_of_life_events() { $user = $this->signin(); @@ -83,7 +84,8 @@ class ApiLifeEventControllerTest extends ApiTestCase ]); } - public function test_it_applies_the_limit_parameter_in_search() + /** @test */ + public function it_applies_the_limit_parameter_in_search() { $user = $this->signin(); @@ -110,7 +112,8 @@ class ApiLifeEventControllerTest extends ApiTestCase ]); } - public function test_it_gets_a_life_event() + /** @test */ + public function it_gets_a_life_event() { $user = $this->signin(); @@ -125,7 +128,8 @@ class ApiLifeEventControllerTest extends ApiTestCase ]); } - public function test_getting_a_life_event_doesnt_work_if_life_event_doesnt_exist() + /** @test */ + public function getting_a_life_event_doesnt_work_if_life_event_doesnt_exist() { $user = $this->signin(); @@ -134,7 +138,8 @@ class ApiLifeEventControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_creates_a_life_event() + /** @test */ + public function it_creates_a_life_event() { $user = $this->signin(); @@ -163,7 +168,8 @@ class ApiLifeEventControllerTest extends ApiTestCase ]); } - public function test_creating_a_life_event_doesnt_work_if_ids_are_not_found() + /** @test */ + public function creating_a_life_event_doesnt_work_if_ids_are_not_found() { $user = $this->signin(); @@ -202,7 +208,8 @@ class ApiLifeEventControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_creating_a_life_event_doesnt_work_if_parameters_are_not_right() + /** @test */ + public function creating_a_life_event_doesnt_work_if_parameters_are_not_right() { $user = $this->signin(); @@ -228,7 +235,8 @@ class ApiLifeEventControllerTest extends ApiTestCase ]); } - public function test_it_updates_a_life_event() + /** @test */ + public function it_updates_a_life_event() { $user = $this->signin(); @@ -251,7 +259,8 @@ class ApiLifeEventControllerTest extends ApiTestCase ]); } - public function test_updating_a_life_event_doesnt_work_if_ids_are_not_found() + /** @test */ + public function updating_a_life_event_doesnt_work_if_ids_are_not_found() { $user = $this->signin(); @@ -279,7 +288,8 @@ class ApiLifeEventControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_updating_a_life_event_doesnt_work_if_parameters_are_not_right() + /** @test */ + public function updating_a_life_event_doesnt_work_if_parameters_are_not_right() { $user = $this->signin(); @@ -299,7 +309,8 @@ class ApiLifeEventControllerTest extends ApiTestCase ]); } - public function test_it_destroys_a_life_event() + /** @test */ + public function it_destroys_a_life_event() { $user = $this->signin(); @@ -315,7 +326,8 @@ class ApiLifeEventControllerTest extends ApiTestCase ]); } - public function test_deleting_a_life_event_doesnt_work_if_ids_are_not_found() + /** @test */ + public function deleting_a_life_event_doesnt_work_if_ids_are_not_found() { $user = $this->signin(); diff --git a/tests/Api/Contact/ApiMessageControllerTest.php b/tests/Api/Contact/ApiMessageControllerTest.php index 5d804b8bb..1ed65fb5a 100644 --- a/tests/Api/Contact/ApiMessageControllerTest.php +++ b/tests/Api/Contact/ApiMessageControllerTest.php @@ -66,7 +66,8 @@ class ApiMessageControllerTest extends ApiTestCase return $message; } - public function test_it_adds_a_message_to_a_conversation() + /** @test */ + public function it_adds_a_message_to_a_conversation() { $user = $this->signin(); @@ -85,7 +86,8 @@ class ApiMessageControllerTest extends ApiTestCase ]); } - public function test_it_updates_a_message() + /** @test */ + public function it_updates_a_message() { $user = $this->signin(); @@ -105,7 +107,8 @@ class ApiMessageControllerTest extends ApiTestCase ]); } - public function test_it_destroys_a_message() + /** @test */ + public function it_destroys_a_message() { $user = $this->signin(); diff --git a/tests/Api/Contact/ApiOccupationControllerTest.php b/tests/Api/Contact/ApiOccupationControllerTest.php index 3e19589ec..21aba490d 100644 --- a/tests/Api/Contact/ApiOccupationControllerTest.php +++ b/tests/Api/Contact/ApiOccupationControllerTest.php @@ -86,11 +86,11 @@ class ApiOccupationControllerTest extends ApiTestCase $response = $this->json('get', '/api/occupations/'.$occupation->id); - $response->assertstatus(200); - $response->assertjsonstructure([ + $response->assertStatus(200); + $response->assertJsonStructure([ 'data' => $this->jsonOccupation, ]); - $response->assertjsonfragment([ + $response->assertJsonFragment([ 'object' => 'occupation', 'id' => $occupation->id, ]); @@ -102,7 +102,7 @@ class ApiOccupationControllerTest extends ApiTestCase $response = $this->json('get', '/api/occupations/0'); - $this->expectnotfound($response); + $this->expectNotFound($response); } public function test_it_creates_a_occupation() @@ -122,19 +122,19 @@ class ApiOccupationControllerTest extends ApiTestCase 'title' => 'Waiter', ]); - $response->assertstatus(201); - $response->assertjsonstructure([ + $response->assertStatus(201); + $response->assertJsonStructure([ 'data' => $this->jsonOccupation, ]); $occupationId = $response->json('data.id'); - $response->assertjsonfragment([ + $response->assertJsonFragment([ 'object' => 'occupation', 'id' => $occupationId, ]); - $this->assertdatabasehas('occupations', [ + $this->assertDatabaseHas('occupations', [ 'account_id' => $user->account->id, 'id' => $occupationId, 'title' => 'Waiter', @@ -155,17 +155,17 @@ class ApiOccupationControllerTest extends ApiTestCase 'salary' => null, ]); - $response->assertstatus(200); + $response->assertStatus(200); - $response->assertjsonstructure([ + $response->assertJsonStructure([ 'data' => $this->jsonOccupation, ]); $occupationId = $response->json('data.id'); - $this->assertequals($occupation->id, $occupationId); + $this->assertEquals($occupation->id, $occupationId); - $response->assertjsonfragment([ + $response->assertJsonFragment([ 'object' => 'occupation', 'id' => $occupationId, ]); @@ -194,7 +194,7 @@ class ApiOccupationControllerTest extends ApiTestCase 'salary' => null, ]); - $this->expectnotfound($response); + $this->expectNotFound($response); } public function test_it_deletes_a_occupation() @@ -207,7 +207,7 @@ class ApiOccupationControllerTest extends ApiTestCase $response = $this->json('delete', '/api/occupations/'.$occupation->id); - $response->assertstatus(200); + $response->assertStatus(200); $this->assertdatabasemissing('occupations', [ 'account_id' => $user->account->id, diff --git a/tests/Api/Contact/ApiPhotoControllerTest.php b/tests/Api/Contact/ApiPhotoControllerTest.php index 19b2c0fea..00a12f549 100644 --- a/tests/Api/Contact/ApiPhotoControllerTest.php +++ b/tests/Api/Contact/ApiPhotoControllerTest.php @@ -47,7 +47,8 @@ class ApiPhotoControllerTest extends ApiTestCase return $photo; } - public function test_it_gets_a_list_of_photos() + /** @test */ + public function it_gets_a_list_of_photos() { $user = $this->signin(); @@ -76,7 +77,8 @@ class ApiPhotoControllerTest extends ApiTestCase ]); } - public function test_it_applies_the_limit_parameter_in_search() + /** @test */ + public function it_applies_the_limit_parameter_in_search() { $user = $this->signin(); @@ -103,7 +105,8 @@ class ApiPhotoControllerTest extends ApiTestCase ]); } - public function test_it_gets_a_photo() + /** @test */ + public function it_gets_a_photo() { $user = $this->signin(); @@ -118,7 +121,8 @@ class ApiPhotoControllerTest extends ApiTestCase ]); } - public function test_photo_show_gets_an_error_if_photo_is_not_linked_to_account() + /** @test */ + public function photo_show_gets_an_error_if_photo_is_not_linked_to_account() { $user = $this->signin(); @@ -134,7 +138,8 @@ class ApiPhotoControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_gets_a_photo_for_a_specific_contact() + /** @test */ + public function it_gets_a_photo_for_a_specific_contact() { $user = $this->signin(); @@ -158,7 +163,8 @@ class ApiPhotoControllerTest extends ApiTestCase ]); } - public function test_it_store_a_photo_for_a_specific_contact() + /** @test */ + public function it_store_a_photo_for_a_specific_contact() { Storage::fake(); @@ -186,7 +192,8 @@ class ApiPhotoControllerTest extends ApiTestCase Storage::disk('public')->assertExists($response->json('data.new_filename')); } - public function test_photo_store_gets_an_error_if_fields_are_missing() + /** @test */ + public function photo_store_gets_an_error_if_fields_are_missing() { $user = $this->signin(); @@ -198,7 +205,8 @@ class ApiPhotoControllerTest extends ApiTestCase ]); } - public function test_photo_store_gets_an_error_if_contact_is_not_linked_to_user() + /** @test */ + public function photo_store_gets_an_error_if_contact_is_not_linked_to_user() { $user = $this->signin(); @@ -213,7 +221,8 @@ class ApiPhotoControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_destroy_a_photo() + /** @test */ + public function it_destroy_a_photo() { $user = $this->signin(); @@ -234,7 +243,8 @@ class ApiPhotoControllerTest extends ApiTestCase ]); } - public function test_photo_destroy_gets_an_error_if_photo_is_not_linked_to_account() + /** @test */ + public function photo_destroy_gets_an_error_if_photo_is_not_linked_to_account() { $user = $this->signin(); @@ -250,7 +260,8 @@ class ApiPhotoControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_it_store_and_destroy_a_photo() + /** @test */ + public function it_store_and_destroy_a_photo() { Storage::fake(); diff --git a/tests/Api/ContactField/ApiContactFieldControllerTest.php b/tests/Api/ContactField/ApiContactFieldControllerTest.php index 1a41748e9..9409f6fc8 100644 --- a/tests/Api/ContactField/ApiContactFieldControllerTest.php +++ b/tests/Api/ContactField/ApiContactFieldControllerTest.php @@ -26,7 +26,8 @@ class ApiContactFieldControllerTest extends ApiTestCase 'updated_at', ]; - public function test_contact_fields_get_contact_all() + /** @test */ + public function contact_fields_get_contact_all() { $user = $this->signin(); $contact1 = factory(Contact::class)->create([ @@ -60,7 +61,8 @@ class ApiContactFieldControllerTest extends ApiTestCase ]); } - public function test_contact_fields_get_contact_all_error() + /** @test */ + public function contact_fields_get_contact_all_error() { $user = $this->signin(); @@ -69,7 +71,8 @@ class ApiContactFieldControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_contact_fields_get_one() + /** @test */ + public function contact_fields_get_one() { $user = $this->signin(); $contact1 = factory(Contact::class)->create([ @@ -100,7 +103,8 @@ class ApiContactFieldControllerTest extends ApiTestCase ]); } - public function test_contact_fields_get_one_error() + /** @test */ + public function contact_fields_get_one_error() { $user = $this->signin(); @@ -109,7 +113,8 @@ class ApiContactFieldControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_contact_fields_create() + /** @test */ + public function contact_fields_create() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -145,7 +150,8 @@ class ApiContactFieldControllerTest extends ApiTestCase ]); } - public function test_contact_fields_create_error() + /** @test */ + public function contact_fields_create_error() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -162,7 +168,8 @@ class ApiContactFieldControllerTest extends ApiTestCase ]); } - public function test_contact_fields_create_error_bad_account() + /** @test */ + public function contact_fields_create_error_bad_account() { $user = $this->signin(); @@ -183,7 +190,8 @@ class ApiContactFieldControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_contact_fields_update() + /** @test */ + public function contact_fields_update() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -221,7 +229,8 @@ class ApiContactFieldControllerTest extends ApiTestCase ]); } - public function test_contact_fields_update_error() + /** @test */ + public function contact_fields_update_error() { $user = $this->signin(); $contactField = factory(ContactField::class)->create([ @@ -238,7 +247,8 @@ class ApiContactFieldControllerTest extends ApiTestCase ]); } - public function test_contact_fields_update_error_bad_account() + /** @test */ + public function contact_fields_update_error_bad_account() { $user = $this->signin(); @@ -260,7 +270,8 @@ class ApiContactFieldControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_contact_fields_delete() + /** @test */ + public function contact_fields_delete() { $user = $this->signin(); $contact = factory(Contact::class)->create([ @@ -286,7 +297,8 @@ class ApiContactFieldControllerTest extends ApiTestCase ]); } - public function test_contact_fields_delete_error() + /** @test */ + public function contact_fields_delete_error() { $user = $this->signin(); diff --git a/tests/Api/ContactField/ApiContactFieldTypeControllerTest.php b/tests/Api/ContactField/ApiContactFieldTypeControllerTest.php index 401425285..8cd61b7b7 100644 --- a/tests/Api/ContactField/ApiContactFieldTypeControllerTest.php +++ b/tests/Api/ContactField/ApiContactFieldTypeControllerTest.php @@ -25,7 +25,8 @@ class ApiContactFieldTypeControllerTest extends ApiTestCase 'updated_at', ]; - public function test_contact_field_type_get_one() + /** @test */ + public function contact_field_type_get_one() { $user = $this->signin(); $contactFieldType1 = factory(ContactFieldType::class)->create([ @@ -51,7 +52,8 @@ class ApiContactFieldTypeControllerTest extends ApiTestCase ]); } - public function test_contact_field_type_get_one_error() + /** @test */ + public function contact_field_type_get_one_error() { $user = $this->signin(); @@ -60,7 +62,8 @@ class ApiContactFieldTypeControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_contact_field_type_create() + /** @test */ + public function contact_field_type_create() { $user = $this->signin(); @@ -90,7 +93,8 @@ class ApiContactFieldTypeControllerTest extends ApiTestCase ]); } - public function test_contact_field_type_create_error() + /** @test */ + public function contact_field_type_create_error() { $user = $this->signin(); @@ -102,7 +106,8 @@ class ApiContactFieldTypeControllerTest extends ApiTestCase ]); } - public function test_contact_field_type_update() + /** @test */ + public function contact_field_type_update() { $user = $this->signin(); $contactFieldType = factory(ContactFieldType::class)->create([ @@ -136,7 +141,8 @@ class ApiContactFieldTypeControllerTest extends ApiTestCase ]); } - public function test_contact_field_type_update_error() + /** @test */ + public function contact_field_type_update_error() { $user = $this->signin(); $contactFieldType = factory(ContactFieldType::class)->create([ @@ -150,7 +156,8 @@ class ApiContactFieldTypeControllerTest extends ApiTestCase ]); } - public function test_contact_field_type_update_error_bad_account() + /** @test */ + public function contact_field_type_update_error_bad_account() { $user = $this->signin(); @@ -168,7 +175,8 @@ class ApiContactFieldTypeControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_contact_field_type_delete() + /** @test */ + public function contact_field_type_delete() { $user = $this->signin(); $contactFieldType = factory(ContactFieldType::class)->create([ @@ -188,7 +196,8 @@ class ApiContactFieldTypeControllerTest extends ApiTestCase ]); } - public function test_contact_field_type_delete_error() + /** @test */ + public function contact_field_type_delete_error() { $user = $this->signin(); @@ -197,7 +206,8 @@ class ApiContactFieldTypeControllerTest extends ApiTestCase $this->expectNotFound($response); } - public function test_contact_field_type_delete_bad_account() + /** @test */ + public function contact_field_type_delete_bad_account() { $user = $this->signin(); diff --git a/tests/Api/Settings/ApiComplianceControllerTest.php b/tests/Api/Settings/ApiComplianceControllerTest.php index e074d5379..28b94242a 100644 --- a/tests/Api/Settings/ApiComplianceControllerTest.php +++ b/tests/Api/Settings/ApiComplianceControllerTest.php @@ -21,7 +21,8 @@ class ApiComplianceControllerTest extends ApiTestCase 'updated_at', ]; - public function test_it_gets_a_list_of_terms() + /** @test */ + public function it_gets_a_list_of_terms() { $term = factory(Term::class, 10)->create([ 'term_version' => rand(1, 100), @@ -51,7 +52,8 @@ class ApiComplianceControllerTest extends ApiTestCase ]); } - public function test_it_gets_a_single_term() + /** @test */ + public function it_gets_a_single_term() { $term = factory(Term::class)->create([ 'term_version' => rand(1, 100), @@ -74,7 +76,8 @@ class ApiComplianceControllerTest extends ApiTestCase ]); } - public function test_it_doesnt_get_a_single_term() + /** @test */ + public function it_doesnt_get_a_single_term() { $response = $this->json('GET', '/api/compliance/3'); diff --git a/tests/Api/Settings/ApiCurrencyControllerTest.php b/tests/Api/Settings/ApiCurrencyControllerTest.php index f040e3ea6..1558bad68 100644 --- a/tests/Api/Settings/ApiCurrencyControllerTest.php +++ b/tests/Api/Settings/ApiCurrencyControllerTest.php @@ -18,7 +18,8 @@ class ApiCurrencyControllerTest extends ApiTestCase 'symbol', ]; - public function test_currency_get_all() + /** @test */ + public function it_gets_all_the_currencies() { // in theory the currencies table is seeded by the initial script $response = $this->json('GET', '/api/currencies/'); @@ -40,7 +41,8 @@ class ApiCurrencyControllerTest extends ApiTestCase ]); } - public function test_currency_get_one() + /** @test */ + public function it_gets_one_currency() { $currency = factory(Currency::class)->create([]); @@ -58,7 +60,8 @@ class ApiCurrencyControllerTest extends ApiTestCase ]); } - public function test_currency_get_one_error() + /** @test */ + public function it_gets_a_currency_that_is_invalid() { $response = $this->json('GET', '/api/currencies/0'); diff --git a/tests/Commands/CalculateStatisticsTest.php b/tests/Commands/CalculateStatisticsTest.php index 984c67a4c..97a166d6f 100644 --- a/tests/Commands/CalculateStatisticsTest.php +++ b/tests/Commands/CalculateStatisticsTest.php @@ -10,7 +10,8 @@ class CalculateStatisticsTest extends TestCase { use DatabaseTransactions; - public function test_the_command_runs_well() + /** @test */ + public function the_command_runs_well() { $runsWell = true; diff --git a/tests/Commands/CleanCommandTest.php b/tests/Commands/CleanCommandTest.php index 590b3f429..fbaa028c3 100644 --- a/tests/Commands/CleanCommandTest.php +++ b/tests/Commands/CleanCommandTest.php @@ -12,7 +12,8 @@ class CleanCommandTest extends TestCase { use DatabaseTransactions; - public function test_clean_command_left_one_token() + /** @test */ + public function clean_command_left_one_token() { $account = factory(Account::class)->create(); $user = factory(User::class)->create([ @@ -35,7 +36,8 @@ class CleanCommandTest extends TestCase ]); } - public function test_clean_command_left_all_token() + /** @test */ + public function clean_command_left_all_token() { $account = factory(Account::class)->create(); $user = factory(User::class)->create([ @@ -67,7 +69,8 @@ class CleanCommandTest extends TestCase ]); } - public function test_clean_command_dryrun() + /** @test */ + public function clean_command_dryrun() { $account = factory(Account::class)->create(); $user = factory(User::class)->create([ diff --git a/tests/Commands/ImportCSVTest.php b/tests/Commands/ImportCSVTest.php index df380116f..ad7dd2869 100644 --- a/tests/Commands/ImportCSVTest.php +++ b/tests/Commands/ImportCSVTest.php @@ -13,7 +13,8 @@ class ImportCSVTest extends TestCase { use DatabaseTransactions; - public function test_csv_import_contacts() + /** @test */ + public function csv_import_contacts() { $this->withoutMockingConsoleOutput(); Storage::fake('public'); @@ -48,7 +49,8 @@ class ImportCSVTest extends TestCase $this->assertEquals(0, $exitCode); } - public function test_csv_import_validates_user() + /** @test */ + public function csv_import_validates_user() { $this->withoutMockingConsoleOutput(); @@ -65,7 +67,8 @@ class ImportCSVTest extends TestCase $this->assertEquals(-1, $exitCode); } - public function test_csv_import_validates_file() + /** @test */ + public function csv_import_validates_file() { $this->withoutMockingConsoleOutput(); diff --git a/tests/Commands/ImportVCardsTest.php b/tests/Commands/ImportVCardsTest.php index 70a1cee05..67747dd4b 100644 --- a/tests/Commands/ImportVCardsTest.php +++ b/tests/Commands/ImportVCardsTest.php @@ -13,7 +13,8 @@ class ImportVCardsTest extends TestCase { use DatabaseTransactions; - public function testItValidatesUser() + /** @test */ + public function it_validates_user() { $this->withoutMockingConsoleOutput(); @@ -30,7 +31,8 @@ class ImportVCardsTest extends TestCase $this->assertEquals(0, $exitCode); } - public function testItValidatesFile() + /** @test */ + public function it_validates_file() { $this->withoutMockingConsoleOutput(); @@ -47,7 +49,8 @@ class ImportVCardsTest extends TestCase $this->assertEquals(0, $exitCode); } - public function testItImportsContacts() + /** @test */ + public function it_imports_contacts() { $this->withoutMockingConsoleOutput(); Storage::fake('public'); diff --git a/tests/Commands/MoveAvatarsToPhotosDirectoryTest.php b/tests/Commands/MoveAvatarsToPhotosDirectoryTest.php index 6e24cad39..0dc6d401f 100644 --- a/tests/Commands/MoveAvatarsToPhotosDirectoryTest.php +++ b/tests/Commands/MoveAvatarsToPhotosDirectoryTest.php @@ -30,7 +30,8 @@ class MoveAvatarsToPhotosDirectoryTest extends TestCase return [$user, $contact]; } - public function test_it_move_avatars_to_photo_directory() + /** @test */ + public function it_move_avatars_to_photo_directory() { [$user, $contact] = $this->fetchUser(); @@ -65,7 +66,8 @@ class MoveAvatarsToPhotosDirectoryTest extends TestCase Storage::disk('public')->assertExists($photo->new_filename); } - public function test_it_handles_missing_avatar() + /** @test */ + public function it_handles_missing_avatar() { [$user, $contact] = $this->fetchUser(); diff --git a/tests/Commands/Scheduling/CronEventTest.php b/tests/Commands/Scheduling/CronEventTest.php index e0319ebd4..f0d0d6a08 100644 --- a/tests/Commands/Scheduling/CronEventTest.php +++ b/tests/Commands/Scheduling/CronEventTest.php @@ -12,7 +12,8 @@ class CronEventTest extends TestCase { use DatabaseTransactions; - public function test_it_get_command() + /** @test */ + public function it_get_the_right_command() { $cron = factory(Cron::class)->create(); @@ -21,7 +22,8 @@ class CronEventTest extends TestCase $this->assertEquals($event->cron()->id, $cron->id); } - public function test_now_not_due() + /** @test */ + public function now_not_due() { $cron = factory(Cron::class)->create(); $event = new CronEvent($cron); @@ -29,7 +31,8 @@ class CronEventTest extends TestCase $this->assertFalse($event->isDue()); } - public function test_next_minute_is_due() + /** @test */ + public function next_minute_is_due() { Carbon::setTestNow(Carbon::create(2019, 5, 1, 7, 0, 0)); @@ -48,7 +51,8 @@ class CronEventTest extends TestCase ]); } - public function test_hourly_cron() + /** @test */ + public function hourly_cron() { Carbon::setTestNow(Carbon::create(2019, 5, 1, 7, 0, 0)); @@ -81,7 +85,8 @@ class CronEventTest extends TestCase ]); } - public function test_daily_cron() + /** @test */ + public function daily_cron() { Carbon::setTestNow(Carbon::create(2019, 5, 1, 7, 0, 0)); diff --git a/tests/Commands/SendRemindersTest.php b/tests/Commands/SendRemindersTest.php index 9a82f5bf0..3269c6244 100644 --- a/tests/Commands/SendRemindersTest.php +++ b/tests/Commands/SendRemindersTest.php @@ -18,7 +18,8 @@ class SendRemindersTest extends TestCase { use DatabaseTransactions; - public function test_it_schedules_a_reminder_email_job() + /** @test */ + public function it_schedules_a_reminder_email_job() { Bus::fake(); @@ -45,7 +46,8 @@ class SendRemindersTest extends TestCase Bus::assertDispatched(NotifyUserAboutReminder::class); } - public function test_it_doesnt_schedule_a_notification_if_it_is_not_the_right_time() + /** @test */ + public function it_doesnt_schedule_a_notification_if_it_is_not_the_right_time() { Bus::fake(); diff --git a/tests/Commands/SendStayInTouchTest.php b/tests/Commands/SendStayInTouchTest.php index 724b5033d..2bc23bfc1 100644 --- a/tests/Commands/SendStayInTouchTest.php +++ b/tests/Commands/SendStayInTouchTest.php @@ -15,7 +15,8 @@ class SendStayInTouchTest extends TestCase { use DatabaseTransactions; - public function test_it_schedules_a_stay_in_touch_job() + /** @test */ + public function it_schedules_a_stay_in_touch_job() { Bus::fake(); @@ -33,7 +34,8 @@ class SendStayInTouchTest extends TestCase Bus::assertDispatched(ScheduleStayInTouch::class); } - public function test_it_doesnt_schedule_stay_in_touch_jobs_if_no_date_is_found() + /** @test */ + public function it_doesnt_schedule_stay_in_touch_jobs_if_no_date_is_found() { Bus::fake(); diff --git a/tests/Commands/UpdateCommandTest.php b/tests/Commands/UpdateCommandTest.php index e70f84a10..632988561 100644 --- a/tests/Commands/UpdateCommandTest.php +++ b/tests/Commands/UpdateCommandTest.php @@ -10,7 +10,8 @@ class UpdateCommandTest extends TestCase { use DatabaseTransactions; - public function test_update_command_default() + /** @test */ + public function update_command_default() { $commandExecutor = new CommandExecutorTester(); $command = new Update(); @@ -26,7 +27,8 @@ class UpdateCommandTest extends TestCase $this->assertCommandContains($commandExecutor->buffer[7], 'Maintenance mode: off', 'php artisan up'); } - public function test_update_command_composer() + /** @test */ + public function update_command_composer() { $commandExecutor = new CommandExecutorTester(); $command = new Update(); diff --git a/tests/Unit/Controllers/Auth/PasswordResetTest.php b/tests/Unit/Controllers/Auth/PasswordResetTest.php index 5cc965a74..753fb52c1 100644 --- a/tests/Unit/Controllers/Auth/PasswordResetTest.php +++ b/tests/Unit/Controllers/Auth/PasswordResetTest.php @@ -12,7 +12,8 @@ class PasswordResetTest extends TestCase { use DatabaseTransactions; - public function test_it_send_password_reset_email() + /** @test */ + public function it_sends_password_reset_email() { NotificationFacade::fake(); diff --git a/tests/Unit/Controllers/Settings/GendersControllerTest.php b/tests/Unit/Controllers/Settings/GendersControllerTest.php index b1e0d3e15..ca27cf15d 100644 --- a/tests/Unit/Controllers/Settings/GendersControllerTest.php +++ b/tests/Unit/Controllers/Settings/GendersControllerTest.php @@ -24,7 +24,8 @@ class GendersControllerTest extends FeatureTestCase 'name', ]; - public function test_it_gets_the_list_of_genders() + /** @test */ + public function it_gets_the_list_of_genders() { $user = $this->signin(); @@ -42,7 +43,8 @@ class GendersControllerTest extends FeatureTestCase ); } - public function test_it_gets_the_list_of_genderTypes() + /** @test */ + public function it_gets_the_list_of_genderTypes() { $user = $this->signin(); @@ -60,7 +62,8 @@ class GendersControllerTest extends FeatureTestCase ); } - public function test_it_store_a_new_gender() + /** @test */ + public function it_stores_a_new_gender() { $user = $this->signin(); @@ -79,7 +82,8 @@ class GendersControllerTest extends FeatureTestCase ]); } - public function test_it_update_a_gender() + /** @test */ + public function it_updates_a_gender() { $user = $this->signin(); @@ -99,7 +103,8 @@ class GendersControllerTest extends FeatureTestCase ]); } - public function test_it_replace_a_gender() + /** @test */ + public function it_replaces_a_gender() { $user = $this->signin(); @@ -127,7 +132,8 @@ class GendersControllerTest extends FeatureTestCase ]); } - public function test_it_replace_a_gender_with_error() + /** @test */ + public function it_replaces_a_gender_with_error() { $user = $this->signin(); $gender1 = factory(Gender::class)->create([ @@ -143,7 +149,8 @@ class GendersControllerTest extends FeatureTestCase ]); } - public function test_it_destroy_a_gender() + /** @test */ + public function it_destroys_a_gender() { $user = $this->signin(); @@ -159,7 +166,8 @@ class GendersControllerTest extends FeatureTestCase ]); } - public function test_it_update_the_default_gender() + /** @test */ + public function it_updates_the_default_gender() { $user = $this->signin(); diff --git a/tests/Unit/Events/Google2faEventListenerTest.php b/tests/Unit/Events/Google2faEventListenerTest.php index 07d106843..ac8c5799b 100644 --- a/tests/Unit/Events/Google2faEventListenerTest.php +++ b/tests/Unit/Events/Google2faEventListenerTest.php @@ -27,7 +27,8 @@ class Google2faEventListenerTest extends FeatureTestCase app('pragmarx.google2fa')->setStateless(false); } - public function test_it_listen_u2f_event() + /** @test */ + public function it_listens_u2f_event() { $user = $this->signIn(); $user->google2fa_secret = 'x'; @@ -37,7 +38,8 @@ class Google2faEventListenerTest extends FeatureTestCase $this->assertTrue($this->app['session']->get('google2fa.auth_passed')); } - public function test_it_listen_recovery_event() + /** @test */ + public function it_listens_recovery_event() { $user = $this->signIn(); $user->google2fa_secret = 'x'; @@ -47,7 +49,8 @@ class Google2faEventListenerTest extends FeatureTestCase $this->assertTrue($this->app['session']->get('google2fa.auth_passed')); } - public function test_it_listen_login_remember_event() + /** @test */ + public function it_listens_login_remember_event() { $user = $this->signIn(); $user->google2fa_secret = 'x'; diff --git a/tests/Unit/Events/U2faEventListenerTest.php b/tests/Unit/Events/U2faEventListenerTest.php index 23de892e2..1231ac2fb 100644 --- a/tests/Unit/Events/U2faEventListenerTest.php +++ b/tests/Unit/Events/U2faEventListenerTest.php @@ -22,7 +22,8 @@ class U2faEventListenerTest extends FeatureTestCase $this->startSession(); } - public function test_it_listen_recovery_event() + /** @test */ + public function it_listens_recovery_event() { $user = $this->signIn(); factory(U2fKey::class)->create([ @@ -34,7 +35,8 @@ class U2faEventListenerTest extends FeatureTestCase $this->assertTrue($this->app['session']->get('u2f_auth')); } - public function test_it_listen_google2fa_event() + /** @test */ + public function it_listens_google2fa_event() { $user = $this->signIn(); factory(U2fKey::class)->create([ @@ -46,7 +48,8 @@ class U2faEventListenerTest extends FeatureTestCase $this->assertTrue($this->app['session']->get('u2f_auth')); } - public function test_it_listen_login_remember_event() + /** @test */ + public function it_listens_login_remember_event() { $user = $this->signIn(); factory(U2fKey::class)->create([ diff --git a/tests/Unit/Helpers/CollectionHelperTest.php b/tests/Unit/Helpers/CollectionHelperTest.php index ebd185086..813bbc7e4 100644 --- a/tests/Unit/Helpers/CollectionHelperTest.php +++ b/tests/Unit/Helpers/CollectionHelperTest.php @@ -8,7 +8,8 @@ use Illuminate\Support\Facades\App; class CollectionHelperTest extends FeatureTestCase { - public function test_sortByCollator_base() + /** @test */ + public function sortByCollator_base() { $collection = collect([ ['name' => 'a'], @@ -27,7 +28,8 @@ class CollectionHelperTest extends FeatureTestCase ); } - public function test_sortByCollator_macro() + /** @test */ + public function sortByCollator_macro() { $collection = collect([ ['name' => 'a'], @@ -46,7 +48,8 @@ class CollectionHelperTest extends FeatureTestCase ); } - public function test_sortByCollator_callback() + /** @test */ + public function sortByCollator_callback() { $collection = collect([ ['name' => 'a'], @@ -67,7 +70,8 @@ class CollectionHelperTest extends FeatureTestCase ); } - public function test_sortByCollator_default_collation() + /** @test */ + public function sortByCollator_default_collation() { App::setLocale('en'); @@ -90,7 +94,8 @@ class CollectionHelperTest extends FeatureTestCase ); } - public function test_sortByCollator_french_collation() + /** @test */ + public function sortByCollator_french_collation() { App::setLocale('fr'); @@ -113,7 +118,8 @@ class CollectionHelperTest extends FeatureTestCase ); } - public function test_getCollator_french_collation() + /** @test */ + public function getCollator_french_collation() { $collator = CollectionHelper::getCollator('fr'); diff --git a/tests/Unit/Helpers/GenderHelperTest.php b/tests/Unit/Helpers/GenderHelperTest.php index c82ef2fdc..2f90b68a3 100644 --- a/tests/Unit/Helpers/GenderHelperTest.php +++ b/tests/Unit/Helpers/GenderHelperTest.php @@ -7,7 +7,8 @@ use App\Helpers\GendersHelper; class GenderHelperTest extends FeatureTestCase { - public function test_getting_gender_input() + /** @test */ + public function it_gets_all_the_gender_inputs() { $this->signIn(); diff --git a/tests/Unit/Helpers/InstanceHelperTest.php b/tests/Unit/Helpers/InstanceHelperTest.php index 39911ecc5..03d8bea98 100644 --- a/tests/Unit/Helpers/InstanceHelperTest.php +++ b/tests/Unit/Helpers/InstanceHelperTest.php @@ -12,7 +12,8 @@ class InstanceHelperTest extends TestCase { use DatabaseTransactions; - public function test_it_gets_the_number_of_paid_subscribers() + /** @test */ + public function it_gets_the_number_of_paid_subscribers() { $account = factory(Account::class)->create(['stripe_id' => 'id292839']); $account = factory(Account::class)->create(); @@ -24,7 +25,8 @@ class InstanceHelperTest extends TestCase ); } - public function test_it_fetches_the_monthly_plan_information() + /** @test */ + public function it_fetches_the_monthly_plan_information() { config(['monica.paid_plan_monthly_friendly_name' => 'Monthly']); config(['monica.paid_plan_monthly_id' => 'monthly']); @@ -56,7 +58,8 @@ class InstanceHelperTest extends TestCase ); } - public function test_it_fetches_the_annually_plan_information() + /** @test */ + public function it_fetches_the_annually_plan_information() { config(['monica.paid_plan_annual_friendly_name' => 'Annual']); config(['monica.paid_plan_annual_id' => 'annual']); @@ -88,7 +91,8 @@ class InstanceHelperTest extends TestCase ); } - public function test_it_returns_null_when_fetching_an_unknown_plan_information() + /** @test */ + public function it_returns_null_when_fetching_an_unknown_plan_information() { $account = new Account; @@ -97,7 +101,8 @@ class InstanceHelperTest extends TestCase ); } - public function test_it_gets_latest_changelog_entries() + /** @test */ + public function it_gets_latest_changelog_entries() { $json = public_path('changelog.json'); $changelogs = json_decode(file_get_contents($json), true)['entries']; diff --git a/tests/Unit/Helpers/LocaleHelperTest.php b/tests/Unit/Helpers/LocaleHelperTest.php index 3703ea753..4d440ebf1 100644 --- a/tests/Unit/Helpers/LocaleHelperTest.php +++ b/tests/Unit/Helpers/LocaleHelperTest.php @@ -11,7 +11,8 @@ class LocaleHelperTest extends FeatureTestCase { use DatabaseTransactions; - public function test_get_locale_returns_english_by_default() + /** @test */ + public function get_locale_returns_english_by_default() { $this->assertEquals( 'en', @@ -19,7 +20,8 @@ class LocaleHelperTest extends FeatureTestCase ); } - public function test_get_locale_returns_right_locale_if_user_logged() + /** @test */ + public function get_locale_returns_right_locale_if_user_logged() { $user = $this->signIn(); $user->locale = 'fr'; @@ -31,7 +33,8 @@ class LocaleHelperTest extends FeatureTestCase ); } - public function test_get_direction_default() + /** @test */ + public function get_direction_default() { $this->assertEquals( 'ltr', @@ -39,7 +42,8 @@ class LocaleHelperTest extends FeatureTestCase ); } - public function test_get_direction_french() + /** @test */ + public function get_direction_french() { App::setLocale('fr'); @@ -49,7 +53,8 @@ class LocaleHelperTest extends FeatureTestCase ); } - public function test_get_direction_hebrew() + /** @test */ + public function get_direction_hebrew() { App::setLocale('he'); @@ -59,7 +64,8 @@ class LocaleHelperTest extends FeatureTestCase ); } - public function test_format_telephone_by_iso() + /** @test */ + public function format_telephone_by_iso() { $tel = LocaleHelper::formatTelephoneNumberByISO('202-555-0191', 'gb'); diff --git a/tests/Unit/Helpers/MoneyHelperTest.php b/tests/Unit/Helpers/MoneyHelperTest.php index ade02c5f7..71c13a84a 100644 --- a/tests/Unit/Helpers/MoneyHelperTest.php +++ b/tests/Unit/Helpers/MoneyHelperTest.php @@ -13,7 +13,8 @@ class MoneyHelperTest extends TestCase { use DatabaseTransactions; - public function testFormatReturnsAmountWithCurrencySymbol() + /** @test */ + public function it_returns_the_amount_with_the_currency_symbol() { $currency = new Currency(); $currency->iso = 'EUR'; @@ -22,7 +23,8 @@ class MoneyHelperTest extends TestCase $this->assertEquals('€5,038.29', MoneyHelper::format(5038.29, $currency)); } - public function testFormatReturnsAmountWithLocale() + /** @test */ + public function it_returns_the_amount_with_the_currency_symbol_in_the_right_locale() { App::setLocale('fr'); @@ -30,10 +32,10 @@ class MoneyHelperTest extends TestCase $currency->iso = 'EUR'; $this->assertEquals('500,00 €', MoneyHelper::format(500, $currency)); - //$this->assertEquals('5 038,29 €', MoneyHelper::format(5038.29, $currency)); } - public function testFormatReturnsAmountWithCurrencySymbolOfZeroMinorUnitCurrency() + /** @test */ + public function it_returns_the_amount_with_the_currency_symbol_with_the_right_punctuation() { $currency = new Currency(); $currency->iso = 'JPY'; // minorUnit value is zero "0" @@ -42,7 +44,8 @@ class MoneyHelperTest extends TestCase $this->assertEquals('¥5,038', MoneyHelper::format(5038, $currency)); } - public function testFormatUsesCurrencySettingIfDefined() + /** @test */ + public function it_formats_the_currency_with_the_right_locale() { $currency = Currency::where('iso', 'GBP')->first(); $user = factory(User::class)->create([ @@ -54,18 +57,21 @@ class MoneyHelperTest extends TestCase $this->assertEquals('£2,734.12', MoneyHelper::format(2734.12)); } - public function testFormatReturnsAmountWithoutSymbolIfCurrencyIsUndefined() + /** @test */ + public function it_returns_the_amount_without_the_currency_symbol_if_not_provided() { $this->assertEquals('500', MoneyHelper::format(500)); $this->assertEquals('5,000', MoneyHelper::format(5000)); } - public function testFormatReturnsZeroIfAmountIsNull() + /** @test */ + public function it_returns_zero_if_amount_is_null() { $this->assertEquals('0', MoneyHelper::format(null)); } - public function test_it_covers_brazilian_currency() + /** @test */ + public function it_covers_brazilian_currency() { $currency = Currency::where('iso', 'BRL')->first(); diff --git a/tests/Unit/Helpers/RequestHelperTest.php b/tests/Unit/Helpers/RequestHelperTest.php index 20c0c2001..8de25cad1 100644 --- a/tests/Unit/Helpers/RequestHelperTest.php +++ b/tests/Unit/Helpers/RequestHelperTest.php @@ -8,7 +8,8 @@ use Illuminate\Support\Facades\Request; class RequestHelperTest extends TestCase { - public function test_get_cf_ip() + /** @test */ + public function get_cf_ip() { Request::instance()->headers->set('Cf-Connecting-Ip', '1.2.3.4'); @@ -18,7 +19,8 @@ class RequestHelperTest extends TestCase ); } - public function test_get_server_ip() + /** @test */ + public function get_server_ip() { Request::instance()->server->set('REMOTE_ADDR', '1.2.3.4'); @@ -28,7 +30,8 @@ class RequestHelperTest extends TestCase ); } - public function test_get_country_from_cf() + /** @test */ + public function get_country_from_cf() { Request::instance()->headers->set('Cf-Ipcountry', 'XX'); @@ -38,7 +41,8 @@ class RequestHelperTest extends TestCase ); } - public function test_get_country_from_ip() + /** @test */ + public function get_country_from_ip() { Request::instance()->server->set('REMOTE_ADDR', '123.45.67.89'); diff --git a/tests/Unit/Helpers/SearchHelperTest.php b/tests/Unit/Helpers/SearchHelperTest.php index c5ec30d60..d4086c574 100644 --- a/tests/Unit/Helpers/SearchHelperTest.php +++ b/tests/Unit/Helpers/SearchHelperTest.php @@ -11,7 +11,8 @@ class SearchHelperTest extends FeatureTestCase { use DatabaseTransactions; - public function test_searching_for_contacts_returns_a_collection_with_pagination() + /** @test */ + public function searching_for_contacts_returns_a_collection_with_pagination() { $user = $this->signin(); @@ -25,7 +26,8 @@ class SearchHelperTest extends FeatureTestCase $this->assertCount(1, $searchResults); } - public function test_searching_with_wrong_search_field() + /** @test */ + public function searching_with_wrong_search_field() { $user = $this->signin(); diff --git a/tests/Unit/Helpers/StringHelperTest.php b/tests/Unit/Helpers/StringHelperTest.php index fbd647e47..f7b223825 100644 --- a/tests/Unit/Helpers/StringHelperTest.php +++ b/tests/Unit/Helpers/StringHelperTest.php @@ -10,7 +10,8 @@ class StringHelperTest extends TestCase { use DatabaseTransactions; - public function test_it_builds_a_sql_query() + /** @test */ + public function it_builds_a_sql_query() { $array = [ 'column1', diff --git a/tests/Unit/Helpers/VCardHelperTest.php b/tests/Unit/Helpers/VCardHelperTest.php index b48cf3baf..3d4ccaaa7 100644 --- a/tests/Unit/Helpers/VCardHelperTest.php +++ b/tests/Unit/Helpers/VCardHelperTest.php @@ -8,7 +8,8 @@ use Sabre\VObject\Component\VCard; class VCardHelperTest extends FeatureTestCase { - public function test_it_get_country_by_sabre_vcard() + /** @test */ + public function it_get_country_by_sabre_vcard() { $vcard = new VCard([ 'TEL' => '202-555-0191', diff --git a/tests/Unit/Helpers/WeatherHelperTest.php b/tests/Unit/Helpers/WeatherHelperTest.php index 99d204b3d..ee1c159af 100644 --- a/tests/Unit/Helpers/WeatherHelperTest.php +++ b/tests/Unit/Helpers/WeatherHelperTest.php @@ -11,7 +11,8 @@ class WeatherHelperTest extends FeatureTestCase { use DatabaseTransactions; - public function test_it_returns_null_if_address_is_not_set() + /** @test */ + public function it_returns_null_if_address_is_not_set() { $contact = factory(Contact::class)->create([]); $this->assertNull(WeatherHelper::getWeatherForAddress($contact->addresses()->first())); diff --git a/tests/Unit/Jobs/CreateAvatarsForExistingContactsTest.php b/tests/Unit/Jobs/CreateAvatarsForExistingContactsTest.php index ac716e893..16c96a7d2 100644 --- a/tests/Unit/Jobs/CreateAvatarsForExistingContactsTest.php +++ b/tests/Unit/Jobs/CreateAvatarsForExistingContactsTest.php @@ -14,7 +14,8 @@ class CreateAvatarsForExistingContactsTest extends TestCase { use DatabaseTransactions; - public function test_it_create_jobs_for_avatars_migration() + /** @test */ + public function it_creates_jobs_for_avatars_migration() { Queue::fake(); diff --git a/tests/Unit/Jobs/Reminder/NotifyUserAboutReminderTest.php b/tests/Unit/Jobs/Reminder/NotifyUserAboutReminderTest.php index 18510d284..88e8272f2 100644 --- a/tests/Unit/Jobs/Reminder/NotifyUserAboutReminderTest.php +++ b/tests/Unit/Jobs/Reminder/NotifyUserAboutReminderTest.php @@ -19,7 +19,8 @@ class NotifyUserAboutReminderTest extends TestCase { use DatabaseTransactions; - public function test_it_sends_a_reminder_to_a_user() + /** @test */ + public function it_sends_a_reminder_to_a_user() { Notification::fake(); @@ -64,7 +65,8 @@ class NotifyUserAboutReminderTest extends TestCase ); } - public function test_it_sends_a_notification_to_a_user() + /** @test */ + public function it_sends_a_notification_to_a_user() { Notification::fake(); @@ -109,7 +111,8 @@ class NotifyUserAboutReminderTest extends TestCase ); } - public function test_it_doesnt_notify_a_user_if_he_is_on_the_free_plan() + /** @test */ + public function it_doesnt_notify_a_user_if_he_is_on_the_free_plan() { Notification::fake(); @@ -145,7 +148,8 @@ class NotifyUserAboutReminderTest extends TestCase ); } - public function test_it_marks_the_one_time_reminder_has_inactive_once_it_is_sent() + /** @test */ + public function it_marks_the_one_time_reminder_has_inactive_once_it_is_sent() { Notification::fake(); @@ -184,7 +188,8 @@ class NotifyUserAboutReminderTest extends TestCase ]); } - public function test_it_reschedule_a_recurring_reminder_once_it_is_sent() + /** @test */ + public function it_reschedule_a_recurring_reminder_once_it_is_sent() { Notification::fake(); @@ -229,7 +234,8 @@ class NotifyUserAboutReminderTest extends TestCase ]); } - public function test_it_creates_a_reminder_sent_object() + /** @test */ + public function it_creates_a_reminder_sent_object() { Notification::fake(); Carbon::setTestNow(Carbon::create(2017, 1, 1, 7, 0, 0)); diff --git a/tests/Unit/Jobs/ScheduleStayInTouchTest.php b/tests/Unit/Jobs/ScheduleStayInTouchTest.php index 024e1ad93..4c222a89c 100644 --- a/tests/Unit/Jobs/ScheduleStayInTouchTest.php +++ b/tests/Unit/Jobs/ScheduleStayInTouchTest.php @@ -16,7 +16,8 @@ class ScheduleStayInTouchTest extends TestCase { use DatabaseTransactions; - public function test_it_dispatches_an_email() + /** @test */ + public function it_dispatches_an_email() { NotificationFacade::fake(); @@ -56,7 +57,8 @@ class ScheduleStayInTouchTest extends TestCase ]); } - public function test_it_doesnt_dispatches_an_email_if_free_account() + /** @test */ + public function it_doesnt_dispatches_an_email_if_free_account() { NotificationFacade::fake(); @@ -89,7 +91,8 @@ class ScheduleStayInTouchTest extends TestCase ]); } - public function test_it_reschedule_missed_stayintouch() + /** @test */ + public function it_reschedule_missed_stayintouch() { NotificationFacade::fake(); diff --git a/tests/Unit/Models/AccountTest.php b/tests/Unit/Models/AccountTest.php index 7bb9ae074..d7c97f2e7 100644 --- a/tests/Unit/Models/AccountTest.php +++ b/tests/Unit/Models/AccountTest.php @@ -37,7 +37,8 @@ class AccountTest extends FeatureTestCase { use DatabaseTransactions; - public function test_it_has_many_genders() + /** @test */ + public function it_has_many_genders() { $account = factory(Account::class)->create(); $gender = factory(Gender::class)->create([ @@ -52,7 +53,8 @@ class AccountTest extends FeatureTestCase $this->assertTrue($account->genders()->exists()); } - public function test_it_has_many_relationship_types() + /** @test */ + public function it_has_many_relationship_types() { $account = factory(Account::class)->create(); $relationshipType = factory(RelationshipType::class)->create([ @@ -65,7 +67,8 @@ class AccountTest extends FeatureTestCase $this->assertTrue($account->relationshipTypes()->exists()); } - public function test_it_has_many_relationship_type_groups() + /** @test */ + public function it_has_many_relationship_type_groups() { $contact = factory(Contact::class)->create(); $account = $contact->account; @@ -79,7 +82,8 @@ class AccountTest extends FeatureTestCase $this->assertTrue($account->relationshipTypeGroups()->exists()); } - public function test_it_has_many_modules() + /** @test */ + public function it_has_many_modules() { $contact = factory(Contact::class)->create(); $account = $contact->account; @@ -93,7 +97,8 @@ class AccountTest extends FeatureTestCase $this->assertTrue($account->modules()->exists()); } - public function test_it_has_many_activity_types() + /** @test */ + public function it_has_many_activity_types() { $account = factory(Account::class)->create(); $activityType = factory(ActivityType::class)->create([ @@ -103,7 +108,8 @@ class AccountTest extends FeatureTestCase $this->assertTrue($account->activityTypes()->exists()); } - public function test_it_has_many_activity_type_categories() + /** @test */ + public function it_has_many_activity_type_categories() { $account = factory(Account::class)->create(); $ActivityTypeCategory = factory(ActivityTypeCategory::class)->create([ @@ -113,7 +119,8 @@ class AccountTest extends FeatureTestCase $this->assertTrue($account->activityTypeCategories()->exists()); } - public function test_it_has_many_conversations() + /** @test */ + public function it_has_many_conversations() { $account = factory(Account::class)->create([]); $conversation = factory(Conversation::class, 2)->create([ @@ -123,7 +130,8 @@ class AccountTest extends FeatureTestCase $this->assertTrue($account->conversations()->exists()); } - public function test_it_has_many_messages() + /** @test */ + public function it_has_many_messages() { $account = factory(Account::class)->create([]); $conversation = factory(Conversation::class)->create([ @@ -137,7 +145,8 @@ class AccountTest extends FeatureTestCase $this->assertTrue($account->messages()->exists()); } - public function test_it_has_many_life_event_categories() + /** @test */ + public function it_has_many_life_event_categories() { $account = factory(Account::class)->create([]); $lifeEventCategory = factory(LifeEventCategory::class)->create([ @@ -147,13 +156,15 @@ class AccountTest extends FeatureTestCase $this->assertTrue($account->lifeEventCategories()->exists()); } - public function test_it_has_many_reminder_outboxes() + /** @test */ + public function it_has_many_reminder_outboxes() { $reminderOutbox = factory(ReminderOutbox::class)->create([]); $this->assertTrue($reminderOutbox->account->reminderOutboxes()->exists()); } - public function test_it_has_many_life_event_types() + /** @test */ + public function it_has_many_life_event_types() { $account = factory(Account::class)->create([]); $lifeEventType = factory(LifeEventType::class)->create([ @@ -163,7 +174,8 @@ class AccountTest extends FeatureTestCase $this->assertTrue($account->lifeEventTypes()->exists()); } - public function test_it_has_many_life_events() + /** @test */ + public function it_has_many_life_events() { $account = factory(Account::class)->create([]); $lifeEvent = factory(LifeEvent::class)->create([ @@ -173,7 +185,8 @@ class AccountTest extends FeatureTestCase $this->assertTrue($account->lifeEvents()->exists()); } - public function test_it_has_many_documents() + /** @test */ + public function it_has_many_documents() { $account = factory(Account::class)->create([]); $document = factory(Document::class)->create([ @@ -183,7 +196,8 @@ class AccountTest extends FeatureTestCase $this->assertTrue($account->documents()->exists()); } - public function test_it_has_many_photos() + /** @test */ + public function it_has_many_photos() { $account = factory(Account::class)->create([]); $photo = factory(Photo::class)->create([ @@ -192,13 +206,15 @@ class AccountTest extends FeatureTestCase $this->assertTrue($account->photos()->exists()); } - public function test_it_has_many_weathers() + /** @test */ + public function it_has_many_weathers() { $weather = factory(Weather::class)->create([]); $this->assertTrue($weather->account->weathers()->exists()); } - public function test_it_has_many_places() + /** @test */ + public function it_has_many_places() { $account = factory(Account::class)->create([]); $places = factory(Place::class)->create([ @@ -207,7 +223,8 @@ class AccountTest extends FeatureTestCase $this->assertTrue($account->places()->exists()); } - public function test_it_has_many_addresses() + /** @test */ + public function it_has_many_addresses() { $account = factory(Account::class)->create([]); $addresses = factory(Address::class)->create([ @@ -216,7 +233,8 @@ class AccountTest extends FeatureTestCase $this->assertTrue($account->addresses()->exists()); } - public function test_it_has_many_companies() + /** @test */ + public function it_has_many_companies() { $account = factory(Account::class)->create([]); $companies = factory(Company::class)->create([ @@ -225,7 +243,8 @@ class AccountTest extends FeatureTestCase $this->assertTrue($account->companies()->exists()); } - public function test_it_has_many_occupations() + /** @test */ + public function it_has_many_occupations() { $account = factory(Account::class)->create([]); $occupations = factory(Occupation::class)->create([ @@ -234,7 +253,8 @@ class AccountTest extends FeatureTestCase $this->assertTrue($account->occupations()->exists()); } - public function test_user_can_downgrade_with_only_one_user_and_no_pending_invitations_and_under_contact_limit() + /** @test */ + public function user_can_downgrade_with_only_one_user_and_no_pending_invitations_and_under_contact_limit() { config(['monica.number_of_allowed_contacts_free_account' => 1]); $contact = factory(Contact::class)->create(); @@ -250,7 +270,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_user_cant_downgrade_with_two_users() + /** @test */ + public function user_cant_downgrade_with_two_users() { $contact = factory(Contact::class)->create(); $account = $contact->account; @@ -269,7 +290,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_user_cant_downgrade_with_pending_invitations() + /** @test */ + public function user_cant_downgrade_with_pending_invitations() { $account = factory(Account::class)->create(); @@ -283,7 +305,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_user_cant_downgrade_with_too_many_contacts() + /** @test */ + public function user_cant_downgrade_with_too_many_contacts() { config(['monica.number_of_allowed_contacts_free_account' => 1]); $account = factory(Account::class)->create(); @@ -297,7 +320,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_user_is_subscribed_if_user_can_access_to_paid_version_for_free() + /** @test */ + public function user_is_subscribed_if_user_can_access_to_paid_version_for_free() { $account = factory(Account::class)->make([ 'has_access_to_paid_version_for_free' => true, @@ -309,7 +333,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_user_is_subscribed_returns_false_if_not_subcribed() + /** @test */ + public function user_is_subscribed_returns_false_if_not_subcribed() { $account = factory(Account::class)->make([ 'has_access_to_paid_version_for_free' => false, @@ -321,7 +346,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_user_is_subscribed_returns_true_if_monthly_plan_is_set() + /** @test */ + public function user_is_subscribed_returns_true_if_monthly_plan_is_set() { $account = factory(Account::class)->create(); @@ -340,7 +366,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_user_is_subscribed_returns_true_if_annual_plan_is_set() + /** @test */ + public function user_is_subscribed_returns_true_if_annual_plan_is_set() { $account = factory(Account::class)->create(); @@ -359,7 +386,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_user_is_subscribed_returns_false_if_no_plan_is_set() + /** @test */ + public function user_is_subscribed_returns_false_if_no_plan_is_set() { $account = factory(Account::class)->create(); @@ -369,7 +397,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_user_has_limitations_if_not_subscribed_or_exempted_of_subscriptions() + /** @test */ + public function user_has_limitations_if_not_subscribed_or_exempted_of_subscriptions() { $account = factory(Account::class)->make([ 'has_access_to_paid_version_for_free' => true, @@ -393,7 +422,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_get_timezone_gets_the_first_timezone_it_finds() + /** @test */ + public function get_timezone_gets_the_first_timezone_it_finds() { $account = factory(Account::class)->create(); @@ -413,7 +443,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_has_invoices_returns_true_if_a_plan_exists() + /** @test */ + public function has_invoices_returns_true_if_a_plan_exists() { $account = factory(Account::class)->create(); @@ -427,14 +458,16 @@ class AccountTest extends FeatureTestCase $this->assertTrue($account->hasInvoices()); } - public function test_has_invoices_returns_false_if_a_plan_does_not_exist() + /** @test */ + public function has_invoices_returns_false_if_a_plan_does_not_exist() { $account = factory(Account::class)->create(); $this->assertFalse($account->hasInvoices()); } - public function test_get_reminders_for_month_returns_no_reminders() + /** @test */ + public function get_reminders_for_month_returns_no_reminders() { $user = $this->signIn(); @@ -450,7 +483,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_get_reminders_for_month_returns_reminders_for_given_month() + /** @test */ + public function get_reminders_for_month_returns_reminders_for_given_month() { $user = $this->signIn(); @@ -474,7 +508,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_it_gets_the_id_of_the_subscribed_plan() + /** @test */ + public function it_gets_the_id_of_the_subscribed_plan() { config([ 'monica.paid_plan_annual_friendly_name' => 'fakePlan', @@ -498,7 +533,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_it_gets_the_friendly_name_of_the_subscribed_plan() + /** @test */ + public function it_gets_the_friendly_name_of_the_subscribed_plan() { config([ 'monica.paid_plan_annual_friendly_name' => 'fakePlan', @@ -522,7 +558,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_it_populates_the_account_with_three_default_genders() + /** @test */ + public function it_populates_the_account_with_three_default_genders() { $account = factory(Account::class)->create(); $account->populateDefaultGendersTable(); @@ -533,7 +570,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_it_populates_the_account_with_the_right_default_genders() + /** @test */ + public function it_populates_the_account_with_the_right_default_genders() { $account = factory(Account::class)->create(); $account->populateDefaultGendersTable(); @@ -554,7 +592,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_it_replaces_gender_with_another_gender() + /** @test */ + public function it_replaces_gender_with_another_gender() { $account = factory(Account::class)->create(); $gender1 = factory(Gender::class)->create([ @@ -575,7 +614,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_it_gets_default_time_reminder_is_sent_attribute() + /** @test */ + public function it_gets_default_time_reminder_is_sent_attribute() { $account = factory(Account::class)->create(['default_time_reminder_is_sent' => '14:00']); @@ -585,7 +625,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_it_sets_default_time_reminder_is_sent_attribute() + /** @test */ + public function it_sets_default_time_reminder_is_sent_attribute() { $account = new Account; $account->default_time_reminder_is_sent = '14:00'; @@ -596,7 +637,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_it_populates_the_account_with_two_default_reminder_rules() + /** @test */ + public function it_populates_the_account_with_two_default_reminder_rules() { $account = factory(Account::class)->create(); $account->populateDefaultReminderRulesTable(); @@ -607,7 +649,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_it_populates_the_account_with_the_right_default_reminder_rules() + /** @test */ + public function it_populates_the_account_with_the_right_default_reminder_rules() { $account = factory(Account::class)->create(); $account->populateDefaultReminderRulesTable(); @@ -623,7 +666,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_it_gets_the_relationship_type_object_matching_a_given_name() + /** @test */ + public function it_gets_the_relationship_type_object_matching_a_given_name() { $account = factory(Account::class)->create(); $relationshipType = factory(RelationshipType::class)->create([ @@ -634,7 +678,8 @@ class AccountTest extends FeatureTestCase $this->assertInstanceOf(RelationshipType::class, $account->getRelationshipTypeByType('partner')); } - public function test_it_gets_the_relationship_type_group_object_matching_a_given_name() + /** @test */ + public function it_gets_the_relationship_type_group_object_matching_a_given_name() { $account = factory(Account::class)->create(); $relationshipTypeGroup = factory(RelationshipTypeGroup::class)->create([ @@ -645,7 +690,8 @@ class AccountTest extends FeatureTestCase $this->assertInstanceOf(RelationshipTypeGroup::class, $account->getRelationshipTypeGroupByType('love')); } - public function test_it_populates_default_relationship_type_groups_table_if_tables_havent_been_migrated_yet() + /** @test */ + public function it_populates_default_relationship_type_groups_table_if_tables_havent_been_migrated_yet() { $account = factory(Account::class)->create(); @@ -661,7 +707,8 @@ class AccountTest extends FeatureTestCase ]); } - public function test_it_skips_default_relationship_type_groups_table_for_types_already_migrated() + /** @test */ + public function it_skips_default_relationship_type_groups_table_for_types_already_migrated() { $account = factory(Account::class)->create(); $id = DB::table('default_relationship_type_groups')->insertGetId([ @@ -676,7 +723,8 @@ class AccountTest extends FeatureTestCase ]); } - public function test_it_populates_default_relationship_types_table_if_tables_havent_been_migrated_yet() + /** @test */ + public function it_populates_default_relationship_types_table_if_tables_havent_been_migrated_yet() { $account = factory(Account::class)->create(); $id = DB::table('default_relationship_type_groups')->insertGetId([ @@ -696,7 +744,8 @@ class AccountTest extends FeatureTestCase ]); } - public function test_it_skips_default_relationship_types_table_for_types_already_migrated() + /** @test */ + public function it_skips_default_relationship_types_table_for_types_already_migrated() { $account = factory(Account::class)->create(); $id = DB::table('default_relationship_type_groups')->insertGetId([ @@ -717,7 +766,8 @@ class AccountTest extends FeatureTestCase ]); } - public function test_it_retrieves_yearly_call_statistics() + /** @test */ + public function it_retrieves_yearly_call_statistics() { $contact = factory(Contact::class)->create(); $calls = factory(Call::class, 4)->create([ @@ -743,7 +793,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_it_retrieves_yearly_activities_statistics() + /** @test */ + public function it_retrieves_yearly_activities_statistics() { $account = factory(Account::class)->create(); $contact = factory(Activity::class, 4)->create([ @@ -767,7 +818,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_it_create_default_account() + /** @test */ + public function it_create_default_account() { $account = Account::createDefault('John', 'Doe', 'john@doe.com', 'password'); @@ -779,7 +831,8 @@ class AccountTest extends FeatureTestCase ]); } - public function test_it_throw_an_exception_if_user_already_exist() + /** @test */ + public function it_throw_an_exception_if_user_already_exist() { $account = Account::createDefault('John', 'Doe', 'john@doe.com', 'password'); @@ -794,7 +847,8 @@ class AccountTest extends FeatureTestCase $account = Account::createDefault('John', 'Doe', 'john@doe.com', 'password'); } - public function test_account_has_reached_contact_limit_on_free_plan() + /** @test */ + public function account_has_reached_contact_limit_on_free_plan() { $account = factory(Account::class)->create(); $contact = factory(Contact::class, 11)->create([ @@ -823,7 +877,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_it_gets_first_user_locale() + /** @test */ + public function it_gets_first_user_locale() { $account = factory(Account::class)->create(); $user = factory(User::class)->create([ @@ -841,20 +896,16 @@ class AccountTest extends FeatureTestCase ); } - public function test_getting_first_locale_returns_null_if_user_doesnt_exist() + /** @test */ + public function getting_first_locale_returns_null_if_user_doesnt_exist() { $account = factory(Account::class)->create(); $this->assertNull($account->getFirstLocale()); } - /** - * Test that default_life_event_categories and types are correctly - * populated. - * - * @return void - */ - public function test_it_populates_default_life_event_tables_upon_creation() + /** @test */ + public function it_populates_default_life_event_tables_upon_creation() { $account = factory(Account::class)->create(); $user = factory(User::class)->create([ @@ -874,7 +925,8 @@ class AccountTest extends FeatureTestCase ); } - public function test_it_tests_account_storage_limit() + /** @test */ + public function it_tests_account_storage_limit() { config(['monica.requires_subscription' => true]); $account = factory(Account::class)->create([]); @@ -905,7 +957,8 @@ class AccountTest extends FeatureTestCase $this->assertFalse($account->hasReachedAccountStorageLimit()); } - public function test_it_calculates_storage_size() + /** @test */ + public function it_calculates_storage_size() { $account = factory(Account::class)->create([]); diff --git a/tests/Unit/Models/ActivityTest.php b/tests/Unit/Models/ActivityTest.php index 442814e45..3cb33e303 100644 --- a/tests/Unit/Models/ActivityTest.php +++ b/tests/Unit/Models/ActivityTest.php @@ -12,7 +12,8 @@ class ActivityTest extends TestCase { use DatabaseTransactions; - public function test_it_returns_the_happened_at() + /** @test */ + public function it_returns_the_happened_at() { $activity = factory(Activity::class)->make(); @@ -22,7 +23,8 @@ class ActivityTest extends TestCase ); } - public function test_it_returns_a_title() + /** @test */ + public function it_returns_a_title() { $type = factory(ActivityType::class)->create(); @@ -36,7 +38,8 @@ class ActivityTest extends TestCase ); } - public function test_get_info_for_journal_entry() + /** @test */ + public function it_gets_info_for_journal_entry() { $activity = factory(Activity::class)->create(); diff --git a/tests/Unit/Models/ActivityTypeCategoryTest.php b/tests/Unit/Models/ActivityTypeCategoryTest.php index 4e7a4c7cf..9fb228cbc 100644 --- a/tests/Unit/Models/ActivityTypeCategoryTest.php +++ b/tests/Unit/Models/ActivityTypeCategoryTest.php @@ -11,14 +11,16 @@ class ActivityTypeCategoryTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $activityTypeCategory = factory(ActivityTypeCategory::class)->create([]); $this->assertTrue($activityTypeCategory->account()->exists()); } - public function test_it_has_many_activity_types() + /** @test */ + public function it_has_many_activity_types() { $activityTypeCategory = factory(ActivityTypeCategory::class)->create([]); $activityType = factory(ActivityType::class, 10)->create([ @@ -28,7 +30,8 @@ class ActivityTypeCategoryTest extends TestCase $this->assertTrue($activityTypeCategory->activityTypes()->exists()); } - public function test_it_gets_the_name_attribute() + /** @test */ + public function it_gets_the_name_attribute() { $activityTypeCategory = factory(ActivityTypeCategory::class)->create([ 'translation_key' => 'awesome_key', diff --git a/tests/Unit/Models/ActivityTypeTest.php b/tests/Unit/Models/ActivityTypeTest.php index 37c48facb..be190b486 100644 --- a/tests/Unit/Models/ActivityTypeTest.php +++ b/tests/Unit/Models/ActivityTypeTest.php @@ -12,21 +12,24 @@ class ActivityTypeTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $activityType = factory(ActivityType::class)->create([]); $this->assertTrue($activityType->account()->exists()); } - public function test_it_belongs_to_a_category() + /** @test */ + public function it_belongs_to_a_category() { $activityType = factory(ActivityType::class)->create([]); $this->assertTrue($activityType->category()->exists()); } - public function test_it_has_many_activities() + /** @test */ + public function it_has_many_activities() { $account = factory(Account::class)->create(); $activityType = factory(ActivityType::class)->create([ @@ -40,7 +43,8 @@ class ActivityTypeTest extends TestCase $this->assertTrue($account->activities()->exists()); } - public function test_it_gets_the_name_attribute() + /** @test */ + public function it_gets_the_name_attribute() { $activityType = factory(ActivityType::class)->create([ 'translation_key' => 'awesome_key', @@ -63,7 +67,8 @@ class ActivityTypeTest extends TestCase ); } - public function test_it_resets_the_associated_activities() + /** @test */ + public function it_resets_the_associated_activities() { $activityType = factory(ActivityType::class)->create([]); $activity = factory(Activity::class, 10)->create([ diff --git a/tests/Unit/Models/AddressTest.php b/tests/Unit/Models/AddressTest.php index 22994edc9..736d9fca2 100644 --- a/tests/Unit/Models/AddressTest.php +++ b/tests/Unit/Models/AddressTest.php @@ -10,19 +10,22 @@ class AddressTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $address = factory(Address::class)->create([]); $this->assertTrue($address->account()->exists()); } - public function test_it_belongs_to_a_contact() + /** @test */ + public function it_belongs_to_a_contact() { $address = factory(Address::class)->create([]); $this->assertTrue($address->contact()->exists()); } - public function test_it_belongs_to_a_place() + /** @test */ + public function it_belongs_to_a_place() { $address = factory(Address::class)->create([]); $this->assertTrue($address->place()->exists()); diff --git a/tests/Unit/Models/CallTest.php b/tests/Unit/Models/CallTest.php index 9eb1008cf..d2df370fa 100644 --- a/tests/Unit/Models/CallTest.php +++ b/tests/Unit/Models/CallTest.php @@ -10,14 +10,16 @@ class CallTest extends TestCase { use DatabaseTransactions; - public function test_call_note_returns_null_if_undefined() + /** @test */ + public function call_note_returns_null_if_undefined() { $call = new Call; $this->assertNull($call->getParsedContentAttribute()); } - public function test_call_note_returns_html_if_defined() + /** @test */ + public function call_note_returns_html_if_defined() { $call = new Call; $call->content = '### test'; diff --git a/tests/Unit/Models/CompanyTest.php b/tests/Unit/Models/CompanyTest.php index 56db1ef19..cfceb7c87 100644 --- a/tests/Unit/Models/CompanyTest.php +++ b/tests/Unit/Models/CompanyTest.php @@ -12,7 +12,8 @@ class CompanyTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $company = factory(Company::class)->create([ @@ -22,7 +23,8 @@ class CompanyTest extends TestCase $this->assertTrue($company->account()->exists()); } - public function test_it_has_many_occupations() + /** @test */ + public function it_has_many_occupations() { $company = factory(Company::class)->create([]); $occupations = factory(Occupation::class)->create([ diff --git a/tests/Unit/Models/ContactFieldTest.php b/tests/Unit/Models/ContactFieldTest.php index 5aa23d8af..328b949cc 100644 --- a/tests/Unit/Models/ContactFieldTest.php +++ b/tests/Unit/Models/ContactFieldTest.php @@ -10,7 +10,8 @@ class ContactFieldTest extends TestCase { use DatabaseTransactions; - public function test_it_fetches_data_field() + /** @test */ + public function it_fetches_data_field() { $contactField = new ContactField; $contactField->data = 'this is a test'; diff --git a/tests/Unit/Models/ContactFieldTypeTest.php b/tests/Unit/Models/ContactFieldTypeTest.php index 83cdf4eac..3c4647567 100644 --- a/tests/Unit/Models/ContactFieldTypeTest.php +++ b/tests/Unit/Models/ContactFieldTypeTest.php @@ -12,7 +12,8 @@ class ContactFieldTypeTest extends FeatureTestCase { use DatabaseTransactions; - public function test_it_has_many_conversations() + /** @test */ + public function it_has_many_conversations() { $contactFieldType = factory(ContactFieldType::class)->create([]); $conversation = factory(Conversation::class, 3)->create([ @@ -23,7 +24,8 @@ class ContactFieldTypeTest extends FeatureTestCase $this->assertTrue($contactFieldType->conversations()->exists()); } - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $contactFieldType = factory(ContactFieldType::class)->create([]); diff --git a/tests/Unit/Models/ContactTest.php b/tests/Unit/Models/ContactTest.php index f1210c607..85fdb2319 100644 --- a/tests/Unit/Models/ContactTest.php +++ b/tests/Unit/Models/ContactTest.php @@ -30,7 +30,8 @@ class ContactTest extends FeatureTestCase { use DatabaseTransactions; - public function test_it_belongs_to_a_gender() + /** @test */ + public function it_belongs_to_a_gender() { $account = factory(Account::class)->create([]); $gender = factory(Gender::class)->create([ @@ -42,7 +43,8 @@ class ContactTest extends FeatureTestCase $this->assertTrue($contact->gender()->exists()); } - public function test_it_has_many_relationships() + /** @test */ + public function it_has_many_relationships() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -54,7 +56,8 @@ class ContactTest extends FeatureTestCase $this->assertTrue($contact->relationships()->exists()); } - public function test_it_has_many_conversations() + /** @test */ + public function it_has_many_conversations() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -66,7 +69,8 @@ class ContactTest extends FeatureTestCase $this->assertTrue($contact->conversations()->exists()); } - public function test_it_has_many_messages() + /** @test */ + public function it_has_many_messages() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -78,7 +82,8 @@ class ContactTest extends FeatureTestCase $this->assertTrue($contact->messages()->exists()); } - public function test_it_has_many_documents() + /** @test */ + public function it_has_many_documents() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -90,7 +95,8 @@ class ContactTest extends FeatureTestCase $this->assertTrue($contact->documents()->exists()); } - public function test_it_has_many_photos() + /** @test */ + public function it_has_many_photos() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -103,7 +109,8 @@ class ContactTest extends FeatureTestCase $this->assertTrue($contact->photos()->exists()); } - public function test_it_has_many_life_events() + /** @test */ + public function it_has_many_life_events() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -114,7 +121,8 @@ class ContactTest extends FeatureTestCase $this->assertTrue($contact->lifeEvents()->exists()); } - public function test_it_has_many_occupations() + /** @test */ + public function it_has_many_occupations() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -125,25 +133,8 @@ class ContactTest extends FeatureTestCase $this->assertTrue($contact->occupations()->exists()); } - public function testGetFirstnameReturnsNullWhenUndefined() - { - $contact = new Contact; - - $this->assertNull($contact->first_name); - } - - public function testGetFirstnameReturnsNameWhenDefined() - { - $contact = new Contact; - $contact->first_name = 'Peter'; - - $this->assertEquals( - 'Peter', - $contact->first_name - ); - } - - public function test_it_gets_the_nickname() + /** @test */ + public function it_gets_the_nickname() { $contact = new Contact; $contact->nickname = 'Peter'; @@ -154,7 +145,8 @@ class ContactTest extends FeatureTestCase ); } - public function test_it_sets_the_nickname() + /** @test */ + public function it_sets_the_nickname() { $contact = new Contact; $contact->nickname = ' Peter '; @@ -165,7 +157,8 @@ class ContactTest extends FeatureTestCase ); } - public function test_name_attribute_returns_name_in_the_right_order() + /** @test */ + public function name_attribute_returns_name_in_the_right_order() { $contact = new Contact; $contact->first_name = 'Peter'; @@ -292,7 +285,8 @@ class ContactTest extends FeatureTestCase ); } - public function testGetInitialsWithAFullName() + /** @test */ + public function it_returns_the_initials() { $contact = new Contact; $contact->first_name = 'Peter'; @@ -303,10 +297,7 @@ class ContactTest extends FeatureTestCase 'PHG', $contact->getInitials() ); - } - public function testGetInitialsWithNoMiddleName() - { $contact = new Contact; $contact->first_name = 'Peter'; $contact->middle_name = null; @@ -316,10 +307,7 @@ class ContactTest extends FeatureTestCase 'PG', $contact->getInitials() ); - } - public function testGetInitialsWithNoLastName() - { $contact = new Contact; $contact->first_name = 'Peter'; $contact->middle_name = 'H'; @@ -329,10 +317,7 @@ class ContactTest extends FeatureTestCase 'PH', $contact->getInitials() ); - } - public function testGetInitialsWithNoMiddleAndLastNames() - { $contact = new Contact; $contact->first_name = 'Peter'; $contact->middle_name = null; @@ -344,7 +329,8 @@ class ContactTest extends FeatureTestCase ); } - public function test_get_initials_returns_order_thanks_to_user_preferences() + /** @test */ + public function get_initials_returns_order_thanks_to_user_preferences() { $contact = new Contact; $contact->first_name = 'Peter'; @@ -358,7 +344,8 @@ class ContactTest extends FeatureTestCase ); } - public function test_get_initials_with_special_chars() + /** @test */ + public function get_initials_with_special_chars() { $user = $this->signIn(); $user->locale = 'de'; @@ -376,7 +363,8 @@ class ContactTest extends FeatureTestCase ); } - public function testGetLastActivityDateWithMultipleActivities() + /** @test */ + public function it_returns_the_last_activity_date_for_multiple_activities() { $contact = factory(Contact::class)->create(); @@ -404,7 +392,8 @@ class ContactTest extends FeatureTestCase ); } - public function testGetLastActivityDateWithOneActivity() + /** @test */ + public function it_returns_the_last_activity_date_for_one_activity() { $contact = factory(Contact::class)->create(); @@ -420,7 +409,8 @@ class ContactTest extends FeatureTestCase ); } - public function testGetLastActivityDateWithNoActivities() + /** @test */ + public function it_returns_the_last_activity_date_for_no_activity() { $contact = new Contact; $contact->account_id = 1; @@ -432,29 +422,8 @@ class ContactTest extends FeatureTestCase ); } - public function testGetLastCalledWithNullData() - { - $contact = new Contact; - $contact->last_talked_to = null; - - $this->assertEquals( - null, - $contact->getLastCalled() - ); - } - - public function testGetLastCalledWithData() - { - $contact = new Contact; - $contact->last_talked_to = '2013-10-29 10:10:10'; - - $this->assertEquals( - '2013-10-29 10:10:10', - $contact->getLastCalled() - ); - } - - public function test_it_sets_a_default_avatar_color() + /** @test */ + public function it_sets_a_default_avatar_color() { $contact = factory(Contact::class)->create([]); $contact->setAvatarColor(); @@ -465,47 +434,8 @@ class ContactTest extends FeatureTestCase ); } - public function testGetGiftsOfferedReturns0WhenNoRemindersDefined() - { - $contact = new Contact; - - $this->assertEquals( - 0, - $contact->getGiftsOffered()->count() - ); - } - - public function testGetGiftIdeasReturns0WhenNoRemindersDefined() - { - $contact = new Contact; - - $this->assertEquals( - 0, - $contact->getGiftIdeas()->count() - ); - } - - public function testGetTasksInProgressReturns0WhenNoTasksDefined() - { - $contact = new Contact; - - $this->assertEquals( - 0, - $contact->getTasksInProgress()->count() - ); - } - - public function testGetCompletedReturns0WhenNoTasksDefined() - { - $contact = new Contact; - - $this->assertEquals( - 0, - $contact->getCompletedTasks()->count() - ); - } - - public function test_it_returns_the_url_of_the_avatar() + /** @test */ + public function it_returns_the_url_of_the_avatar() { // default $contact = factory(Contact::class)->create([ @@ -554,7 +484,8 @@ class ContactTest extends FeatureTestCase ); } - public function testHasDebt() + /** @test */ + public function it_indicates_that_it_has_not_debts() { $contact = new Contact; @@ -563,7 +494,8 @@ class ContactTest extends FeatureTestCase ); } - public function testIsOwedMoney() + /** @test */ + public function a_contact_is_owned_money() { /** @var Contact $contact */ $contact = factory(Contact::class)->create(); @@ -578,7 +510,8 @@ class ContactTest extends FeatureTestCase $this->assertTrue($contact->isOwedMoney()); } - public function testIsNotOwedMoney() + /** @test */ + public function a_contact_is_not_owned_money() { /** @var Contact $contact */ $contact = factory(Contact::class)->create(); @@ -593,7 +526,8 @@ class ContactTest extends FeatureTestCase $this->assertFalse($contact->isOwedMoney()); } - public function testTotalOutstandingDebtAmountIsCorrect() + /** @test */ + public function it_returns_the_amount_of_money_due() { /** @var Contact $contact */ $contact = factory(Contact::class)->create(); @@ -623,7 +557,8 @@ class ContactTest extends FeatureTestCase $this->assertEquals(100, $contact->totalOutstandingDebtAmount()); } - public function test_set_special_date_with_age_creates_a_date_and_saves_the_id() + /** @test */ + public function set_special_date_with_age_creates_a_date_and_saves_the_id() { $contact = factory(Contact::class)->create(); @@ -635,14 +570,16 @@ class ContactTest extends FeatureTestCase $this->assertNotNull($contact->birthday_special_date_id); } - public function test_has_first_met_information_returns_false_if_no_information_is_present() + /** @test */ + public function has_first_met_information_returns_false_if_no_information_is_present() { $contact = factory(Contact::class)->create(); $this->assertFalse($contact->hasFirstMetInformation()); } - public function test_has_first_met_information_returns_true_if_at_least_one_info_is_present() + /** @test */ + public function has_first_met_information_returns_true_if_at_least_one_info_is_present() { $contact = factory(Contact::class)->create(); @@ -650,7 +587,8 @@ class ContactTest extends FeatureTestCase $this->assertTrue($contact->hasFirstMetInformation()); } - public function test_it_returns_an_unknown_birthday_state() + /** @test */ + public function it_returns_an_unknown_birthday_state() { $contact = factory(Contact::class)->create(); @@ -660,7 +598,8 @@ class ContactTest extends FeatureTestCase ); } - public function test_it_returns_an_approximate_birthday_state() + /** @test */ + public function it_returns_an_approximate_birthday_state() { $contact = factory(Contact::class)->create(); $specialDate = factory(SpecialDate::class)->create([ @@ -678,7 +617,8 @@ class ContactTest extends FeatureTestCase ); } - public function test_it_returns_an_almost_birthday_state() + /** @test */ + public function it_returns_an_almost_birthday_state() { $contact = factory(Contact::class)->create(); $specialDate = factory(SpecialDate::class)->create([ @@ -697,7 +637,8 @@ class ContactTest extends FeatureTestCase ); } - public function test_it_returns_an_exact_birthday_state() + /** @test */ + public function it_returns_an_exact_birthday_state() { $contact = factory(Contact::class)->create(); $specialDate = factory(SpecialDate::class)->create(); @@ -713,14 +654,16 @@ class ContactTest extends FeatureTestCase ); } - public function test_set_name_returns_false_if_given_an_empty_firstname() + /** @test */ + public function set_name_returns_false_if_given_an_empty_firstname() { $contact = factory(Contact::class)->create(); $this->assertFalse($contact->setName('', 'Test', 'Test')); } - public function test_set_name_returns_true() + /** @test */ + public function set_name_returns_true() { $contact = factory(Contact::class)->create(); $this->assertTrue($contact->setName('John', 'Doe', 'Jr')); @@ -736,7 +679,8 @@ class ContactTest extends FeatureTestCase ); } - public function test_it_gets_related_relationships_of_a_certain_relationshiptype_group_name() + /** @test */ + public function it_gets_related_relationships_of_a_certain_relationshiptype_group_name() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -771,7 +715,8 @@ class ContactTest extends FeatureTestCase $this->assertNull($contact->getRelationshipsByRelationshipTypeGroup('love')); } - public function test_it_gets_the_right_number_of_birthdays_about_related_contacts() + /** @test */ + public function it_gets_the_right_number_of_birthdays_about_related_contacts() { $user = $this->signIn(); @@ -836,7 +781,8 @@ class ContactTest extends FeatureTestCase ); } - public function test_it_fetches_the_partial_contact_who_belongs_to_a_real_contact() + /** @test */ + public function it_fetches_the_partial_contact_who_belongs_to_a_real_contact() { $user = $this->signIn(); @@ -869,7 +815,8 @@ class ContactTest extends FeatureTestCase ); } - public function test_contact_deletion() + /** @test */ + public function it_deletes_everything_about_the_contact() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -883,7 +830,8 @@ class ContactTest extends FeatureTestCase $this->assertEquals(0, Contact::where('id', $id)->count()); } - public function test_it_updates_stay_in_touch_frequency() + /** @test */ + public function it_updates_stay_in_touch_frequency() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create([ @@ -901,7 +849,8 @@ class ContactTest extends FeatureTestCase ]); } - public function test_it_resets_stay_in_touch_frequency_if_set_to_0() + /** @test */ + public function it_resets_stay_in_touch_frequency_if_set_to_0() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create([ @@ -919,7 +868,8 @@ class ContactTest extends FeatureTestCase ]); } - public function test_it_returns_false_if_frequency_is_not_an_integer() + /** @test */ + public function it_returns_false_if_frequency_is_not_an_integer() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create([ @@ -931,7 +881,8 @@ class ContactTest extends FeatureTestCase $this->assertFalse($result); } - public function test_it_updates_the_stay_in_touch_trigger_date() + /** @test */ + public function it_updates_the_stay_in_touch_trigger_date() { Carbon::setTestNow(Carbon::create(2017, 1, 1)); @@ -967,7 +918,8 @@ class ContactTest extends FeatureTestCase $this->assertNull($contact->stay_in_touch_trigger_date); } - public function test_it_sends_the_stay_in_touch_email() + /** @test */ + public function it_sends_the_stay_in_touch_email() { config(['monica.requires_subscription' => false]); NotificationFacade::fake(); @@ -996,7 +948,8 @@ class ContactTest extends FeatureTestCase ); } - public function test_it_gets_the_age_at_death() + /** @test */ + public function it_gets_the_age_at_death() { $contact = factory(Contact::class)->create(); @@ -1009,7 +962,8 @@ class ContactTest extends FeatureTestCase ); } - public function test_getting_age_at_death_returns_null() + /** @test */ + public function getting_age_at_death_returns_null() { $contact = factory(Contact::class)->create(); @@ -1020,7 +974,8 @@ class ContactTest extends FeatureTestCase ); } - public function test_it_gets_the_default_avatar_url_attribute() + /** @test */ + public function it_gets_the_default_avatar_url_attribute() { $contact = factory(Contact::class)->create([ 'avatar_default_url' => 'avatars/image.jpg', diff --git a/tests/Unit/Models/ConversationTest.php b/tests/Unit/Models/ConversationTest.php index bace27c41..2e8029c28 100644 --- a/tests/Unit/Models/ConversationTest.php +++ b/tests/Unit/Models/ConversationTest.php @@ -14,7 +14,8 @@ class ConversationTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $conversation = factory(Conversation::class)->create([ @@ -24,7 +25,8 @@ class ConversationTest extends TestCase $this->assertTrue($conversation->account()->exists()); } - public function test_it_belongs_to_a_contact() + /** @test */ + public function it_belongs_to_a_contact() { $contact = factory(Contact::class)->create(); $conversation = factory(Conversation::class)->create([ @@ -34,7 +36,8 @@ class ConversationTest extends TestCase $this->assertTrue($conversation->contact()->exists()); } - public function test_it_belongs_to_a_contact_field_type() + /** @test */ + public function it_belongs_to_a_contact_field_type() { $account = factory(Account::class)->create([]); $contactFieldType = factory(ContactFieldType::class)->create([ @@ -48,7 +51,8 @@ class ConversationTest extends TestCase $this->assertTrue($conversation->contactFieldType()->exists()); } - public function test_it_has_many_messages() + /** @test */ + public function it_has_many_messages() { $conversation = factory(Conversation::class)->create(); $message = factory(Message::class)->create([ diff --git a/tests/Unit/Models/CountriesTest.php b/tests/Unit/Models/CountriesTest.php index 49c12024c..a6640ccae 100644 --- a/tests/Unit/Models/CountriesTest.php +++ b/tests/Unit/Models/CountriesTest.php @@ -12,7 +12,8 @@ class CountriesTest extends FeatureTestCase { use DatabaseTransactions; - public function test_all_countries_exist() + /** @test */ + public function all_countries_exist() { try { Schema::create('countries', function ($table) { diff --git a/tests/Unit/Models/DayTest.php b/tests/Unit/Models/DayTest.php index 939515a8b..b5481e2f0 100644 --- a/tests/Unit/Models/DayTest.php +++ b/tests/Unit/Models/DayTest.php @@ -10,7 +10,8 @@ class DayTest extends TestCase { use DatabaseTransactions; - public function test_get_info_for_journal_entry_that_doesnt_happen_today() + /** @test */ + public function get_info_for_journal_entry_that_doesnt_happen_today() { $day = factory(Day::class)->make(); $day->id = 1; @@ -39,7 +40,8 @@ class DayTest extends TestCase ); } - public function test_get_info_for_journal_entry_that_happen_today() + /** @test */ + public function get_info_for_journal_entry_that_happen_today() { $date = now(); diff --git a/tests/Unit/Models/DocumentTest.php b/tests/Unit/Models/DocumentTest.php index 03e6db2b0..43141bc4e 100644 --- a/tests/Unit/Models/DocumentTest.php +++ b/tests/Unit/Models/DocumentTest.php @@ -12,7 +12,8 @@ class DocumentTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $document = factory(Document::class)->create([ @@ -22,7 +23,8 @@ class DocumentTest extends TestCase $this->assertTrue($document->account()->exists()); } - public function test_it_belongs_to_a_contact() + /** @test */ + public function it_belongs_to_a_contact() { $contact = factory(Contact::class)->create(); $document = factory(Document::class)->create([ @@ -32,7 +34,8 @@ class DocumentTest extends TestCase $this->assertTrue($document->contact()->exists()); } - public function test_it_gets_the_download_link() + /** @test */ + public function it_gets_the_download_link() { $document = factory(Document::class)->create(); diff --git a/tests/Unit/Models/EmotionTest.php b/tests/Unit/Models/EmotionTest.php index 3519ca736..fe6d9daf8 100644 --- a/tests/Unit/Models/EmotionTest.php +++ b/tests/Unit/Models/EmotionTest.php @@ -12,7 +12,8 @@ class EmotionTest extends TestCase { use DatabaseTransactions; - public function test_emotion_belongs_to_a_primary_emotion() + /** @test */ + public function emotion_belongs_to_a_primary_emotion() { $emotion = factory(Emotion::class)->create([]); @@ -21,14 +22,16 @@ class EmotionTest extends TestCase $this->assertTrue($emotion->secondary->exists()); } - public function test_secondary_emotion_belongs_to_a_primary_emotion() + /** @test */ + public function secondary_emotion_belongs_to_a_primary_emotion() { $secondaryEmotion = factory(SecondaryEmotion::class)->create([]); $this->assertTrue($secondaryEmotion->primary->exists()); } - public function test_a_primary_emotion_has_multiple_emotions() + /** @test */ + public function a_primary_emotion_has_multiple_emotions() { $primaryEmotion = factory(PrimaryEmotion::class)->create([]); $secondaryEmotion = factory(SecondaryEmotion::class)->create([ diff --git a/tests/Unit/Models/EntryTest.php b/tests/Unit/Models/EntryTest.php index f0450e39d..9dcda474b 100644 --- a/tests/Unit/Models/EntryTest.php +++ b/tests/Unit/Models/EntryTest.php @@ -10,7 +10,8 @@ class EntryTest extends TestCase { use DatabaseTransactions; - public function test_get_info_for_journal_entry() + /** @test */ + public function get_info_for_journal_entry() { $entry = factory(Entry::class)->make([ 'id' => 1, diff --git a/tests/Unit/Models/GenderTest.php b/tests/Unit/Models/GenderTest.php index 8b8c146e5..de48cc739 100644 --- a/tests/Unit/Models/GenderTest.php +++ b/tests/Unit/Models/GenderTest.php @@ -12,7 +12,8 @@ class GenderTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $gender = factory(Gender::class)->create([ @@ -22,7 +23,8 @@ class GenderTest extends TestCase $this->assertTrue($gender->account()->exists()); } - public function test_it_belongs_to_many_contacts() + /** @test */ + public function it_belongs_to_many_contacts() { $account = factory(Account::class)->create([]); $gender = factory(Gender::class)->create([ @@ -34,7 +36,8 @@ class GenderTest extends TestCase $this->assertTrue($gender->contacts()->exists()); } - public function test_it_gets_the_gender_name() + /** @test */ + public function it_gets_the_gender_name() { $gender = new Gender; $gender->name = 'Woman'; @@ -45,7 +48,8 @@ class GenderTest extends TestCase ); } - public function test_it_gets_the_default_gender() + /** @test */ + public function it_gets_the_default_gender() { $account = factory(Account::class)->create(); $gender = Gender::create([ diff --git a/tests/Unit/Models/GiftTest.php b/tests/Unit/Models/GiftTest.php index 8f238d1d6..711a62703 100644 --- a/tests/Unit/Models/GiftTest.php +++ b/tests/Unit/Models/GiftTest.php @@ -11,7 +11,8 @@ class GiftTest extends TestCase { use DatabaseTransactions; - public function test_toggle_a_gift_idea() + /** @test */ + public function toggle_a_gift_idea() { $gift = factory(Gift::class)->make(); $gift->is_an_idea = true; @@ -33,7 +34,8 @@ class GiftTest extends TestCase ); } - public function test_toggle_a_gift_offered() + /** @test */ + public function toggle_a_gift_offered() { $gift = factory(Gift::class)->make(); $gift->has_been_offered = true; @@ -55,7 +57,8 @@ class GiftTest extends TestCase ); } - public function test_has_particular_recipient_returns_false_if_it_s_for_no_specific_recipient() + /** @test */ + public function has_particular_recipient_returns_false_if_it_s_for_no_specific_recipient() { $gift = factory(Gift::class)->make(); @@ -65,7 +68,8 @@ class GiftTest extends TestCase ); } - public function test_has_particular_recipient_returns_true_if_it_s_for_a_specific_recipient() + /** @test */ + public function has_particular_recipient_returns_true_if_it_s_for_a_specific_recipient() { $gift = factory(Gift::class)->make(); $gift->is_for = 1; @@ -76,7 +80,8 @@ class GiftTest extends TestCase ); } - public function test_it_sets_is_for_attribute() + /** @test */ + public function it_sets_is_for_attribute() { $gift = factory(Gift::class)->make(); $gift->is_for = 1; @@ -87,7 +92,8 @@ class GiftTest extends TestCase ); } - public function test_it_gets_the_recipient_name() + /** @test */ + public function it_gets_the_recipient_name() { $gift = factory(Gift::class)->make(); $gift->is_for = 1; @@ -101,7 +107,8 @@ class GiftTest extends TestCase ); } - public function test_it_gets_the_gift_name() + /** @test */ + public function it_gets_the_gift_name() { $gift = factory(Gift::class)->make(); $gift->name = 'Maison de folie'; @@ -112,7 +119,8 @@ class GiftTest extends TestCase ); } - public function test_it_gets_the_gift_url() + /** @test */ + public function it_gets_the_gift_url() { $gift = factory(Gift::class)->make(); $gift->url = 'https://facebook.com'; @@ -123,7 +131,8 @@ class GiftTest extends TestCase ); } - public function test_it_gets_the_comment() + /** @test */ + public function it_gets_the_comment() { $gift = factory(Gift::class)->make(); $gift->comment = 'This is just a comment'; @@ -134,7 +143,8 @@ class GiftTest extends TestCase ); } - public function test_it_gets_the_value() + /** @test */ + public function it_gets_the_value() { $gift = factory(Gift::class)->make(); $gift->value = '100$'; diff --git a/tests/Unit/Models/Google2FATest.php b/tests/Unit/Models/Google2FATest.php index 000935e3a..c35a6dbc5 100644 --- a/tests/Unit/Models/Google2FATest.php +++ b/tests/Unit/Models/Google2FATest.php @@ -13,12 +13,8 @@ class Google2FATest extends TestCase { use DatabaseTransactions; - /** - * A basic test example. - * - * @return void - */ - public function testGoogle2faWrongKey() + /** @test */ + public function it_tests_a_wrong_key_for_Google2fa() { $google2fa = app('pragmarx.google2fa'); @@ -29,12 +25,8 @@ class Google2FATest extends TestCase $this->assertEquals(false, $result); } - /** - * A basic test example. - * - * @return void - */ - public function testGoogle2faGoodKey() + /** @test */ + public function it_tests_a_correct_key_for_Google2fa() { $google2fa = app('pragmarx.google2fa'); @@ -46,12 +38,8 @@ class Google2FATest extends TestCase $this->assertEquals(true, $result); } - /** - * A basic test example. - * - * @return void - */ - public function testGoogle2faLogin() + /** @test */ + public function it_logs_in_with_Google2Fa() { config(['google2fa.enabled' => true]); diff --git a/tests/Unit/Models/IdHasherTest.php b/tests/Unit/Models/IdHasherTest.php index 6634ee2fa..ed2b9a501 100644 --- a/tests/Unit/Models/IdHasherTest.php +++ b/tests/Unit/Models/IdHasherTest.php @@ -11,7 +11,8 @@ class IdHasherTest extends TestCase { use DatabaseTransactions; - public function testPrependH() + /** @test */ + public function it_prepends_the_id_with_the_letter_h() { $idHasher = new IdHasher(); @@ -24,7 +25,8 @@ class IdHasherTest extends TestCase $this->assertEquals('h', $value); } - public function testGetIDback() + /** @test */ + public function it_returns_the_id_back() { $idHasher = new IdHasher(); @@ -37,7 +39,8 @@ class IdHasherTest extends TestCase $this->assertEquals($test_id, $result_id); } - public function test_bad_id_get_exception() + /** @test */ + public function it_gets_an_exception_when_the_id_is_not_valid() { $idHasher = new IdHasher(); @@ -48,7 +51,8 @@ class IdHasherTest extends TestCase $idHasher->decodeId($test_id); } - public function testHashIDContact() + /** @test */ + public function it_decodes_the_hash_and_returns_the_right_id() { $idHasher = new IdHasher(); diff --git a/tests/Unit/Models/ImportJobTest.php b/tests/Unit/Models/ImportJobTest.php index 44624591a..d46377ce0 100644 --- a/tests/Unit/Models/ImportJobTest.php +++ b/tests/Unit/Models/ImportJobTest.php @@ -44,14 +44,16 @@ ADR:;;17 Shakespeare Ave.;Southampton;;SO17 2HB;United Kingdom END:VCARD '; - public function test_it_belongs_to_a_user() + /** @test */ + public function it_belongs_to_a_user() { $importJob = factory(ImportJob::class)->create(); $this->assertTrue($importJob->user()->exists()); } - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $user = factory(User::class)->create([ @@ -65,7 +67,8 @@ END:VCARD $this->assertTrue($importJob->account()->exists()); } - public function test_it_belongs_to_many_reports() + /** @test */ + public function it_belongs_to_many_reports() { $account = factory(Account::class)->create([]); $user = factory(User::class)->create([ @@ -84,7 +87,8 @@ END:VCARD $this->assertTrue($importJob->importJobReports()->exists()); } - public function test_it_initiates_the_job() + /** @test */ + public function it_initiates_the_job() { $importJob = factory(ImportJob::class)->make([]); @@ -95,7 +99,8 @@ END:VCARD $this->assertNotNull($importJob->started_at); } - public function test_it_finalizes_the_job() + /** @test */ + public function it_finalizes_the_job() { $importJob = factory(ImportJob::class)->make([]); @@ -106,7 +111,8 @@ END:VCARD $this->assertNotNull($importJob->ended_at); } - public function test_it_fails_and_throws_an_exception() + /** @test */ + public function it_fails_and_throws_an_exception() { $importJob = factory(ImportJob::class)->create([]); $this->invokePrivateMethod($importJob, 'fail', [ @@ -120,7 +126,8 @@ END:VCARD ); } - public function test_it_gets_the_physical_file() + /** @test */ + public function it_gets_the_physical_file() { Storage::fake('public'); $importJob = factory(ImportJob::class)->create([ @@ -143,7 +150,8 @@ END:VCARD ); } - public function test_it_throws_an_exception_if_file_doesnt_exist() + /** @test */ + public function it_throws_an_exception_if_file_doesnt_exist() { Storage::fake('public'); $importJob = factory(ImportJob::class)->create([ @@ -158,7 +166,8 @@ END:VCARD ); } - public function test_it_deletes_the_file() + /** @test */ + public function it_deletes_the_file() { Storage::fake('public'); $importJob = factory(ImportJob::class)->create([ @@ -175,7 +184,8 @@ END:VCARD Storage::disk('public')->assertMissing($importJob->filename); } - public function test_it_throws_an_exception_if_file_cant_be_deleted() + /** @test */ + public function it_throws_an_exception_if_file_cant_be_deleted() { Storage::fake('public'); $importJob = factory(ImportJob::class)->create([ @@ -189,7 +199,8 @@ END:VCARD ); } - public function test_it_calculates_how_many_entries_there_are_and_populate_the_entries_array() + /** @test */ + public function it_calculates_how_many_entries_there_are_and_populate_the_entries_array() { Storage::fake('public'); $importJob = $this->createImportJob(); @@ -211,7 +222,8 @@ END:VCARD ); } - public function test_it_doesnt_process_an_entry_if_import_is_not_feasible() + /** @test */ + public function it_doesnt_process_an_entry_if_import_is_not_feasible() { $importJob = $this->createImportJob(); @@ -229,7 +241,8 @@ END:VCARD ); } - public function test_it_doesnt_process_an_entry_if_contact_already_exists() + /** @test */ + public function it_doesnt_process_an_entry_if_contact_already_exists() { $importJob = $this->createImportJob(); $contact = factory(Contact::class)->create([ @@ -259,7 +272,8 @@ END:VCARD ); } - public function test_skipping_entries_increments_counter_and_file_job_report() + /** @test */ + public function skipping_entries_increments_counter_and_file_job_report() { $importJob = $this->createImportJob(); @@ -278,7 +292,8 @@ END:VCARD ]); } - public function test_it_files_an_import_job_report() + /** @test */ + public function it_files_an_import_job_report() { $importJob = $this->createImportJob(); $vcard = new VCard([ diff --git a/tests/Unit/Models/JournalEntryTest.php b/tests/Unit/Models/JournalEntryTest.php index 973960239..27302536c 100644 --- a/tests/Unit/Models/JournalEntryTest.php +++ b/tests/Unit/Models/JournalEntryTest.php @@ -14,7 +14,8 @@ class JournalEntryTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $task = factory(JournalEntry::class)->create([ @@ -24,7 +25,8 @@ class JournalEntryTest extends TestCase $this->assertTrue($task->account()->exists()); } - public function test_it_has_polymorphic_relations() + /** @test */ + public function it_has_polymorphic_relations() { $activity = factory(Activity::class)->create(); $journalEntry = JournalEntry::add($activity); @@ -36,7 +38,8 @@ class JournalEntryTest extends TestCase $this->assertEquals($journalEntry->id, $activity->journalEntry->id); } - public function test_it_has_polymorphic_relations2() + /** @test */ + public function it_has_polymorphic_relations2() { $entry = factory(Entry::class)->create(); $entry->date = '2018-01-01'; @@ -49,7 +52,8 @@ class JournalEntryTest extends TestCase $this->assertEquals($journalEntry->id, $entry->journalEntry->id); } - public function test_get_add_adds_data_of_the_right_type() + /** @test */ + public function get_add_adds_data_of_the_right_type() { $activity = factory(Activity::class)->create(); $date = $activity->happened_at; @@ -64,7 +68,8 @@ class JournalEntryTest extends TestCase ]); } - public function test_get_object_data_returns_an_object() + /** @test */ + public function get_object_data_returns_an_object() { $activity = factory(Activity::class)->create(); @@ -90,7 +95,8 @@ class JournalEntryTest extends TestCase ); } - public function test_get_edit_journal_entry() + /** @test */ + public function get_edit_journal_entry() { Carbon::setTestNow(Carbon::create(2017, 1, 1, 0, 0, 0)); diff --git a/tests/Unit/Models/LIfeEventTypeTest.php b/tests/Unit/Models/LIfeEventTypeTest.php index e6940411e..a39f0c8f2 100644 --- a/tests/Unit/Models/LIfeEventTypeTest.php +++ b/tests/Unit/Models/LIfeEventTypeTest.php @@ -13,21 +13,24 @@ class LIfeEventTypeTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $lifeEventType = factory(LifeEventType::class)->create([]); $this->assertTrue($lifeEventType->account()->exists()); } - public function test_it_belongs_to_a_category() + /** @test */ + public function it_belongs_to_a_category() { $lifeEventType = factory(LifeEventType::class)->create([]); $this->assertTrue($lifeEventType->lifeEventCategory()->exists()); } - public function test_it_has_many_life_events() + /** @test */ + public function it_has_many_life_events() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -41,7 +44,8 @@ class LIfeEventTypeTest extends TestCase $this->assertTrue($lifeEventType->lifeEvents()->exists()); } - public function test_it_gets_the_name_attribute() + /** @test */ + public function it_gets_the_name_attribute() { $lifeEventType = factory(LifeEventType::class)->create([ 'name' => 'Fake name', diff --git a/tests/Unit/Models/LifeEventCategoryTest.php b/tests/Unit/Models/LifeEventCategoryTest.php index 9ddf76b04..5c375db4b 100644 --- a/tests/Unit/Models/LifeEventCategoryTest.php +++ b/tests/Unit/Models/LifeEventCategoryTest.php @@ -12,7 +12,8 @@ class LifeEventCategoryTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $lifeEventCategory = factory(LifeEventCategory::class)->create([ @@ -22,17 +23,19 @@ class LifeEventCategoryTest extends TestCase $this->assertTrue($lifeEventCategory->account()->exists()); } - public function test_it_has_many_life_event_types() + /** @test */ + public function it_has_many_life_event_types() { $lifeEventCategory = factory(LifeEventCategory::class)->create(); - $lifeEventType = factory(LifeEventType::class)->create([ + factory(LifeEventType::class)->create([ 'life_event_category_id' => $lifeEventCategory->id, ]); $this->assertTrue($lifeEventCategory->lifeEventTypes()->exists()); } - public function test_it_gets_name_attribute() + /** @test */ + public function it_gets_name_attribute() { $lifeEventCategory = factory(LifeEventCategory::class)->create([ 'name' => 'Fake name', diff --git a/tests/Unit/Models/LifeEventTest.php b/tests/Unit/Models/LifeEventTest.php index 0f3528ae4..08e76208a 100644 --- a/tests/Unit/Models/LifeEventTest.php +++ b/tests/Unit/Models/LifeEventTest.php @@ -11,28 +11,32 @@ class LifeEventTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $lifeEvent = factory(LifeEvent::class)->create([]); $this->assertTrue($lifeEvent->account()->exists()); } - public function test_it_belongs_to_a_contact() + /** @test */ + public function it_belongs_to_a_contact() { $lifeEvent = factory(LifeEvent::class)->create([]); $this->assertTrue($lifeEvent->contact()->exists()); } - public function test_it_belongs_to_a_type() + /** @test */ + public function it_belongs_to_a_type() { $lifeEvent = factory(LifeEvent::class)->create([]); $this->assertTrue($lifeEvent->lifeEventType()->exists()); } - public function test_it_has_a_reminder() + /** @test */ + public function it_has_a_reminder() { $lifeEvent = factory(LifeEvent::class)->create([]); $reminder = factory(Reminder::class)->create([ @@ -44,7 +48,8 @@ class LifeEventTest extends TestCase $this->assertTrue($lifeEvent->reminder()->exists()); } - public function test_it_gets_the_name_attribute() + /** @test */ + public function it_gets_the_name_attribute() { $lifeEvent = factory(LifeEvent::class)->create([ 'name' => 'Fake name', @@ -56,7 +61,8 @@ class LifeEventTest extends TestCase ); } - public function test_it_gets_the_note_attribute() + /** @test */ + public function it_gets_the_note_attribute() { $lifeEvent = factory(LifeEvent::class)->create([ 'note' => 'Fake note', diff --git a/tests/Unit/Models/MessageTest.php b/tests/Unit/Models/MessageTest.php index cd410c179..cc76ce659 100644 --- a/tests/Unit/Models/MessageTest.php +++ b/tests/Unit/Models/MessageTest.php @@ -13,7 +13,8 @@ class MessageTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $message = factory(Message::class)->create([ @@ -23,7 +24,8 @@ class MessageTest extends TestCase $this->assertTrue($message->account()->exists()); } - public function test_it_belongs_to_a_contact() + /** @test */ + public function it_belongs_to_a_contact() { $contact = factory(Contact::class)->create(); $message = factory(Message::class)->create([ @@ -33,7 +35,8 @@ class MessageTest extends TestCase $this->assertTrue($message->contact()->exists()); } - public function test_it_belongs_to_a_conversation() + /** @test */ + public function it_belongs_to_a_conversation() { $conversation = factory(Conversation::class)->create(); $message = factory(Message::class)->create([ @@ -43,7 +46,8 @@ class MessageTest extends TestCase $this->assertTrue($message->conversation()->exists()); } - public function test_it_gets_the_content_attribute() + /** @test */ + public function it_gets_the_content_attribute() { $message = factory(Message::class)->create([ 'content' => 'This is a text', diff --git a/tests/Unit/Models/NoteTest.php b/tests/Unit/Models/NoteTest.php index 97387fbd7..f5886c85c 100644 --- a/tests/Unit/Models/NoteTest.php +++ b/tests/Unit/Models/NoteTest.php @@ -12,7 +12,8 @@ class NoteTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -24,7 +25,8 @@ class NoteTest extends TestCase $this->assertTrue($note->account()->exists()); } - public function test_it_belongs_to_a_contact() + /** @test */ + public function it_belongs_to_a_contact() { $contact = factory(Contact::class)->create([]); $note = factory(Note::class)->create([ @@ -34,7 +36,8 @@ class NoteTest extends TestCase $this->assertTrue($note->contact()->exists()); } - public function test_it_filters_by_favorited_notes() + /** @test */ + public function it_filters_by_favorited_notes() { $note = factory(Note::class)->create(['is_favorited' => true]); $note = factory(Note::class)->create(['is_favorited' => true]); @@ -47,7 +50,8 @@ class NoteTest extends TestCase ); } - public function test_it_returns_body_in_markdown() + /** @test */ + public function it_returns_body_in_markdown() { $note = new Note; $note->body = '# Test'; diff --git a/tests/Unit/Models/OccupationTest.php b/tests/Unit/Models/OccupationTest.php index 4eb53a7e5..b480bea43 100644 --- a/tests/Unit/Models/OccupationTest.php +++ b/tests/Unit/Models/OccupationTest.php @@ -13,7 +13,8 @@ class OccupationTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $occupation = factory(Occupation::class)->create([ @@ -23,7 +24,8 @@ class OccupationTest extends TestCase $this->assertTrue($occupation->account()->exists()); } - public function test_it_belongs_to_a_contact() + /** @test */ + public function it_belongs_to_a_contact() { $contact = factory(Contact::class)->create([]); $occupation = factory(Occupation::class)->create([ @@ -32,7 +34,8 @@ class OccupationTest extends TestCase $this->assertTrue($occupation->contact()->exists()); } - public function test_it_belongs_to_a_company() + /** @test */ + public function it_belongs_to_a_company() { $company = factory(Company::class)->create([]); $occupation = factory(Occupation::class)->create([ diff --git a/tests/Unit/Models/PetCategoryTest.php b/tests/Unit/Models/PetCategoryTest.php index a7e6da962..7a3bd1b82 100644 --- a/tests/Unit/Models/PetCategoryTest.php +++ b/tests/Unit/Models/PetCategoryTest.php @@ -10,7 +10,8 @@ class PetCategoryTest extends TestCase { use DatabaseTransactions; - public function test_it_gets_only_common_pets() + /** @test */ + public function it_gets_only_common_pets() { $petCategory = new PetCategory; @@ -20,7 +21,8 @@ class PetCategoryTest extends TestCase ); } - public function test_it_gets_pet_category_name() + /** @test */ + public function it_gets_pet_category_name() { $petCategory = new PetCategory; $petCategory->name = 'Rgis'; diff --git a/tests/Unit/Models/PetTest.php b/tests/Unit/Models/PetTest.php index bdda676b2..ae4c16c8c 100644 --- a/tests/Unit/Models/PetTest.php +++ b/tests/Unit/Models/PetTest.php @@ -13,7 +13,8 @@ class PetTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -25,7 +26,8 @@ class PetTest extends TestCase $this->assertTrue($pet->account()->exists()); } - public function test_it_belongs_to_a_contact() + /** @test */ + public function it_belongs_to_a_contact() { $contact = factory(Contact::class)->create([]); $pet = factory(Pet::class)->create([ @@ -36,7 +38,8 @@ class PetTest extends TestCase $this->assertTrue($pet->contact()->exists()); } - public function test_it_belongs_to_a_pet_category() + /** @test */ + public function it_belongs_to_a_pet_category() { $petCategory = factory(PetCategory::class)->create([]); $pet = factory(Pet::class)->create([ @@ -46,7 +49,8 @@ class PetTest extends TestCase $this->assertTrue($pet->petCategory()->exists()); } - public function test_it_sets_name() + /** @test */ + public function it_sets_name() { $pet = new Pet; $this->assertNull($pet->name); diff --git a/tests/Unit/Models/PhotoTest.php b/tests/Unit/Models/PhotoTest.php index 0a0ba70d0..6d033e955 100644 --- a/tests/Unit/Models/PhotoTest.php +++ b/tests/Unit/Models/PhotoTest.php @@ -12,7 +12,8 @@ class PhotoTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $photo = factory(Photo::class)->create([ @@ -21,7 +22,8 @@ class PhotoTest extends TestCase $this->assertTrue($photo->account()->exists()); } - public function test_it_belongs_to_many_contacts() + /** @test */ + public function it_belongs_to_many_contacts() { $contact = factory(Contact::class)->create(); $photo = factory(Photo::class)->create(); @@ -33,7 +35,8 @@ class PhotoTest extends TestCase $this->assertTrue($photo->contacts()->exists()); } - public function test_it_gets_the_url() + /** @test */ + public function it_gets_the_url() { $photo = factory(Photo::class)->create(); $this->assertEquals( diff --git a/tests/Unit/Models/PlaceTest.php b/tests/Unit/Models/PlaceTest.php index 38518ecd0..4ba74ba36 100644 --- a/tests/Unit/Models/PlaceTest.php +++ b/tests/Unit/Models/PlaceTest.php @@ -11,19 +11,22 @@ class PlaceTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $place = factory(Place::class)->create([]); $this->assertTrue($place->account()->exists()); } - public function test_it_has_many_weathers() + /** @test */ + public function it_has_many_weathers() { $weather = factory(Weather::class)->create([]); $this->assertTrue($weather->place->weathers()->exists()); } - public function test_it_returns_the_full_address_as_a_string() + /** @test */ + public function it_returns_the_full_address_as_a_string() { $place = factory(Place::class)->create([]); $this->assertEquals( @@ -32,7 +35,8 @@ class PlaceTest extends TestCase ); } - public function test_it_returns_country_name() + /** @test */ + public function it_returns_country_name() { $place = factory(Place::class)->create([]); $this->assertEquals( @@ -41,7 +45,8 @@ class PlaceTest extends TestCase ); } - public function test_it_returns_a_link_to_google_maps() + /** @test */ + public function it_returns_a_link_to_google_maps() { $place = factory(Place::class)->create([]); @@ -51,7 +56,8 @@ class PlaceTest extends TestCase ); } - public function test_it_returns_a_google_map_url_with_latitude_longitude() + /** @test */ + public function it_returns_a_google_map_url_with_latitude_longitude() { $place = new Place; $place->latitude = 24.197611; diff --git a/tests/Unit/Models/RelationshipTest.php b/tests/Unit/Models/RelationshipTest.php index fd25f8a64..ddb55846f 100644 --- a/tests/Unit/Models/RelationshipTest.php +++ b/tests/Unit/Models/RelationshipTest.php @@ -13,7 +13,8 @@ class RelationshipTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $relationship = factory(Relationship::class)->create([ @@ -23,7 +24,8 @@ class RelationshipTest extends TestCase $this->assertTrue($relationship->account()->exists()); } - public function test_it_belongs_to_a_contact() + /** @test */ + public function it_belongs_to_a_contact() { $contact = factory(Contact::class)->create([]); $relationship = factory(Relationship::class)->create([ @@ -33,7 +35,8 @@ class RelationshipTest extends TestCase $this->assertTrue($relationship->contactIs()->exists()); } - public function test_it_belongs_to_another_contact() + /** @test */ + public function it_belongs_to_another_contact() { $contact = factory(Contact::class)->create([]); $relationship = factory(Relationship::class)->create([ @@ -43,7 +46,8 @@ class RelationshipTest extends TestCase $this->assertTrue($relationship->ofContact()->exists()); } - public function test_it_belongs_to_a_relationship_type() + /** @test */ + public function it_belongs_to_a_relationship_type() { $account = factory(Account::class)->create([]); $relationshipType = factory(RelationshipType::class)->create([ @@ -57,7 +61,8 @@ class RelationshipTest extends TestCase $this->assertTrue($relationship->relationshipType()->exists()); } - public function test_it_belongs_to_a_contact_through_with_contact_field() + /** @test */ + public function it_belongs_to_a_contact_through_with_contact_field() { $contact = factory(Contact::class)->create([]); $relationship = factory(Relationship::class)->create([ @@ -67,7 +72,8 @@ class RelationshipTest extends TestCase $this->assertTrue($relationship->ofContact()->exists()); } - public function test_it_gets_the_reverse_relationship() + /** @test */ + public function it_gets_the_reverse_relationship() { $account = factory(Account::class)->create(); $contactA = factory(Contact::class)->create([ @@ -112,7 +118,8 @@ class RelationshipTest extends TestCase ); } - public function test_it_not_gets_the_reverse_relationship() + /** @test */ + public function it_not_gets_the_reverse_relationship() { $account = factory(Account::class)->create(); $contactA = factory(Contact::class)->create([ diff --git a/tests/Unit/Models/RelationshipTypeGroupTest.php b/tests/Unit/Models/RelationshipTypeGroupTest.php index 45c6153df..3b16fdb76 100644 --- a/tests/Unit/Models/RelationshipTypeGroupTest.php +++ b/tests/Unit/Models/RelationshipTypeGroupTest.php @@ -11,7 +11,8 @@ class RelationshipTypeGroupTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $relationshipType = factory(RelationshipType::class)->create([ diff --git a/tests/Unit/Models/RelationshipTypeTest.php b/tests/Unit/Models/RelationshipTypeTest.php index 7bc307771..770974c5b 100644 --- a/tests/Unit/Models/RelationshipTypeTest.php +++ b/tests/Unit/Models/RelationshipTypeTest.php @@ -13,7 +13,8 @@ class RelationshipTypeTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $relationshipType = factory(RelationshipType::class)->create([ @@ -23,7 +24,8 @@ class RelationshipTypeTest extends TestCase $this->assertTrue($relationshipType->account()->exists()); } - public function test_it_belongs_to_an_relationship_type_group() + /** @test */ + public function it_belongs_to_an_relationship_type_group() { $account = factory(Account::class)->create([]); $relationshipTypeGroup = factory(RelationshipTypeGroup::class)->create([ @@ -33,7 +35,8 @@ class RelationshipTypeTest extends TestCase $this->assertTrue($relationshipTypeGroup->account()->exists()); } - public function test_it_gets_the_masculine_short_name_of_the_relationship_type() + /** @test */ + public function it_gets_the_masculine_short_name_of_the_relationship_type() { $account = factory(Account::class)->create([]); $relationshipType = factory(RelationshipType::class)->create([ @@ -48,7 +51,8 @@ class RelationshipTypeTest extends TestCase ); } - public function test_it_gets_the_feminine_short_name_of_the_relationship_type() + /** @test */ + public function it_gets_the_feminine_short_name_of_the_relationship_type() { $account = factory(Account::class)->create([]); $relationshipType = factory(RelationshipType::class)->create([ @@ -63,7 +67,8 @@ class RelationshipTypeTest extends TestCase ); } - public function test_it_gets_the_masculine_name_of_the_relationship_type_with_the_name_of_the_contact() + /** @test */ + public function it_gets_the_masculine_name_of_the_relationship_type_with_the_name_of_the_contact() { $account = factory(Account::class)->create([]); $relationshipType = factory(RelationshipType::class)->create([ @@ -83,7 +88,8 @@ class RelationshipTypeTest extends TestCase ); } - public function test_it_gets_the_feminine_name_of_the_relationship_type_with_the_name_of_the_contact() + /** @test */ + public function it_gets_the_feminine_name_of_the_relationship_type_with_the_name_of_the_contact() { $account = factory(Account::class)->create([]); $relationshipType = factory(RelationshipType::class)->create([ @@ -103,7 +109,8 @@ class RelationshipTypeTest extends TestCase ); } - public function test_it_gets_both_names_of_the_relationship_type_with_the_name_of_the_contact_and_the_opposite_version() + /** @test */ + public function it_gets_both_names_of_the_relationship_type_with_the_name_of_the_contact_and_the_opposite_version() { $account = factory(Account::class)->create([]); $relationshipType = factory(RelationshipType::class)->create([ @@ -123,7 +130,8 @@ class RelationshipTypeTest extends TestCase ); } - public function test_it_gets_only_one_name_of_the_relationship_type_if_name_and_name_reverse_are_similar() + /** @test */ + public function it_gets_only_one_name_of_the_relationship_type_if_name_and_name_reverse_are_similar() { $account = factory(Account::class)->create([]); $relationshipType = factory(RelationshipType::class)->create([ @@ -143,7 +151,8 @@ class RelationshipTypeTest extends TestCase ); } - public function test_it_gets_the_reverse_relationship_type() + /** @test */ + public function it_gets_the_reverse_relationship_type() { $account = factory(Account::class)->create([]); $relationshipTypeA = factory(RelationshipType::class)->create([ diff --git a/tests/Unit/Models/ReminderOutboxTest.php b/tests/Unit/Models/ReminderOutboxTest.php index eb3eb95d9..1d34b4147 100644 --- a/tests/Unit/Models/ReminderOutboxTest.php +++ b/tests/Unit/Models/ReminderOutboxTest.php @@ -10,19 +10,22 @@ class ReminderOutboxTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $reminderOutbox = factory(ReminderOutbox::class)->create([]); $this->assertTrue($reminderOutbox->account()->exists()); } - public function test_it_belongs_to_a_reminder() + /** @test */ + public function it_belongs_to_a_reminder() { $reminderOutbox = factory(ReminderOutbox::class)->create([]); $this->assertTrue($reminderOutbox->reminder()->exists()); } - public function test_it_belongs_to_a_user() + /** @test */ + public function it_belongs_to_a_user() { $reminderOutbox = factory(ReminderOutbox::class)->create([]); $this->assertTrue($reminderOutbox->user()->exists()); diff --git a/tests/Unit/Models/ReminderRuleTest.php b/tests/Unit/Models/ReminderRuleTest.php index 6c0d35952..ece8569c2 100644 --- a/tests/Unit/Models/ReminderRuleTest.php +++ b/tests/Unit/Models/ReminderRuleTest.php @@ -11,7 +11,8 @@ class ReminderRuleTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $reminderRule = factory(ReminderRule::class)->create(['account_id' => $account->id]); @@ -19,7 +20,8 @@ class ReminderRuleTest extends TestCase $this->assertTrue($reminderRule->account()->exists()); } - public function test_it_gets_number_of_days_before_attribute() + /** @test */ + public function it_gets_number_of_days_before_attribute() { $reminderRule = factory(ReminderRule::class)->create(['number_of_days_before' => '14']); @@ -29,7 +31,8 @@ class ReminderRuleTest extends TestCase ); } - public function test_it_sets_number_of_days_before_attribute() + /** @test */ + public function it_sets_number_of_days_before_attribute() { $reminderRule = new ReminderRule; $reminderRule->number_of_days_before = '14'; @@ -40,7 +43,8 @@ class ReminderRuleTest extends TestCase ); } - public function test_it_toggles_the_status() + /** @test */ + public function it_toggles_the_status() { $reminderRule = factory(ReminderRule::class)->create(); $reminderRule->active = true; diff --git a/tests/Unit/Models/ReminderSentTest.php b/tests/Unit/Models/ReminderSentTest.php index 94394db3d..e0d7c689c 100644 --- a/tests/Unit/Models/ReminderSentTest.php +++ b/tests/Unit/Models/ReminderSentTest.php @@ -10,19 +10,22 @@ class ReminderSentTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $reminderSent = factory(ReminderSent::class)->create([]); $this->assertTrue($reminderSent->account()->exists()); } - public function test_it_belongs_to_a_reminder() + /** @test */ + public function it_belongs_to_a_reminder() { $reminderSent = factory(ReminderSent::class)->create([]); $this->assertTrue($reminderSent->reminder()->exists()); } - public function test_it_belongs_to_a_user() + /** @test */ + public function it_belongs_to_a_user() { $reminderSent = factory(ReminderSent::class)->create([]); $this->assertTrue($reminderSent->user()->exists()); diff --git a/tests/Unit/Models/ReminderTest.php b/tests/Unit/Models/ReminderTest.php index acd51b826..2f787b6d9 100644 --- a/tests/Unit/Models/ReminderTest.php +++ b/tests/Unit/Models/ReminderTest.php @@ -16,7 +16,8 @@ class ReminderTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $reminder = factory(Reminder::class)->create([ @@ -26,7 +27,8 @@ class ReminderTest extends TestCase $this->assertTrue($reminder->account()->exists()); } - public function test_it_belongs_to_a_contact() + /** @test */ + public function it_belongs_to_a_contact() { $contact = factory(Contact::class)->create([]); $reminder = factory(Reminder::class)->create([ @@ -36,7 +38,8 @@ class ReminderTest extends TestCase $this->assertTrue($reminder->contact()->exists()); } - public function test_it_has_many_reminder_outbox() + /** @test */ + public function it_has_many_reminder_outbox() { $user = factory(User::class)->create([]); $reminder = factory(Reminder::class)->create(['account_id' => $user->account_id]); @@ -49,7 +52,8 @@ class ReminderTest extends TestCase $this->assertTrue($reminder->reminderOutboxes()->exists()); } - public function test_it_gets_the_title_attribute() + /** @test */ + public function it_gets_the_title_attribute() { $reminder = factory(Reminder::class)->create([ 'title' => 'Fake name', @@ -61,7 +65,8 @@ class ReminderTest extends TestCase ); } - public function test_it_gets_the_description_attribute() + /** @test */ + public function it_gets_the_description_attribute() { $reminder = factory(Reminder::class)->create([ 'description' => 'Fake name', @@ -73,7 +78,8 @@ class ReminderTest extends TestCase ); } - public function test_it_calculates_next_expected_date() + /** @test */ + public function it_calculates_next_expected_date() { $timezone = 'UTC'; $reminder = new Reminder; @@ -126,7 +132,8 @@ class ReminderTest extends TestCase ); } - public function test_it_schedules_a_reminder_for_one_user() + /** @test */ + public function it_schedules_a_reminder_for_one_user() { Carbon::setTestNow(Carbon::create(2017, 2, 1)); $user = factory(User::class)->create([]); @@ -147,7 +154,8 @@ class ReminderTest extends TestCase ]); } - public function test_scheduling_a_reminder_also_schedules_notifications_for_one_user() + /** @test */ + public function scheduling_a_reminder_also_schedules_notifications_for_one_user() { Carbon::setTestNow(Carbon::create(2017, 2, 1)); $user = factory(User::class)->create([]); @@ -191,7 +199,8 @@ class ReminderTest extends TestCase ); } - public function test_it_doesnt_schedule_a_notification_if_date_is_too_close_to_present_date() + /** @test */ + public function it_doesnt_schedule_a_notification_if_date_is_too_close_to_present_date() { Carbon::setTestNow(Carbon::create(2017, 2, 1)); $user = factory(User::class)->create([]); diff --git a/tests/Unit/Models/SpecialDateTest.php b/tests/Unit/Models/SpecialDateTest.php index 8bbc1337b..497f9449c 100644 --- a/tests/Unit/Models/SpecialDateTest.php +++ b/tests/Unit/Models/SpecialDateTest.php @@ -13,7 +13,8 @@ class SpecialDateTest extends FeatureTestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $specialDate = factory(SpecialDate::class)->create([ @@ -23,7 +24,8 @@ class SpecialDateTest extends FeatureTestCase $this->assertTrue($specialDate->account()->exists()); } - public function test_it_belongs_to_a_contact() + /** @test */ + public function it_belongs_to_a_contact() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create([ @@ -37,13 +39,15 @@ class SpecialDateTest extends FeatureTestCase $this->assertTrue($specialDate->contact()->exists()); } - public function test_get_age_returns_null_if_no_date_is_set() + /** @test */ + public function get_age_returns_null_if_no_date_is_set() { $specialDate = new SpecialDate; $this->assertNull($specialDate->getAge()); } - public function test_get_age_returns_null_if_year_is_unknown() + /** @test */ + public function get_age_returns_null_if_year_is_unknown() { $specialDate = factory(SpecialDate::class)->make(); $specialDate->is_year_unknown = 1; @@ -52,7 +56,8 @@ class SpecialDateTest extends FeatureTestCase $this->assertNull($specialDate->getAge()); } - public function test_get_age_returns_age() + /** @test */ + public function get_age_returns_age() { $specialDate = factory(SpecialDate::class)->make(); $specialDate->is_year_unknown = 0; @@ -65,7 +70,8 @@ class SpecialDateTest extends FeatureTestCase ); } - public function test_create_from_age_sets_the_right_date() + /** @test */ + public function create_from_age_sets_the_right_date() { $specialDate = factory(SpecialDate::class)->make(); @@ -87,7 +93,8 @@ class SpecialDateTest extends FeatureTestCase ); } - public function test_create_from_date_creates_an_approximate_date() + /** @test */ + public function create_from_date_creates_an_approximate_date() { $specialDate = factory(SpecialDate::class)->make(); @@ -114,7 +121,8 @@ class SpecialDateTest extends FeatureTestCase ); } - public function test_create_from_date_creates_an_exact_date() + /** @test */ + public function create_from_date_creates_an_exact_date() { $specialDate = factory(SpecialDate::class)->make(); @@ -141,7 +149,8 @@ class SpecialDateTest extends FeatureTestCase ); } - public function test_set_contact_sets_the_contact_information() + /** @test */ + public function set_contact_sets_the_contact_information() { $specialDate = factory(SpecialDate::class)->make(); @@ -160,7 +169,8 @@ class SpecialDateTest extends FeatureTestCase ); } - public function test_to_short_string_returns_date_with_year() + /** @test */ + public function to_short_string_returns_date_with_year() { $specialDate = new SpecialDate; $specialDate->is_year_unknown = false; @@ -172,7 +182,8 @@ class SpecialDateTest extends FeatureTestCase ); } - public function test_to_short_string_returns_date_without_year() + /** @test */ + public function to_short_string_returns_date_without_year() { $specialDate = new SpecialDate; $specialDate->is_year_unknown = true; diff --git a/tests/Unit/Models/TagTest.php b/tests/Unit/Models/TagTest.php index a72154fab..b465db82d 100644 --- a/tests/Unit/Models/TagTest.php +++ b/tests/Unit/Models/TagTest.php @@ -12,7 +12,8 @@ class TagTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -23,7 +24,8 @@ class TagTest extends TestCase $this->assertTrue($tag->account()->exists()); } - public function test_it_belongs_to_many_contacts() + /** @test */ + public function it_belongs_to_many_contacts() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create(['account_id' => $account->id]); diff --git a/tests/Unit/Models/TaskTest.php b/tests/Unit/Models/TaskTest.php index 6930b4ed9..cb8e920c4 100644 --- a/tests/Unit/Models/TaskTest.php +++ b/tests/Unit/Models/TaskTest.php @@ -12,7 +12,8 @@ class TaskTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -24,7 +25,8 @@ class TaskTest extends TestCase $this->assertTrue($task->account()->exists()); } - public function test_it_belongs_to_a_contact() + /** @test */ + public function it_belongs_to_a_contact() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -36,7 +38,8 @@ class TaskTest extends TestCase $this->assertTrue($task->contact()->exists()); } - public function test_it_filters_by_completed_items() + /** @test */ + public function it_filters_by_completed_items() { $task = factory(Task::class)->create(['completed' => true]); $task = factory(Task::class)->create(['completed' => true]); @@ -49,7 +52,8 @@ class TaskTest extends TestCase ); } - public function test_it_filters_by_incomplete_items() + /** @test */ + public function it_filters_by_incomplete_items() { $task = factory(Task::class)->create(['completed' => false]); $task = factory(Task::class)->create(['completed' => true]); diff --git a/tests/Unit/Models/TermTest.php b/tests/Unit/Models/TermTest.php index 33ac1b386..0fb26de72 100644 --- a/tests/Unit/Models/TermTest.php +++ b/tests/Unit/Models/TermTest.php @@ -12,7 +12,8 @@ class TermTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_many_users() + /** @test */ + public function it_belongs_to_many_users() { $account = factory(Account::class)->create([]); $user = factory(User::class)->create(['account_id' => $account->id]); diff --git a/tests/Unit/Models/UserTest.php b/tests/Unit/Models/UserTest.php index a91ec9a44..b14d345bf 100644 --- a/tests/Unit/Models/UserTest.php +++ b/tests/Unit/Models/UserTest.php @@ -29,7 +29,8 @@ class UserTest extends TestCase ]); } - public function test_it_belongs_to_account() + /** @test */ + public function it_belongs_to_account() { $account = factory(Account::class)->create([]); $user = factory(User::class)->create(['account_id' => $account->id]); @@ -37,7 +38,8 @@ class UserTest extends TestCase $this->assertTrue($user->account()->exists()); } - public function test_it_belongs_to_many_terms() + /** @test */ + public function it_belongs_to_many_terms() { $account = factory(Account::class)->create([]); $user = factory(User::class)->create(['account_id' => $account->id]); @@ -51,7 +53,8 @@ class UserTest extends TestCase $this->assertTrue($user->terms()->exists()); } - public function testUpdateContactViewPreference() + /** @test */ + public function it_updates_the_view_preferences() { $user = factory(User::class)->create(); $user->contacts_sort_order = 'firstnameAZ'; @@ -62,7 +65,8 @@ class UserTest extends TestCase ); } - public function test_name_accessor_returns_name_in_the_user_preferred_way() + /** @test */ + public function name_accessor_returns_name_in_the_user_preferred_way() { $user = new User; $user->first_name = 'John'; @@ -82,7 +86,8 @@ class UserTest extends TestCase ); } - public function test_it_gets_the_right_metric_symbol() + /** @test */ + public function it_gets_the_right_metric_symbol() { $user = new User; $user->metric = 'fahrenheit'; @@ -99,7 +104,8 @@ class UserTest extends TestCase ); } - public function test_you_can_vote_if_you_havent_voted_yet_today() + /** @test */ + public function you_can_vote_if_you_havent_voted_yet_today() { $account = factory(Account::class)->create([]); $user = factory(User::class)->create(['account_id' => $account->id]); @@ -107,7 +113,8 @@ class UserTest extends TestCase $this->assertFalse($user->hasAlreadyRatedToday()); } - public function test_you_cant_vote_if_you_have_already_voted_today() + /** @test */ + public function you_cant_vote_if_you_have_already_voted_today() { $account = factory(Account::class)->create([]); $user = factory(User::class)->create(['account_id' => $account->id]); @@ -119,7 +126,8 @@ class UserTest extends TestCase $this->assertTrue($user->hasAlreadyRatedToday()); } - public function test_it_gets_2fa_secret_attribute() + /** @test */ + public function it_gets_2fa_secret_attribute() { $user = new User; @@ -133,7 +141,8 @@ class UserTest extends TestCase ); } - public function test_it_gets_fluid_layout() + /** @test */ + public function it_gets_fluid_layout() { $user = new User; $user->fluid_container = true; @@ -151,7 +160,8 @@ class UserTest extends TestCase ); } - public function test_it_gets_the_locale() + /** @test */ + public function it_gets_the_locale() { $user = new User; $user->locale = 'en'; @@ -162,7 +172,8 @@ class UserTest extends TestCase ); } - public function test_user_should_not_be_reminded_because_dates_are_different() + /** @test */ + public function user_should_not_be_reminded_because_dates_are_different() { Carbon::setTestNow(Carbon::create(2017, 1, 1)); $account = factory(Account::class)->create(); @@ -175,7 +186,8 @@ class UserTest extends TestCase $this->assertFalse($user->isTheRightTimeToBeReminded($reminder->initial_date)); } - public function test_user_should_not_be_reminded_because_hours_are_different() + /** @test */ + public function user_should_not_be_reminded_because_hours_are_different() { Carbon::setTestNow(Carbon::create(2017, 1, 1, 7, 0, 0)); $account = factory(Account::class)->create(['default_time_reminder_is_sent' => '08:00']); @@ -188,7 +200,8 @@ class UserTest extends TestCase $this->assertFalse($user->isTheRightTimeToBeReminded($reminder->initial_date)); } - public function test_user_should_not_be_reminded_because_timezone_is_different() + /** @test */ + public function user_should_not_be_reminded_because_timezone_is_different() { Carbon::setTestNow(Carbon::create(2017, 1, 1, 7, 0, 0, 'Europe/Berlin')); $account = factory(Account::class)->create(['default_time_reminder_is_sent' => '07:00']); @@ -201,7 +214,8 @@ class UserTest extends TestCase $this->assertFalse($user->isTheRightTimeToBeReminded($reminder->initial_date)); } - public function test_user_should_be_reminded() + /** @test */ + public function user_should_be_reminded() { Carbon::setTestNow(Carbon::create(2017, 1, 1, 7, 32, 12)); $account = factory(Account::class)->create(['default_time_reminder_is_sent' => '07:00']); @@ -214,7 +228,8 @@ class UserTest extends TestCase $this->assertTrue($user->isTheRightTimeToBeReminded($reminder->initial_date)); } - public function test_it_indicates_user_is_compliant() + /** @test */ + public function it_indicates_user_is_compliant() { $term = factory(Term::class)->create([]); $account = factory(Account::class)->create([]); @@ -225,7 +240,8 @@ class UserTest extends TestCase $this->assertTrue($user->isPolicyCompliant()); } - public function test_it_indicates_user_is_not_compliant() + /** @test */ + public function it_indicates_user_is_not_compliant() { $term = factory(Term::class)->create([]); $account = factory(Account::class)->create([]); @@ -241,7 +257,8 @@ class UserTest extends TestCase $this->assertFalse($user->isPolicyCompliant()); } - public function test_it_accepts_the_latest_terms_and_privacy() + /** @test */ + public function it_accepts_the_laterms_and_privacy() { $term = factory(Term::class)->create([]); $account = factory(Account::class)->create([]); @@ -258,7 +275,8 @@ class UserTest extends TestCase ]); } - public function test_it_gets_status_for_a_specific_compliance() + /** @test */ + public function it_gets_status_for_a_specific_compliance() { $user = factory(User::class)->create([]); $this->assertFalse($user->getStatusForCompliance(123)); @@ -270,7 +288,8 @@ class UserTest extends TestCase $this->assertArrayHasKey('signed', $array); } - public function test_it_gets_all_the_signed_compliances_of_the_user() + /** @test */ + public function it_gets_all_the_signed_compliances_of_the_user() { $user = factory(User::class)->create([]); $term = factory(Term::class)->create([]); @@ -286,7 +305,8 @@ class UserTest extends TestCase ); } - public function test_it_gets_name_order_for_a_form() + /** @test */ + public function it_gets_name_order_for_a_form() { $user = factory(User::class)->create([]); $user->name_order = 'firstname_lastname'; @@ -326,7 +346,8 @@ class UserTest extends TestCase ); } - public function test_it_create_default_user_en() + /** @test */ + public function it_creates_default_user_en() { App::setLocale('en'); @@ -347,7 +368,8 @@ class UserTest extends TestCase ]); } - public function test_it_create_default_user_fr() + /** @test */ + public function it_creates_default_user_fr() { App::setLocale('fr'); @@ -368,7 +390,8 @@ class UserTest extends TestCase ]); } - public function test_it_create_default_user_cs() + /** @test */ + public function it_creates_default_user_cs() { App::setLocale('cs'); @@ -389,7 +412,8 @@ class UserTest extends TestCase ]); } - public function test_it_create_default_user_de() + /** @test */ + public function it_creates_default_user_de() { App::setLocale('de'); @@ -410,7 +434,8 @@ class UserTest extends TestCase ]); } - public function test_it_create_default_user_es() + /** @test */ + public function it_creates_default_user_es() { App::setLocale('es'); @@ -431,7 +456,8 @@ class UserTest extends TestCase ]); } - public function test_it_create_default_user_he() + /** @test */ + public function it_creates_default_user_he() { App::setLocale('he'); @@ -452,7 +478,8 @@ class UserTest extends TestCase ]); } - public function test_it_create_default_user_it() + /** @test */ + public function it_creates_default_user_it() { App::setLocale('it'); @@ -473,7 +500,8 @@ class UserTest extends TestCase ]); } - public function test_it_create_default_user_nl() + /** @test */ + public function it_creates_default_user_nl() { App::setLocale('nl'); @@ -494,7 +522,8 @@ class UserTest extends TestCase ]); } - public function test_it_create_default_user_pt() + /** @test */ + public function it_creates_default_user_pt() { App::setLocale('pt'); @@ -515,7 +544,8 @@ class UserTest extends TestCase ]); } - public function test_it_create_default_user_ru() + /** @test */ + public function it_creates_default_user_ru() { App::setLocale('ru'); @@ -536,7 +566,8 @@ class UserTest extends TestCase ]); } - public function test_it_create_default_user_zh() + /** @test */ + public function it_creates_default_user_zh() { App::setLocale('zh'); diff --git a/tests/Unit/Models/WeatherTest.php b/tests/Unit/Models/WeatherTest.php index c3ec2df53..a891958e5 100644 --- a/tests/Unit/Models/WeatherTest.php +++ b/tests/Unit/Models/WeatherTest.php @@ -11,7 +11,8 @@ class WeatherTest extends TestCase { use DatabaseTransactions; - public function test_it_belongs_to_an_account() + /** @test */ + public function it_belongs_to_an_account() { $account = factory(Account::class)->create([]); $weather = factory(Weather::class)->create([ @@ -20,13 +21,15 @@ class WeatherTest extends TestCase $this->assertTrue($weather->account()->exists()); } - public function test_it_belongs_to_a_place() + /** @test */ + public function it_belongs_to_a_place() { $weather = factory(Weather::class)->create([]); $this->assertTrue($weather->place()->exists()); } - public function test_it_gets_current_temperature() + /** @test */ + public function it_gets_current_temperature() { $weather = factory(Weather::class)->create(); @@ -36,7 +39,8 @@ class WeatherTest extends TestCase ); } - public function test_it_gets_current_temperature_in_celsius() + /** @test */ + public function it_gets_current_temperature_in_celsius() { $weather = factory(Weather::class)->create(); @@ -46,7 +50,8 @@ class WeatherTest extends TestCase ); } - public function test_it_gets_current_temperature_in_fahrenheit() + /** @test */ + public function it_gets_current_temperature_in_fahrenheit() { $weather = factory(Weather::class)->create(); @@ -56,7 +61,8 @@ class WeatherTest extends TestCase ); } - public function test_it_gets_current_summary() + /** @test */ + public function it_gets_current_summary() { $weather = factory(Weather::class)->create(); @@ -66,7 +72,8 @@ class WeatherTest extends TestCase ); } - public function test_it_gets_current_icon() + /** @test */ + public function it_gets_current_icon() { $weather = factory(Weather::class)->create(); @@ -76,7 +83,8 @@ class WeatherTest extends TestCase ); } - public function test_it_gets_weather_emoji() + /** @test */ + public function it_gets_weather_emoji() { $weather = factory(Weather::class)->create(); diff --git a/tests/Unit/Services/Account/Activity/ActivityStatisticServiceTest.php b/tests/Unit/Services/Account/Activity/ActivityStatisticServiceTest.php index 2e883bc18..691ef0009 100644 --- a/tests/Unit/Services/Account/Activity/ActivityStatisticServiceTest.php +++ b/tests/Unit/Services/Account/Activity/ActivityStatisticServiceTest.php @@ -16,7 +16,8 @@ class ActivityStatisticServiceTest extends TestCase { use DatabaseTransactions; - public function test_it_gets_a_list_of_activities_since_a_given_number_of_months() + /** @test */ + public function it_gets_a_list_of_activities_since_a_given_number_of_months() { $service = new ActivityStatisticService; $contact = factory(Contact::class)->create(); @@ -40,7 +41,8 @@ class ActivityStatisticServiceTest extends TestCase ); } - public function test_it_gets_an_empty_list_of_activities() + /** @test */ + public function it_gets_an_empty_list_of_activities() { $service = new ActivityStatisticService; $contact = factory(Contact::class)->create(); @@ -59,7 +61,8 @@ class ActivityStatisticServiceTest extends TestCase ); } - public function test_it_gets_a_list_of_unique_activity_types() + /** @test */ + public function it_gets_a_list_of_unique_activity_types() { $service = new ActivityStatisticService; $account = factory(Account::class)->create(); @@ -122,7 +125,8 @@ class ActivityStatisticServiceTest extends TestCase ); } - public function test_it_gets_the_breakdown_of_activities_per_year() + /** @test */ + public function it_gets_the_breakdown_of_activities_per_year() { $service = new ActivityStatisticService; $account = factory(Account::class)->create(); @@ -183,7 +187,8 @@ class ActivityStatisticServiceTest extends TestCase ); } - public function test_it_gets_a_list_of_activities_per_month_for_given_year() + /** @test */ + public function it_gets_a_list_of_activities_per_month_for_given_year() { $service = new ActivityStatisticService; $account = factory(Account::class)->create(); diff --git a/tests/Unit/Services/Account/Activity/ActivityType/CreateActivityTypeTest.php b/tests/Unit/Services/Account/Activity/ActivityType/CreateActivityTypeTest.php index adff75e63..2feb1eb21 100644 --- a/tests/Unit/Services/Account/Activity/ActivityType/CreateActivityTypeTest.php +++ b/tests/Unit/Services/Account/Activity/ActivityType/CreateActivityTypeTest.php @@ -15,7 +15,8 @@ class CreateActivityTypeTest extends TestCase { use DatabaseTransactions; - public function test_it_stores_an_activity_type() + /** @test */ + public function it_stores_an_activity_type() { $account = factory(Account::class)->create([]); $activityTypeCategory = factory(ActivityTypeCategory::class)->create([ @@ -45,7 +46,8 @@ class CreateActivityTypeTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'name' => '199 Lafayette Street', @@ -55,7 +57,8 @@ class CreateActivityTypeTest extends TestCase app(CreateActivityType::class)->execute($request); } - public function test_it_fails_if_activity_type_category_is_not_linked_to_account() + /** @test */ + public function it_fails_if_activity_type_category_is_not_linked_to_account() { $account = factory(Account::class)->create([]); $activityTypeCategory = factory(ActivityTypeCategory::class)->create([]); diff --git a/tests/Unit/Services/Account/Activity/ActivityType/DestroyActivityTypeTest.php b/tests/Unit/Services/Account/Activity/ActivityType/DestroyActivityTypeTest.php index 839e46f49..cd5ab0d3e 100644 --- a/tests/Unit/Services/Account/Activity/ActivityType/DestroyActivityTypeTest.php +++ b/tests/Unit/Services/Account/Activity/ActivityType/DestroyActivityTypeTest.php @@ -14,7 +14,8 @@ class DestroyActivityTypeTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_a_activity_type() + /** @test */ + public function it_destroys_a_activity_type() { $activityType = factory(ActivityType::class)->create([]); @@ -30,7 +31,8 @@ class DestroyActivityTypeTest extends TestCase ]); } - public function test_it_throws_an_exception_if_account_is_not_linked_to_activity_type() + /** @test */ + public function it_throws_an_exception_if_account_is_not_linked_to_activity_type() { $account = factory(Account::class)->create([]); $activityType = factory(ActivityType::class)->create([]); @@ -44,7 +46,8 @@ class DestroyActivityTypeTest extends TestCase app(DestroyActivityType::class)->execute($request); } - public function test_it_throws_an_exception_if_ids_do_not_exist() + /** @test */ + public function it_throws_an_exception_if_ids_do_not_exist() { $request = [ 'account_id' => 11111111, diff --git a/tests/Unit/Services/Account/Activity/ActivityType/UpdateActivityTypeTest.php b/tests/Unit/Services/Account/Activity/ActivityType/UpdateActivityTypeTest.php index dfb0281a7..452a0fc2b 100644 --- a/tests/Unit/Services/Account/Activity/ActivityType/UpdateActivityTypeTest.php +++ b/tests/Unit/Services/Account/Activity/ActivityType/UpdateActivityTypeTest.php @@ -15,7 +15,8 @@ class UpdateActivityTypeTest extends TestCase { use DatabaseTransactions; - public function test_it_updates_a_activity_type() + /** @test */ + public function it_updates_an_activity_type() { $activityType = factory(ActivityType::class)->create([]); $activityTypeCategory = factory(ActivityTypeCategory::class)->create([ @@ -46,7 +47,8 @@ class UpdateActivityTypeTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $activityType = factory(ActivityType::class)->create([]); $activityTypeCategory = factory(ActivityTypeCategory::class)->create([ @@ -64,7 +66,8 @@ class UpdateActivityTypeTest extends TestCase app(UpdateActivityType::class)->execute($request); } - public function test_it_throws_an_exception_if_activity_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_activity_is_not_linked_to_account() { $account = factory(Account::class)->create([]); $activityType = factory(ActivityType::class)->create([]); diff --git a/tests/Unit/Services/Account/Activity/ActivityTypeCategory/CreateActivityTypeCategoryTest.php b/tests/Unit/Services/Account/Activity/ActivityTypeCategory/CreateActivityTypeCategoryTest.php index 610004387..c3cd8f49b 100644 --- a/tests/Unit/Services/Account/Activity/ActivityTypeCategory/CreateActivityTypeCategoryTest.php +++ b/tests/Unit/Services/Account/Activity/ActivityTypeCategory/CreateActivityTypeCategoryTest.php @@ -13,7 +13,8 @@ class CreateActivityTypeCategoryTest extends TestCase { use DatabaseTransactions; - public function test_it_stores_an_activity_type_category() + /** @test */ + public function it_stores_an_activity_type_category() { $account = factory(Account::class)->create([]); @@ -38,7 +39,8 @@ class CreateActivityTypeCategoryTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'name' => '199 Lafayette Street', diff --git a/tests/Unit/Services/Account/Activity/ActivityTypeCategory/DestroyActivityTypeCategoryTest.php b/tests/Unit/Services/Account/Activity/ActivityTypeCategory/DestroyActivityTypeCategoryTest.php index 29a4e7431..5ac5f7d8b 100644 --- a/tests/Unit/Services/Account/Activity/ActivityTypeCategory/DestroyActivityTypeCategoryTest.php +++ b/tests/Unit/Services/Account/Activity/ActivityTypeCategory/DestroyActivityTypeCategoryTest.php @@ -14,7 +14,8 @@ class DestroyActivityTypeCategoryTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_a_activity_type_category() + /** @test */ + public function it_destroys_a_activity_type_category() { $activityTypeCategory = factory(ActivityTypeCategory::class)->create([]); @@ -30,7 +31,8 @@ class DestroyActivityTypeCategoryTest extends TestCase ]); } - public function test_it_throws_an_exception_if_account_is_not_linked_to_activity_type_category() + /** @test */ + public function it_throws_an_exception_if_account_is_not_linked_to_activity_type_category() { $account = factory(Account::class)->create([]); $activityTypeCategory = factory(ActivityTypeCategory::class)->create([]); @@ -44,7 +46,8 @@ class DestroyActivityTypeCategoryTest extends TestCase app(DestroyActivityTypeCategory::class)->execute($request); } - public function test_it_throws_an_exception_if_ids_do_not_exist() + /** @test */ + public function it_throws_an_exception_if_ids_do_not_exist() { $request = [ 'account_id' => 11111111, diff --git a/tests/Unit/Services/Account/Activity/ActivityTypeCategory/UpdateActivityTypeCategoryTest.php b/tests/Unit/Services/Account/Activity/ActivityTypeCategory/UpdateActivityTypeCategoryTest.php index 4c1da3bf4..12f45139a 100644 --- a/tests/Unit/Services/Account/Activity/ActivityTypeCategory/UpdateActivityTypeCategoryTest.php +++ b/tests/Unit/Services/Account/Activity/ActivityTypeCategory/UpdateActivityTypeCategoryTest.php @@ -14,7 +14,8 @@ class UpdateActivityTypeCategoryTest extends TestCase { use DatabaseTransactions; - public function test_it_updates_a_activity_type_category() + /** @test */ + public function it_updates_a_activity_type_category() { $activityTypeCategory = factory(ActivityTypeCategory::class)->create([]); @@ -40,7 +41,8 @@ class UpdateActivityTypeCategoryTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $activityTypeCategory = factory(ActivityTypeCategory::class)->create([]); @@ -52,7 +54,8 @@ class UpdateActivityTypeCategoryTest extends TestCase app(UpdateActivityTypeCategory::class)->execute($request); } - public function test_it_throws_an_exception_if_activity_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_activity_is_not_linked_to_account() { $account = factory(Account::class)->create([]); $activityTypeCategory = factory(ActivityTypeCategory::class)->create([]); diff --git a/tests/Unit/Services/Account/Activity/AttachContactToActivityTest.php b/tests/Unit/Services/Account/Activity/AttachContactToActivityTest.php index 138578034..db96306e7 100644 --- a/tests/Unit/Services/Account/Activity/AttachContactToActivityTest.php +++ b/tests/Unit/Services/Account/Activity/AttachContactToActivityTest.php @@ -15,7 +15,8 @@ class AttachContactToActivityTest extends TestCase { use DatabaseTransactions; - public function test_it_attaches_contacts() + /** @test */ + public function it_attaches_contacts() { $activity = factory(Activity::class)->create([]); $contactA = factory(Contact::class)->create([ @@ -60,7 +61,8 @@ class AttachContactToActivityTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $activity = factory(Activity::class)->create([]); $contactA = factory(Contact::class)->create([ @@ -76,7 +78,8 @@ class AttachContactToActivityTest extends TestCase app(AttachContactToActivity::class)->execute($request); } - public function test_it_throws_an_exception_if_contact_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_contact_is_not_linked_to_account() { $activity = factory(Activity::class)->create([]); $account = factory(Account::class)->create([]); diff --git a/tests/Unit/Services/Account/Activity/CreateActivityTest.php b/tests/Unit/Services/Account/Activity/CreateActivityTest.php index 4c36a68f7..f7e4101c6 100644 --- a/tests/Unit/Services/Account/Activity/CreateActivityTest.php +++ b/tests/Unit/Services/Account/Activity/CreateActivityTest.php @@ -17,7 +17,8 @@ class CreateActivityTest extends TestCase { use DatabaseTransactions; - public function test_it_stores_a_activity_and_creates_an_entry_in_the_journal() + /** @test */ + public function it_stores_a_activity_and_creates_an_entry_in_the_journal() { $account = factory(Account::class)->create([]); $activityType = factory(ActivityType::class)->create([ @@ -54,7 +55,8 @@ class CreateActivityTest extends TestCase ]); } - public function test_it_adds_emotions() + /** @test */ + public function it_adds_emotions() { $contact = factory(Contact::class)->create([]); $emotion = factory(Emotion::class)->create([]); @@ -92,7 +94,8 @@ class CreateActivityTest extends TestCase ]); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $account = factory(Account::class)->create([]); @@ -104,7 +107,8 @@ class CreateActivityTest extends TestCase app(CreateActivity::class)->execute($request); } - public function test_it_throws_an_exception_if_activity_type_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_activity_type_is_not_linked_to_account() { $account = factory(Account::class)->create([]); $activityType = factory(ActivityType::class)->create([]); diff --git a/tests/Unit/Services/Account/Activity/DestroyActivityTest.php b/tests/Unit/Services/Account/Activity/DestroyActivityTest.php index 252c4a999..2589c106c 100644 --- a/tests/Unit/Services/Account/Activity/DestroyActivityTest.php +++ b/tests/Unit/Services/Account/Activity/DestroyActivityTest.php @@ -14,7 +14,8 @@ class DestroyActivityTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_a_activity() + /** @test */ + public function it_destroys_a_activity() { $activity = factory(Activity::class)->create([]); @@ -34,7 +35,8 @@ class DestroyActivityTest extends TestCase ]); } - public function test_it_removes_the_journal_entry_when_destroying_the_activity() + /** @test */ + public function it_removes_the_journal_entry_when_destroying_the_activity() { $account = factory(Account::class)->create([]); $activityType = factory(ActivityType::class)->create([ diff --git a/tests/Unit/Services/Account/Activity/UpdateActivityTest.php b/tests/Unit/Services/Account/Activity/UpdateActivityTest.php index b07aed46c..8178f810c 100644 --- a/tests/Unit/Services/Account/Activity/UpdateActivityTest.php +++ b/tests/Unit/Services/Account/Activity/UpdateActivityTest.php @@ -14,7 +14,8 @@ class UpdateActivityTest extends TestCase { use DatabaseTransactions; - public function test_it_updates_an_activity() + /** @test */ + public function it_updates_an_activity() { $activity = factory(Activity::class)->create([]); @@ -42,7 +43,8 @@ class UpdateActivityTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $activity = factory(Activity::class)->create([]); @@ -58,7 +60,8 @@ class UpdateActivityTest extends TestCase app(UpdateActivity::class)->execute($request); } - public function test_it_throws_an_exception_if_contact_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_contact_is_not_linked_to_account() { $activity = factory(Activity::class)->create([]); $account = factory(Account::class)->create([]); diff --git a/tests/Unit/Services/Account/Company/CreateCompanyTest.php b/tests/Unit/Services/Account/Company/CreateCompanyTest.php index 74675ac8c..d60afa97e 100644 --- a/tests/Unit/Services/Account/Company/CreateCompanyTest.php +++ b/tests/Unit/Services/Account/Company/CreateCompanyTest.php @@ -13,7 +13,8 @@ class CreateCompanyTest extends TestCase { use DatabaseTransactions; - public function test_it_stores_a_company() + /** @test */ + public function it_stores_a_company() { $account = factory(Account::class)->create([]); @@ -40,7 +41,8 @@ class CreateCompanyTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $account = factory(Account::class)->create([]); diff --git a/tests/Unit/Services/Account/Company/DestroyCompanyTest.php b/tests/Unit/Services/Account/Company/DestroyCompanyTest.php index 2205a49a9..9e7630b18 100644 --- a/tests/Unit/Services/Account/Company/DestroyCompanyTest.php +++ b/tests/Unit/Services/Account/Company/DestroyCompanyTest.php @@ -14,7 +14,8 @@ class DestroyCompanyTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_a_company() + /** @test */ + public function it_destroys_a_company() { $company = factory(Company::class)->create([]); @@ -30,7 +31,8 @@ class DestroyCompanyTest extends TestCase ]); } - public function test_it_throws_an_exception_if_account_is_not_linked_to_company() + /** @test */ + public function it_throws_an_exception_if_account_is_not_linked_to_company() { $account = factory(Account::class)->create([]); $company = factory(Company::class)->create([]); @@ -44,7 +46,8 @@ class DestroyCompanyTest extends TestCase app(DestroyCompany::class)->execute($request); } - public function test_it_throws_an_exception_if_ids_do_not_exist() + /** @test */ + public function it_throws_an_exception_if_ids_do_not_exist() { $request = [ 'account_id' => 11111111, diff --git a/tests/Unit/Services/Account/Company/UpdateCompanyTest.php b/tests/Unit/Services/Account/Company/UpdateCompanyTest.php index f2ad94df6..e4105118f 100644 --- a/tests/Unit/Services/Account/Company/UpdateCompanyTest.php +++ b/tests/Unit/Services/Account/Company/UpdateCompanyTest.php @@ -14,7 +14,8 @@ class UpdateCompanyTest extends TestCase { use DatabaseTransactions; - public function test_it_updates_a_company() + /** @test */ + public function it_updates_a_company() { $company = factory(Company::class)->create([]); @@ -42,7 +43,8 @@ class UpdateCompanyTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $company = factory(Company::class)->create([]); @@ -54,7 +56,8 @@ class UpdateCompanyTest extends TestCase app(UpdateCompany::class)->execute($request); } - public function test_it_throws_an_exception_if_place_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_place_is_not_linked_to_account() { $account = factory(Account::class)->create([]); $company = factory(Company::class)->create([]); diff --git a/tests/Unit/Services/Account/Gender/CreateGenderTest.php b/tests/Unit/Services/Account/Gender/CreateGenderTest.php index c022783a5..c788753e2 100644 --- a/tests/Unit/Services/Account/Gender/CreateGenderTest.php +++ b/tests/Unit/Services/Account/Gender/CreateGenderTest.php @@ -13,7 +13,8 @@ class CreateGenderTest extends TestCase { use DatabaseTransactions; - public function test_it_stores_a_gender() + /** @test */ + public function it_stores_a_gender() { $account = factory(Account::class)->create([]); @@ -38,7 +39,8 @@ class CreateGenderTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $account = factory(Account::class)->create([]); diff --git a/tests/Unit/Services/Account/Gender/DestroyGenderTest.php b/tests/Unit/Services/Account/Gender/DestroyGenderTest.php index 4e27e96ca..074ed6b05 100644 --- a/tests/Unit/Services/Account/Gender/DestroyGenderTest.php +++ b/tests/Unit/Services/Account/Gender/DestroyGenderTest.php @@ -14,7 +14,8 @@ class DestroyGenderTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_a_gender() + /** @test */ + public function it_destroys_a_gender() { $gender = factory(Gender::class)->create([]); @@ -30,7 +31,8 @@ class DestroyGenderTest extends TestCase ]); } - public function test_it_throws_an_exception_if_account_is_not_linked_to_gender() + /** @test */ + public function it_throws_an_exception_if_account_is_not_linked_to_gender() { $account = factory(Account::class)->create([]); $gender = factory(Gender::class)->create([]); @@ -44,7 +46,8 @@ class DestroyGenderTest extends TestCase app(DestroyGender::class)->execute($request); } - public function test_it_throws_an_exception_if_ids_do_not_exist() + /** @test */ + public function it_throws_an_exception_if_ids_do_not_exist() { $request = [ 'account_id' => 11111111, diff --git a/tests/Unit/Services/Account/Gender/UpdateGenderTest.php b/tests/Unit/Services/Account/Gender/UpdateGenderTest.php index f36a56d47..a7f9d39d0 100644 --- a/tests/Unit/Services/Account/Gender/UpdateGenderTest.php +++ b/tests/Unit/Services/Account/Gender/UpdateGenderTest.php @@ -14,7 +14,8 @@ class UpdateGenderTest extends TestCase { use DatabaseTransactions; - public function test_it_updates_a_gender() + /** @test */ + public function it_updates_a_gender() { $gender = factory(Gender::class)->create([]); @@ -40,7 +41,8 @@ class UpdateGenderTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $gender = factory(Gender::class)->create([]); @@ -53,7 +55,8 @@ class UpdateGenderTest extends TestCase app(UpdateGender::class)->execute($request); } - public function test_it_throws_an_exception_if_place_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_place_is_not_linked_to_account() { $account = factory(Account::class)->create([]); $gender = factory(Gender::class)->create([]); diff --git a/tests/Unit/Services/Account/Photo/DestroyPhotoTest.php b/tests/Unit/Services/Account/Photo/DestroyPhotoTest.php index 79895d28d..8bf79b7a8 100644 --- a/tests/Unit/Services/Account/Photo/DestroyPhotoTest.php +++ b/tests/Unit/Services/Account/Photo/DestroyPhotoTest.php @@ -18,7 +18,8 @@ class DestroyPhotoTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_a_photo() + /** @test */ + public function it_destroys_a_photo() { $contact = factory(Contact::class)->create([]); $photo = $this->uploadPhoto($contact); @@ -41,7 +42,8 @@ class DestroyPhotoTest extends TestCase Storage::disk('photos')->assertMissing('photo.png'); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'photo_id' => 2, @@ -52,7 +54,8 @@ class DestroyPhotoTest extends TestCase app(DestroyPhoto::class)->execute($request); } - public function test_it_throws_a_photo_doesnt_exist() + /** @test */ + public function it_throws_a_photo_doesnt_exist() { $account = factory(Account::class)->create([]); $photo = factory(Photo::class)->create([]); diff --git a/tests/Unit/Services/Account/Photo/UploadPhotoTest.php b/tests/Unit/Services/Account/Photo/UploadPhotoTest.php index 76e8b4742..3101fdaba 100644 --- a/tests/Unit/Services/Account/Photo/UploadPhotoTest.php +++ b/tests/Unit/Services/Account/Photo/UploadPhotoTest.php @@ -15,7 +15,8 @@ class UploadPhotoTest extends TestCase { use DatabaseTransactions; - public function test_it_uploads_a_photo() + /** @test */ + public function it_uploads_a_photo() { Storage::fake('photos'); @@ -43,7 +44,8 @@ class UploadPhotoTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'account_id' => 'wrong', @@ -54,7 +56,8 @@ class UploadPhotoTest extends TestCase app(UploadPhoto::class)->execute($request); } - public function test_it_throws_an_exception_if_account_does_not_exist() + /** @test */ + public function it_throws_an_exception_if_account_does_not_exist() { Storage::fake('photos'); diff --git a/tests/Unit/Services/Account/Place/CreatePlaceTest.php b/tests/Unit/Services/Account/Place/CreatePlaceTest.php index 78406e41d..b48bfba1a 100644 --- a/tests/Unit/Services/Account/Place/CreatePlaceTest.php +++ b/tests/Unit/Services/Account/Place/CreatePlaceTest.php @@ -17,7 +17,8 @@ class CreatePlaceTest extends TestCase { use DatabaseTransactions; - public function test_it_stores_a_place_without_fetching_geolocation_information() + /** @test */ + public function it_stores_a_place_without_fetching_geolocation_information() { $account = factory(Account::class)->create([]); @@ -47,7 +48,8 @@ class CreatePlaceTest extends TestCase ); } - public function test_it_stores_a_place_and_fetch_geolocation_information() + /** @test */ + public function it_stores_a_place_and_fetch_geolocation_information() { config(['monica.enable_geolocation' => true]); config(['monica.location_iq_api_key' => 'test']); @@ -81,7 +83,8 @@ class CreatePlaceTest extends TestCase ]); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $account = factory(Account::class)->create([]); diff --git a/tests/Unit/Services/Account/Place/DestroyPlaceTest.php b/tests/Unit/Services/Account/Place/DestroyPlaceTest.php index f5df276cb..cd8ef5fe3 100644 --- a/tests/Unit/Services/Account/Place/DestroyPlaceTest.php +++ b/tests/Unit/Services/Account/Place/DestroyPlaceTest.php @@ -14,7 +14,8 @@ class DestroyPlaceTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_a_place() + /** @test */ + public function it_destroys_a_place() { $place = factory(Place::class)->create([]); @@ -30,7 +31,8 @@ class DestroyPlaceTest extends TestCase ]); } - public function test_it_throws_an_exception_if_account_is_not_linked_to_places() + /** @test */ + public function it_throws_an_exception_if_account_is_not_linked_to_places() { $account = factory(Account::class)->create([]); $place = factory(Place::class)->create([]); @@ -44,7 +46,8 @@ class DestroyPlaceTest extends TestCase app(DestroyPlace::class)->execute($request); } - public function test_it_throws_an_exception_if_ids_do_not_exist() + /** @test */ + public function it_throws_an_exception_if_ids_do_not_exist() { $request = [ 'account_id' => 11111111, diff --git a/tests/Unit/Services/Account/Place/UpdatePlaceTest.php b/tests/Unit/Services/Account/Place/UpdatePlaceTest.php index f44c7eac9..8f19f473f 100644 --- a/tests/Unit/Services/Account/Place/UpdatePlaceTest.php +++ b/tests/Unit/Services/Account/Place/UpdatePlaceTest.php @@ -18,7 +18,8 @@ class UpdatePlaceTest extends TestCase { use DatabaseTransactions; - public function test_it_updates_a_place_without_fetching_geolocation_information() + /** @test */ + public function it_updates_a_place_without_fetching_geolocation_information() { $place = factory(Place::class)->create([]); @@ -49,7 +50,8 @@ class UpdatePlaceTest extends TestCase ); } - public function test_it_updates_a_place_and_fetch_geolocation_information() + /** @test */ + public function it_updates_a_place_and_fetch_geolocation_information() { config(['monica.enable_geolocation' => true]); config(['monica.location_iq_api_key' => 'test']); @@ -84,7 +86,8 @@ class UpdatePlaceTest extends TestCase ]); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $place = factory(Place::class)->create([]); @@ -96,7 +99,8 @@ class UpdatePlaceTest extends TestCase app(UpdatePlace::class)->execute($request); } - public function test_it_throws_an_exception_if_place_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_place_is_not_linked_to_account() { $account = factory(Account::class)->create([]); $place = factory(Place::class)->create([]); diff --git a/tests/Unit/Services/Account/Settings/DestroyAccountTest.php b/tests/Unit/Services/Account/Settings/DestroyAccountTest.php index dcbcafa8c..1bd0dd2eb 100644 --- a/tests/Unit/Services/Account/Settings/DestroyAccountTest.php +++ b/tests/Unit/Services/Account/Settings/DestroyAccountTest.php @@ -13,7 +13,8 @@ class DestroyAccountTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_an_account() + /** @test */ + public function it_destroys_an_account() { $user = factory(User::class)->create([]); factory(Contact::class, 3)->create([ @@ -34,7 +35,8 @@ class DestroyAccountTest extends TestCase ]); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = []; diff --git a/tests/Unit/Services/Account/Settings/DestroyAllDocumentsTest.php b/tests/Unit/Services/Account/Settings/DestroyAllDocumentsTest.php index e54854dc2..022562dbb 100644 --- a/tests/Unit/Services/Account/Settings/DestroyAllDocumentsTest.php +++ b/tests/Unit/Services/Account/Settings/DestroyAllDocumentsTest.php @@ -15,7 +15,8 @@ class DestroyAllDocumentsTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_all_documents() + /** @test */ + public function it_destroys_all_documents() { Storage::fake(); @@ -41,7 +42,8 @@ class DestroyAllDocumentsTest extends TestCase } } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ ]; diff --git a/tests/Unit/Services/Account/Settings/DestroyAllPhotosTest.php b/tests/Unit/Services/Account/Settings/DestroyAllPhotosTest.php index cbddbcfcb..9dcd7b80c 100644 --- a/tests/Unit/Services/Account/Settings/DestroyAllPhotosTest.php +++ b/tests/Unit/Services/Account/Settings/DestroyAllPhotosTest.php @@ -15,7 +15,8 @@ class DestroyAllPhotosTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_all_photos() + /** @test */ + public function it_destroys_all_photos() { Storage::fake(); @@ -41,7 +42,8 @@ class DestroyAllPhotosTest extends TestCase } } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = []; diff --git a/tests/Unit/Services/Account/Settings/ExportAccountTest.php b/tests/Unit/Services/Account/Settings/ExportAccountTest.php index d20f89ae7..4f8049c03 100644 --- a/tests/Unit/Services/Account/Settings/ExportAccountTest.php +++ b/tests/Unit/Services/Account/Settings/ExportAccountTest.php @@ -13,7 +13,8 @@ class ExportAccountTest extends TestCase { use DatabaseTransactions; - public function test_it_exports_account_information() + /** @test */ + public function it_exports_account_information() { Storage::fake('local'); @@ -31,7 +32,8 @@ class ExportAccountTest extends TestCase Storage::disk('local')->assertExists($filename); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = []; diff --git a/tests/Unit/Services/Account/Settings/ResetAccountTest.php b/tests/Unit/Services/Account/Settings/ResetAccountTest.php index f1e4b10d8..8d868c103 100644 --- a/tests/Unit/Services/Account/Settings/ResetAccountTest.php +++ b/tests/Unit/Services/Account/Settings/ResetAccountTest.php @@ -15,7 +15,8 @@ class ResetAccountTest extends TestCase { use DatabaseTransactions; - public function test_it_resets_an_account() + /** @test */ + public function it_resets_an_account() { // populate the account with fake contacts and activities $user = factory(User::class)->create([]); @@ -54,7 +55,8 @@ class ResetAccountTest extends TestCase ]); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = []; diff --git a/tests/Unit/Services/Auth/PopulateContactFieldTypesTableTest.php b/tests/Unit/Services/Auth/PopulateContactFieldTypesTableTest.php index 63f8ee1a7..6a4b4fd01 100644 --- a/tests/Unit/Services/Auth/PopulateContactFieldTypesTableTest.php +++ b/tests/Unit/Services/Auth/PopulateContactFieldTypesTableTest.php @@ -14,7 +14,8 @@ class PopulateContactFieldTypesTableTest extends TestCase { use DatabaseTransactions; - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'account_id' => 1, @@ -31,7 +32,8 @@ class PopulateContactFieldTypesTableTest extends TestCase app(PopulateContactFieldTypesTable::class)->execute($request); } - public function test_it_populate_contact_field_types_tables() + /** @test */ + public function it_populate_contact_field_types_tables() { $account = factory(Account::class)->create([]); $user = factory(User::class)->create([ @@ -59,7 +61,8 @@ class PopulateContactFieldTypesTableTest extends TestCase ); } - public function test_it_only_populates_partially() + /** @test */ + public function it_only_populates_partially() { $account = factory(Account::class)->create([]); $user = factory(User::class)->create([ diff --git a/tests/Unit/Services/Auth/PopulateLifeEventsTableTest.php b/tests/Unit/Services/Auth/PopulateLifeEventsTableTest.php index 3cc2f422c..49b5fad5d 100644 --- a/tests/Unit/Services/Auth/PopulateLifeEventsTableTest.php +++ b/tests/Unit/Services/Auth/PopulateLifeEventsTableTest.php @@ -14,7 +14,8 @@ class PopulateLifeEventsTableTest extends TestCase { use DatabaseTransactions; - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'account_id' => 1, @@ -33,7 +34,8 @@ class PopulateLifeEventsTableTest extends TestCase app(PopulateLifeEventsTable::class)->execute($request); } - public function test_it_populate_life_event_tables() + /** @test */ + public function it_populate_life_event_tables() { $account = factory(Account::class)->create([]); $user = factory(User::class)->create([ @@ -71,7 +73,8 @@ class PopulateLifeEventsTableTest extends TestCase ]); } - public function test_it_refuses_to_populate_table_if_account_doesnt_have_locale() + /** @test */ + public function it_refuses_to_populate_table_if_account_doesnt_have_locale() { $account = factory(Account::class)->create([]); @@ -83,7 +86,8 @@ class PopulateLifeEventsTableTest extends TestCase $this->assertFalse(app(PopulateLifeEventsTable::class)->execute($request)); } - public function test_it_only_populates_life_event_tables_partially() + /** @test */ + public function it_only_populates_life_event_tables_partially() { $account = factory(Account::class)->create([]); $user = factory(User::class)->create([ diff --git a/tests/Unit/Services/Auth/PopulateModulesTableTest.php b/tests/Unit/Services/Auth/PopulateModulesTableTest.php index b9b9a775f..bbb5e4ffd 100644 --- a/tests/Unit/Services/Auth/PopulateModulesTableTest.php +++ b/tests/Unit/Services/Auth/PopulateModulesTableTest.php @@ -14,7 +14,8 @@ class PopulateModulesTableTest extends TestCase { use DatabaseTransactions; - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'account_id' => 1, @@ -34,7 +35,8 @@ class PopulateModulesTableTest extends TestCase app(PopulateModulesTable::class)->execute($request); } - public function test_it_populate_modules_tables() + /** @test */ + public function it_populate_modules_tables() { $account = factory(Account::class)->create([]); $user = factory(User::class)->create([ @@ -65,7 +67,8 @@ class PopulateModulesTableTest extends TestCase ]); } - public function test_it_only_populates_module_tables_partially() + /** @test */ + public function it_only_populates_module_tables_partially() { $account = factory(Account::class)->create([]); $user = factory(User::class)->create([ diff --git a/tests/Unit/Services/Contact/Address/CreateAddressTest.php b/tests/Unit/Services/Contact/Address/CreateAddressTest.php index e3a5c0f75..cc5a68dfb 100644 --- a/tests/Unit/Services/Contact/Address/CreateAddressTest.php +++ b/tests/Unit/Services/Contact/Address/CreateAddressTest.php @@ -15,7 +15,8 @@ class CreateAddressTest extends TestCase { use DatabaseTransactions; - public function test_it_stores_an_address() + /** @test */ + public function it_stores_an_address() { $contact = factory(Contact::class)->create([]); @@ -51,7 +52,8 @@ class CreateAddressTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $account = factory(Account::class)->create([]); @@ -63,7 +65,8 @@ class CreateAddressTest extends TestCase app(CreateAddress::class)->execute($request); } - public function test_it_throws_an_exception_if_contact_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_contact_is_not_linked_to_account() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create(); diff --git a/tests/Unit/Services/Contact/Address/DestroyAddressTest.php b/tests/Unit/Services/Contact/Address/DestroyAddressTest.php index b6b949f22..543526f69 100644 --- a/tests/Unit/Services/Contact/Address/DestroyAddressTest.php +++ b/tests/Unit/Services/Contact/Address/DestroyAddressTest.php @@ -14,7 +14,8 @@ class DestroyAddressTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_an_address() + /** @test */ + public function it_destroys_an_address() { $address = factory(Address::class)->create([]); @@ -30,7 +31,8 @@ class DestroyAddressTest extends TestCase ]); } - public function test_it_throws_an_exception_if_account_is_not_linked_to_address() + /** @test */ + public function it_throws_an_exception_if_account_is_not_linked_to_address() { $contact = factory(Contact::class)->create([]); $address = factory(Address::class)->create([]); @@ -44,7 +46,8 @@ class DestroyAddressTest extends TestCase app(DestroyAddress::class)->execute($request); } - public function test_it_throws_an_exception_if_ids_do_not_exist() + /** @test */ + public function it_throws_an_exception_if_ids_do_not_exist() { $request = [ 'account_id' => 11111111, diff --git a/tests/Unit/Services/Contact/Address/UpdateAddressTest.php b/tests/Unit/Services/Contact/Address/UpdateAddressTest.php index 32c2fcda8..466919af3 100644 --- a/tests/Unit/Services/Contact/Address/UpdateAddressTest.php +++ b/tests/Unit/Services/Contact/Address/UpdateAddressTest.php @@ -15,7 +15,8 @@ class UpdateAddressTest extends TestCase { use DatabaseTransactions; - public function test_it_updates_an_address() + /** @test */ + public function it_updates_an_address() { $address = factory(Address::class)->create([]); @@ -52,7 +53,8 @@ class UpdateAddressTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $address = factory(Address::class)->create([]); @@ -64,7 +66,8 @@ class UpdateAddressTest extends TestCase app(UpdateAddress::class)->execute($request); } - public function test_it_throws_an_exception_if_address_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_address_is_not_linked_to_account() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create([]); diff --git a/tests/Unit/Services/Contact/Avatar/GenerateDefaultAvatarTest.php b/tests/Unit/Services/Contact/Avatar/GenerateDefaultAvatarTest.php index 1221aca9e..076f857fd 100644 --- a/tests/Unit/Services/Contact/Avatar/GenerateDefaultAvatarTest.php +++ b/tests/Unit/Services/Contact/Avatar/GenerateDefaultAvatarTest.php @@ -13,7 +13,8 @@ class GenerateDefaultAvatarTest extends TestCase { use DatabaseTransactions; - public function test_it_generates_a_default_avatar() + /** @test */ + public function it_generates_a_default_avatar() { $contact = factory(Contact::class)->create([ 'default_avatar_color' => '#000', @@ -31,7 +32,8 @@ class GenerateDefaultAvatarTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = []; @@ -39,7 +41,8 @@ class GenerateDefaultAvatarTest extends TestCase app(GenerateDefaultAvatar::class)->execute($request); } - public function test_it_replaces_existing_default_avatar() + /** @test */ + public function it_replaces_existing_default_avatar() { $file = UploadedFile::fake()->image('image.png'); diff --git a/tests/Unit/Services/Contact/Avatar/GetAdorableAvatarTest.php b/tests/Unit/Services/Contact/Avatar/GetAdorableAvatarTest.php index 8563ad7e8..f4430cb30 100644 --- a/tests/Unit/Services/Contact/Avatar/GetAdorableAvatarTest.php +++ b/tests/Unit/Services/Contact/Avatar/GetAdorableAvatarTest.php @@ -11,7 +11,8 @@ class GetAdorableAvatarTest extends TestCase { use DatabaseTransactions; - public function test_it_returns_an_url() + /** @test */ + public function it_returns_an_url() { $request = [ 'uuid' => 'matt@wordpress.com', @@ -26,7 +27,8 @@ class GetAdorableAvatarTest extends TestCase ); } - public function test_it_returns_an_url_with_a_default_avatar_size() + /** @test */ + public function it_returns_an_url_with_a_default_avatar_size() { $request = [ 'uuid' => 'matt@wordpress.com', @@ -41,7 +43,8 @@ class GetAdorableAvatarTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'size' => 200, diff --git a/tests/Unit/Services/Contact/Avatar/GetAvatarsFromInternetTest.php b/tests/Unit/Services/Contact/Avatar/GetAvatarsFromInternetTest.php index a1e5dad42..99a2ed24e 100644 --- a/tests/Unit/Services/Contact/Avatar/GetAvatarsFromInternetTest.php +++ b/tests/Unit/Services/Contact/Avatar/GetAvatarsFromInternetTest.php @@ -14,7 +14,8 @@ class GetAvatarsFromInternetTest extends TestCase { use DatabaseTransactions; - public function test_it_returns_a_contact_object_with_avatars() + /** @test */ + public function it_returns_a_contact_object_with_avatars() { $contact = factory(Contact::class)->create([]); $contactFieldType = factory(ContactFieldType::class)->create([ @@ -47,7 +48,8 @@ class GetAvatarsFromInternetTest extends TestCase ); } - public function test_gravatar_is_null_if_contact_doesnt_have_an_email() + /** @test */ + public function gravatar_is_null_if_contact_doesnt_have_an_email() { $contact = factory(Contact::class)->create([]); @@ -62,7 +64,8 @@ class GetAvatarsFromInternetTest extends TestCase ); } - public function test_avatar_source_is_reset_and_set_to_adorable_if_gravatar_doesnt_exist_anymore() + /** @test */ + public function avatar_source_is_reset_and_set_to_adorable_if_gravatar_doesnt_exist_anymore() { $contact = factory(Contact::class)->create([ 'avatar_source' => 'gravatar', @@ -97,7 +100,8 @@ class GetAvatarsFromInternetTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'size' => 200, diff --git a/tests/Unit/Services/Contact/Avatar/GetGravatarTest.php b/tests/Unit/Services/Contact/Avatar/GetGravatarTest.php index 010fd0762..6269bc635 100644 --- a/tests/Unit/Services/Contact/Avatar/GetGravatarTest.php +++ b/tests/Unit/Services/Contact/Avatar/GetGravatarTest.php @@ -11,7 +11,8 @@ class GetGravatarTest extends TestCase { use DatabaseTransactions; - public function test_it_returns_an_url() + /** @test */ + public function it_returns_an_url() { $request = [ 'email' => 'matt@wordpress.com', @@ -26,7 +27,8 @@ class GetGravatarTest extends TestCase ); } - public function test_it_returns_an_url_with_a_small_avatar_size() + /** @test */ + public function it_returns_an_url_with_a_small_avatar_size() { $request = [ 'email' => 'matt@wordpress.com', @@ -41,7 +43,8 @@ class GetGravatarTest extends TestCase ); } - public function test_it_returns_an_url_with_a_default_avatar_size() + /** @test */ + public function it_returns_an_url_with_a_default_avatar_size() { $request = [ 'email' => 'matt@wordpress.com', @@ -56,7 +59,8 @@ class GetGravatarTest extends TestCase ); } - public function test_it_returns_null_if_no_avatar_is_found() + /** @test */ + public function it_returns_null_if_no_avatar_is_found() { $request = [ 'email' => 'jlskjdfl@dskfjlsd.com', @@ -68,7 +72,8 @@ class GetGravatarTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'size' => 200, diff --git a/tests/Unit/Services/Contact/Avatar/UpdateAvatarTest.php b/tests/Unit/Services/Contact/Avatar/UpdateAvatarTest.php index 33cc9183c..81bb86459 100644 --- a/tests/Unit/Services/Contact/Avatar/UpdateAvatarTest.php +++ b/tests/Unit/Services/Contact/Avatar/UpdateAvatarTest.php @@ -15,7 +15,8 @@ class UpdateAvatarTest extends TestCase { use DatabaseTransactions; - public function test_it_updates_the_avatar_with_gravatar() + /** @test */ + public function it_updates_the_avatar_with_gravatar() { $contact = factory(Contact::class)->create([]); @@ -38,7 +39,8 @@ class UpdateAvatarTest extends TestCase ); } - public function test_it_updates_the_avatar_with_default_avatar() + /** @test */ + public function it_updates_the_avatar_with_default_avatar() { $contact = factory(Contact::class)->create([]); @@ -61,7 +63,8 @@ class UpdateAvatarTest extends TestCase ); } - public function test_it_updates_the_avatar_with_adorable() + /** @test */ + public function it_updates_the_avatar_with_adorable() { $contact = factory(Contact::class)->create([]); @@ -84,7 +87,8 @@ class UpdateAvatarTest extends TestCase ); } - public function test_it_updates_the_avatar_with_existing_photo() + /** @test */ + public function it_updates_the_avatar_with_existing_photo() { $contact = factory(Contact::class)->create([]); $photo = factory(Photo::class)->create([ @@ -112,7 +116,8 @@ class UpdateAvatarTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $contact = factory(Contact::class)->create([]); @@ -125,7 +130,8 @@ class UpdateAvatarTest extends TestCase app(UpdateAvatar::class)->execute($request); } - public function test_it_throws_an_exception_if_contact_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_contact_not_linked_to_account() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create([]); @@ -140,7 +146,8 @@ class UpdateAvatarTest extends TestCase app(UpdateAvatar::class)->execute($request); } - public function test_it_throws_an_exception_if_photo_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_photo_not_linked_to_account() { // Case: photo doesn't exist $contact = factory(Contact::class)->create([]); diff --git a/tests/Unit/Services/Contact/Call/CreateCallTest.php b/tests/Unit/Services/Contact/Call/CreateCallTest.php index b7a8a7cd5..fc34bdfac 100644 --- a/tests/Unit/Services/Contact/Call/CreateCallTest.php +++ b/tests/Unit/Services/Contact/Call/CreateCallTest.php @@ -16,7 +16,8 @@ class CreateCallTest extends TestCase { use DatabaseTransactions; - public function test_it_stores_a_call() + /** @test */ + public function it_stores_a_call() { $contact = factory(Contact::class)->create([]); @@ -43,7 +44,8 @@ class CreateCallTest extends TestCase ); } - public function test_it_stores_a_call_and_who_called_information() + /** @test */ + public function it_stores_a_call_and_who_called_information() { $contact = factory(Contact::class)->create([]); @@ -66,7 +68,8 @@ class CreateCallTest extends TestCase ]); } - public function test_it_adds_emotions() + /** @test */ + public function it_adds_emotions() { $contact = factory(Contact::class)->create([]); $emotion = factory(Emotion::class)->create([]); @@ -110,7 +113,8 @@ class CreateCallTest extends TestCase ]); } - public function test_it_fails_adding_emotions_when_emotion_is_unknown() + /** @test */ + public function it_fails_adding_emotions_when_emotion_is_unknown() { $contact = factory(Contact::class)->create([]); $emotionArray = []; @@ -130,7 +134,8 @@ class CreateCallTest extends TestCase app(CreateCall::class)->execute($request); } - public function test_it_stores_a_call_without_the_content() + /** @test */ + public function it_stores_a_call_without_the_content() { $contact = factory(Contact::class)->create([]); @@ -150,7 +155,8 @@ class CreateCallTest extends TestCase ]); } - public function test_it_updates_the_last_call_info() + /** @test */ + public function it_updates_the_last_call_info() { $contact = factory(Contact::class)->create([ 'last_talked_to' => '1900-01-01 00:00:00', @@ -172,7 +178,8 @@ class CreateCallTest extends TestCase ]); } - public function test_it_doesnt_update_the_last_call_info() + /** @test */ + public function it_doesnt_update_the_last_call_info() { $contact = factory(Contact::class)->create([ 'last_talked_to' => '2200-01-01 00:00:00', @@ -194,7 +201,8 @@ class CreateCallTest extends TestCase ]); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $contact = factory(Contact::class)->create([]); @@ -207,7 +215,8 @@ class CreateCallTest extends TestCase app(CreateCall::class)->execute($request); } - public function test_it_throws_an_exception_if_contact_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_contact_is_not_linked_to_account() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create(); diff --git a/tests/Unit/Services/Contact/Call/DestroyCallTest.php b/tests/Unit/Services/Contact/Call/DestroyCallTest.php index 2e7e3bb80..a093887b9 100644 --- a/tests/Unit/Services/Contact/Call/DestroyCallTest.php +++ b/tests/Unit/Services/Contact/Call/DestroyCallTest.php @@ -14,7 +14,8 @@ class DestroyCallTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_a_call() + /** @test */ + public function it_destroys_a_call() { $contact = factory(Contact::class)->create([]); $call = factory(Call::class)->create([ @@ -38,7 +39,8 @@ class DestroyCallTest extends TestCase ]); } - public function test_it_removes_emotions() + /** @test */ + public function it_removes_emotions() { $contact = factory(Contact::class)->create([]); $call = factory(Call::class)->create([ @@ -69,7 +71,8 @@ class DestroyCallTest extends TestCase ]); } - public function test_it_updates_the_last_talked_to_information() + /** @test */ + public function it_updates_the_last_talked_to_information() { $contact = factory(Contact::class)->create([ 'last_talked_to' => '2008-01-01', @@ -100,7 +103,8 @@ class DestroyCallTest extends TestCase ]); } - public function test_it_doesnt_update_the_last_talked_to_information() + /** @test */ + public function it_doesnt_update_the_last_talked_to_information() { $contact = factory(Contact::class)->create([ 'last_talked_to' => '2008-01-01', diff --git a/tests/Unit/Services/Contact/Call/UpdateCallTest.php b/tests/Unit/Services/Contact/Call/UpdateCallTest.php index 1da8241ef..c0aa07c83 100644 --- a/tests/Unit/Services/Contact/Call/UpdateCallTest.php +++ b/tests/Unit/Services/Contact/Call/UpdateCallTest.php @@ -17,7 +17,8 @@ class UpdateCallTest extends TestCase { use DatabaseTransactions; - public function test_it_updates_a_call() + /** @test */ + public function it_updates_a_call() { $contact = factory(Contact::class)->create([]); $call = factory(Call::class)->create([ @@ -47,7 +48,8 @@ class UpdateCallTest extends TestCase ); } - public function test_it_updates_a_call_and_who_called_info() + /** @test */ + public function it_updates_a_call_and_who_called_info() { $contact = factory(Contact::class)->create([]); $call = factory(Call::class)->create([ @@ -75,7 +77,8 @@ class UpdateCallTest extends TestCase ]); } - public function test_it_updates_a_call_without_the_content() + /** @test */ + public function it_updates_a_call_without_the_content() { $contact = factory(Contact::class)->create([]); $call = factory(Call::class)->create([ @@ -102,7 +105,9 @@ class UpdateCallTest extends TestCase /** * Checks that it adds new emotions. */ - public function test_it_updates_emotions() + + /** @test */ + public function it_updates_emotions() { $contact = factory(Contact::class)->create([]); $call = factory(Call::class)->create([ @@ -151,7 +156,9 @@ class UpdateCallTest extends TestCase /** * Checks that it removes old emotion and add new emotions. */ - public function test_it_deletes_and_updates_emotions() + + /** @test */ + public function it_deletes_and_updates_emotions() { $contact = factory(Contact::class)->create([]); $call = factory(Call::class)->create([ @@ -220,7 +227,8 @@ class UpdateCallTest extends TestCase ]); } - public function test_it_updates_the_last_call_info() + /** @test */ + public function it_updates_the_last_call_info() { $contact = factory(Contact::class)->create([ 'last_talked_to' => '1900-01-01 00:00:00', @@ -246,7 +254,8 @@ class UpdateCallTest extends TestCase ]); } - public function test_it_doesnt_update_the_last_call_info() + /** @test */ + public function it_doesnt_update_the_last_call_info() { $contact = factory(Contact::class)->create([ 'last_talked_to' => '2200-01-01 00:00:00', @@ -272,7 +281,8 @@ class UpdateCallTest extends TestCase ]); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $contact = factory(Contact::class)->create([]); @@ -285,7 +295,8 @@ class UpdateCallTest extends TestCase app(UpdateCall::class)->execute($request); } - public function test_it_throws_an_exception_if_call_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_call_is_not_linked_to_account() { $account = factory(Account::class)->create(); $call = factory(Call::class)->create(); diff --git a/tests/Unit/Services/Contact/Contact/CreateContactTest.php b/tests/Unit/Services/Contact/Contact/CreateContactTest.php index 71b392c01..9ceefb27d 100644 --- a/tests/Unit/Services/Contact/Contact/CreateContactTest.php +++ b/tests/Unit/Services/Contact/Contact/CreateContactTest.php @@ -14,7 +14,8 @@ class CreateContactTest extends TestCase { use DatabaseTransactions; - public function test_it_stores_a_contact() + /** @test */ + public function it_stores_a_contact() { $account = factory(Account::class)->create([]); $gender = factory(Gender::class)->create([ @@ -55,7 +56,8 @@ class CreateContactTest extends TestCase ); } - public function test_it_stores_a_contact_without_gender() + /** @test */ + public function it_stores_a_contact_without_gender() { $account = factory(Account::class)->create([]); $gender = factory(Gender::class)->create([ @@ -89,7 +91,8 @@ class CreateContactTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $account = factory(Account::class)->create([]); $gender = factory(Gender::class)->create([ @@ -112,7 +115,8 @@ class CreateContactTest extends TestCase app(CreateContact::class)->execute($request); } - public function test_it_throws_an_exception_if_account_doesnt_exist() + /** @test */ + public function it_throws_an_exception_if_account_doesnt_exist() { $gender = factory(Gender::class)->create([]); diff --git a/tests/Unit/Services/Contact/Contact/DestroyContactTest.php b/tests/Unit/Services/Contact/Contact/DestroyContactTest.php index 783b723e1..9a332bc07 100644 --- a/tests/Unit/Services/Contact/Contact/DestroyContactTest.php +++ b/tests/Unit/Services/Contact/Contact/DestroyContactTest.php @@ -14,7 +14,8 @@ class DestroyContactTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_a_contact() + /** @test */ + public function it_destroys_a_contact() { $contact = factory(Contact::class)->create([]); @@ -30,7 +31,8 @@ class DestroyContactTest extends TestCase ]); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $contact = factory(Contact::class)->create([]); @@ -43,7 +45,8 @@ class DestroyContactTest extends TestCase app(DestroyContact::class)->execute($request); } - public function test_it_throws_an_exception_if_contact_doesnt_exist() + /** @test */ + public function it_throws_an_exception_if_contact_doesnt_exist() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create([]); diff --git a/tests/Unit/Services/Contact/Contact/SetMeContactTest.php b/tests/Unit/Services/Contact/Contact/SetMeContactTest.php index 941360550..463a825ce 100644 --- a/tests/Unit/Services/Contact/Contact/SetMeContactTest.php +++ b/tests/Unit/Services/Contact/Contact/SetMeContactTest.php @@ -14,7 +14,8 @@ class SetMeContactTest extends TestCase { use DatabaseTransactions; - public function test_it_set_me_as_a_a_contact() + /** @test */ + public function it_set_me_as_a_a_contact() { $user = factory(User::class)->create(); $contact = factory(Contact::class)->create([ @@ -36,7 +37,8 @@ class SetMeContactTest extends TestCase ]); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $user = factory(User::class)->create(); $contact = factory(Contact::class)->create([ @@ -53,7 +55,8 @@ class SetMeContactTest extends TestCase app(SetMeContact::class)->execute($request); } - public function test_it_throws_an_exception_if_contact_not_found() + /** @test */ + public function it_throws_an_exception_if_contact_not_found() { $user = factory(User::class)->create(); $contact = factory(Contact::class)->create(); diff --git a/tests/Unit/Services/Contact/Contact/UpdateBirthdayInformationTest.php b/tests/Unit/Services/Contact/Contact/UpdateBirthdayInformationTest.php index acad35a56..3dde30bc9 100644 --- a/tests/Unit/Services/Contact/Contact/UpdateBirthdayInformationTest.php +++ b/tests/Unit/Services/Contact/Contact/UpdateBirthdayInformationTest.php @@ -13,7 +13,8 @@ class UpdateBirthdayInformationTest extends TestCase { use DatabaseTransactions; - public function test_it_deletes_all_birthday_information() + /** @test */ + public function it_deletes_all_birthday_information() { // to delete birthday information, we need first to update the contact // with its birthday info, then update it again by indicating that @@ -64,7 +65,8 @@ class UpdateBirthdayInformationTest extends TestCase ]); } - public function test_it_sets_a_date_if_age_is_provided() + /** @test */ + public function it_sets_a_date_if_age_is_provided() { $contact = factory(Contact::class)->create([]); @@ -93,7 +95,8 @@ class UpdateBirthdayInformationTest extends TestCase ]); } - public function test_it_sets_a_complete_date() + /** @test */ + public function it_sets_a_complete_date() { $contact = factory(Contact::class)->create([]); @@ -126,7 +129,8 @@ class UpdateBirthdayInformationTest extends TestCase ]); } - public function test_it_sets_a_complete_date_and_sets_a_reminder() + /** @test */ + public function it_sets_a_complete_date_and_sets_a_reminder() { $contact = factory(Contact::class)->create([]); @@ -148,7 +152,8 @@ class UpdateBirthdayInformationTest extends TestCase $this->assertNotNull($contact->birthday_reminder_id); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $contact = factory(Contact::class)->create([]); @@ -167,7 +172,8 @@ class UpdateBirthdayInformationTest extends TestCase app(UpdateBirthdayInformation::class)->execute($request); } - public function test_it_throws_an_exception_if_contact_and_account_are_not_linked() + /** @test */ + public function it_throws_an_exception_if_contact_and_account_are_not_linked() { $contact = factory(Contact::class)->create([]); diff --git a/tests/Unit/Services/Contact/Contact/UpdateContactTest.php b/tests/Unit/Services/Contact/Contact/UpdateContactTest.php index 695f6ea11..c324ca876 100644 --- a/tests/Unit/Services/Contact/Contact/UpdateContactTest.php +++ b/tests/Unit/Services/Contact/Contact/UpdateContactTest.php @@ -12,7 +12,8 @@ class UpdateContactTest extends TestCase { use DatabaseTransactions; - public function test_it_updates_a_contact() + /** @test */ + public function it_updates_a_contact() { $contact = factory(Contact::class)->create([]); @@ -54,7 +55,8 @@ class UpdateContactTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $contact = factory(Contact::class)->create([]); @@ -85,7 +87,8 @@ class UpdateContactTest extends TestCase app(UpdateContact::class)->execute($request); } - public function test_it_throws_an_exception_if_account_doesnt_exist() + /** @test */ + public function it_throws_an_exception_if_account_doesnt_exist() { $contact = factory(Contact::class)->create([]); diff --git a/tests/Unit/Services/Contact/Contact/UpdateDeceasedInformationTest.php b/tests/Unit/Services/Contact/Contact/UpdateDeceasedInformationTest.php index 5ac184ab3..36f200081 100644 --- a/tests/Unit/Services/Contact/Contact/UpdateDeceasedInformationTest.php +++ b/tests/Unit/Services/Contact/Contact/UpdateDeceasedInformationTest.php @@ -14,7 +14,8 @@ class UpdateDeceasedInformationTest extends TestCase { use DatabaseTransactions; - public function test_it_sets_contact_as_not_deceased() + /** @test */ + public function it_sets_contact_as_not_deceased() { // first we are going to update a contact and set it as deceased, // then we are going to update it again and set it as non deceased @@ -56,7 +57,8 @@ class UpdateDeceasedInformationTest extends TestCase ]); } - public function test_it_sets_a_complete_date() + /** @test */ + public function it_sets_a_complete_date() { $contact = factory(Contact::class)->create([]); @@ -89,7 +91,8 @@ class UpdateDeceasedInformationTest extends TestCase ]); } - public function test_it_sets_a_complete_date_with_unknown_year() + /** @test */ + public function it_sets_a_complete_date_with_unknown_year() { $contact = factory(Contact::class)->create([]); @@ -122,7 +125,8 @@ class UpdateDeceasedInformationTest extends TestCase ]); } - public function test_it_sets_a_complete_date_and_sets_a_reminder() + /** @test */ + public function it_sets_a_complete_date_and_sets_a_reminder() { $contact = factory(Contact::class)->create([]); @@ -150,7 +154,8 @@ class UpdateDeceasedInformationTest extends TestCase ]); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $contact = factory(Contact::class)->create([]); @@ -168,7 +173,8 @@ class UpdateDeceasedInformationTest extends TestCase app(UpdateDeceasedInformation::class)->execute($request); } - public function test_it_throws_an_exception_if_contact_and_account_are_not_linked() + /** @test */ + public function it_throws_an_exception_if_contact_and_account_are_not_linked() { $contact = factory(Contact::class)->create([]); @@ -187,7 +193,8 @@ class UpdateDeceasedInformationTest extends TestCase app(UpdateDeceasedInformation::class)->execute($request); } - public function test_it_removes_deceased_reminder() + /** @test */ + public function it_removes_deceased_reminder() { $reminder = factory(Reminder::class)->create([]); $contact = factory(Contact::class)->create([ @@ -213,7 +220,8 @@ class UpdateDeceasedInformationTest extends TestCase ]); } - public function test_it_removes_deceased_special_date() + /** @test */ + public function it_removes_deceased_special_date() { $special_date = factory(SpecialDate::class)->create(); $contact = factory(Contact::class)->create([ diff --git a/tests/Unit/Services/Contact/Conversation/AddMessageToConversationTest.php b/tests/Unit/Services/Contact/Conversation/AddMessageToConversationTest.php index 06a74724a..e82199fa2 100644 --- a/tests/Unit/Services/Contact/Conversation/AddMessageToConversationTest.php +++ b/tests/Unit/Services/Contact/Conversation/AddMessageToConversationTest.php @@ -16,7 +16,8 @@ class AddMessageToConversationTest extends TestCase { use DatabaseTransactions; - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'contact_id' => 1, @@ -28,7 +29,8 @@ class AddMessageToConversationTest extends TestCase app(AddMessageToConversation::class)->execute($request); } - public function test_it_stores_a_message() + /** @test */ + public function it_stores_a_message() { $conversation = factory(Conversation::class)->create([]); @@ -58,7 +60,8 @@ class AddMessageToConversationTest extends TestCase ); } - public function test_it_throws_an_exception_if_contact_is_not_found() + /** @test */ + public function it_throws_an_exception_if_contact_is_not_found() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create([ @@ -81,7 +84,8 @@ class AddMessageToConversationTest extends TestCase app(AddMessageToConversation::class)->execute($request); } - public function test_it_throws_an_exception_if_conversation_is_not_found2() + /** @test */ + public function it_throws_an_exception_if_conversation_is_not_found2() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create([ diff --git a/tests/Unit/Services/Contact/Conversation/CreateConversationTest.php b/tests/Unit/Services/Contact/Conversation/CreateConversationTest.php index a5b8dac3b..eafda9536 100644 --- a/tests/Unit/Services/Contact/Conversation/CreateConversationTest.php +++ b/tests/Unit/Services/Contact/Conversation/CreateConversationTest.php @@ -16,7 +16,8 @@ class CreateConversationTest extends TestCase { use DatabaseTransactions; - public function test_it_stores_a_conversation() + /** @test */ + public function it_stores_a_conversation() { $contact = factory(Contact::class)->create([]); $contactFieldType = factory(ContactFieldType::class)->create([ @@ -45,7 +46,8 @@ class CreateConversationTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $contact = factory(Contact::class)->create([]); @@ -59,7 +61,8 @@ class CreateConversationTest extends TestCase app(CreateConversation::class)->execute($request); } - public function test_it_throws_an_exception_if_contact_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_contact_is_not_linked_to_account() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create(); @@ -79,7 +82,8 @@ class CreateConversationTest extends TestCase app(CreateConversation::class)->execute($request); } - public function test_it_throws_an_exception_if_contactfieldtype_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_contactfieldtype_is_not_linked_to_account() { $contact = factory(Contact::class)->create([]); $contactFieldType = factory(ContactFieldType::class)->create([]); diff --git a/tests/Unit/Services/Contact/Conversation/DestroyConversationTest.php b/tests/Unit/Services/Contact/Conversation/DestroyConversationTest.php index 7e31826db..f1afb31a8 100644 --- a/tests/Unit/Services/Contact/Conversation/DestroyConversationTest.php +++ b/tests/Unit/Services/Contact/Conversation/DestroyConversationTest.php @@ -15,7 +15,8 @@ class DestroyConversationTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_a_conversation() + /** @test */ + public function it_destroys_a_conversation() { $conversation = factory(Conversation::class)->create([ 'happened_at' => '2008-01-01', @@ -37,7 +38,8 @@ class DestroyConversationTest extends TestCase ]); } - public function test_destroying_a_conversation_destroys_corresponding_messages() + /** @test */ + public function destroying_a_conversation_destroys_corresponding_messages() { $conversation = factory(Conversation::class)->create([ 'happened_at' => '2008-01-01', @@ -68,7 +70,8 @@ class DestroyConversationTest extends TestCase ]); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $conversation = factory(Conversation::class)->create([ 'happened_at' => '2008-01-01', @@ -83,7 +86,8 @@ class DestroyConversationTest extends TestCase app(DestroyConversation::class)->execute($request); } - public function test_it_throws_an_exception_if_conversation_doesnt_exist() + /** @test */ + public function it_throws_an_exception_if_conversation_doesnt_exist() { $account = factory(Account::class)->create(); $conversation = factory(Conversation::class)->create([]); diff --git a/tests/Unit/Services/Contact/Conversation/DestroyMessageTest.php b/tests/Unit/Services/Contact/Conversation/DestroyMessageTest.php index c1aef9264..1615236f4 100644 --- a/tests/Unit/Services/Contact/Conversation/DestroyMessageTest.php +++ b/tests/Unit/Services/Contact/Conversation/DestroyMessageTest.php @@ -14,7 +14,8 @@ class DestroyMessageTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_a_message() + /** @test */ + public function it_destroys_a_message() { $conversation = factory(Conversation::class)->create([]); @@ -44,7 +45,8 @@ class DestroyMessageTest extends TestCase ]); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'conversation_id' => 2, @@ -56,7 +58,8 @@ class DestroyMessageTest extends TestCase app(DestroyMessage::class)->execute($request); } - public function test_it_throws_an_exception_if_message_doesnt_exist() + /** @test */ + public function it_throws_an_exception_if_message_doesnt_exist() { $conversation = factory(Conversation::class)->create([]); $message = factory(Message::class)->create([]); diff --git a/tests/Unit/Services/Contact/Conversation/UpdateConversationTest.php b/tests/Unit/Services/Contact/Conversation/UpdateConversationTest.php index a394bf202..86b59a2b0 100644 --- a/tests/Unit/Services/Contact/Conversation/UpdateConversationTest.php +++ b/tests/Unit/Services/Contact/Conversation/UpdateConversationTest.php @@ -16,7 +16,8 @@ class UpdateConversationTest extends TestCase { use DatabaseTransactions; - public function test_it_updates_a_conversation() + /** @test */ + public function it_updates_a_conversation() { $conversation = factory(Conversation::class)->create([ 'happened_at' => '2008-01-01', @@ -46,7 +47,8 @@ class UpdateConversationTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $contact = factory(Contact::class)->create([]); @@ -60,7 +62,8 @@ class UpdateConversationTest extends TestCase app(UpdateConversation::class)->execute($request); } - public function test_it_throws_an_exception_if_conversation_doesnt_exist() + /** @test */ + public function it_throws_an_exception_if_conversation_doesnt_exist() { $account = factory(Account::class)->create(); $conversation = factory(Conversation::class)->create([]); diff --git a/tests/Unit/Services/Contact/Conversation/UpdateMessageTest.php b/tests/Unit/Services/Contact/Conversation/UpdateMessageTest.php index 7673753ae..69df48343 100644 --- a/tests/Unit/Services/Contact/Conversation/UpdateMessageTest.php +++ b/tests/Unit/Services/Contact/Conversation/UpdateMessageTest.php @@ -16,7 +16,8 @@ class UpdateMessageTest extends TestCase { use DatabaseTransactions; - public function test_it_updates_a_conversation() + /** @test */ + public function it_updates_a_conversation() { $conversation = factory(Conversation::class)->create([]); @@ -56,7 +57,8 @@ class UpdateMessageTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'account_id' => 1, @@ -72,7 +74,8 @@ class UpdateMessageTest extends TestCase app(UpdateMessage::class)->execute($request); } - public function test_it_throws_an_exception_if_message_does_not_exist() + /** @test */ + public function it_throws_an_exception_if_message_does_not_exist() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create([ diff --git a/tests/Unit/Services/Contact/Document/DestroyDocumentTest.php b/tests/Unit/Services/Contact/Document/DestroyDocumentTest.php index 57586dc42..469937d36 100644 --- a/tests/Unit/Services/Contact/Document/DestroyDocumentTest.php +++ b/tests/Unit/Services/Contact/Document/DestroyDocumentTest.php @@ -17,7 +17,8 @@ class DestroyDocumentTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_a_document() + /** @test */ + public function it_destroys_a_document() { Storage::fake(); @@ -42,7 +43,8 @@ class DestroyDocumentTest extends TestCase Storage::disk('public')->assertMissing($document->new_filename); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'document_id' => 2, @@ -53,7 +55,8 @@ class DestroyDocumentTest extends TestCase app(DestroyDocument::class)->execute($request); } - public function test_it_throws_a_document_doesnt_exist() + /** @test */ + public function it_throws_a_document_doesnt_exist() { $document = factory(Document::class)->create([]); diff --git a/tests/Unit/Services/Contact/Document/UploadDocumentTest.php b/tests/Unit/Services/Contact/Document/UploadDocumentTest.php index d487fbcf4..559d356ca 100644 --- a/tests/Unit/Services/Contact/Document/UploadDocumentTest.php +++ b/tests/Unit/Services/Contact/Document/UploadDocumentTest.php @@ -17,7 +17,8 @@ class UploadDocumentTest extends TestCase { use DatabaseTransactions; - public function test_it_uploads_a_document() + /** @test */ + public function it_uploads_a_document() { Storage::fake(); @@ -48,7 +49,8 @@ class UploadDocumentTest extends TestCase Storage::disk('public')->assertExists($document->new_filename); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'account_id' => 1, @@ -60,7 +62,8 @@ class UploadDocumentTest extends TestCase app(UploadDocument::class)->execute($request); } - public function test_it_throws_an_exception_if_contact_does_not_exist() + /** @test */ + public function it_throws_an_exception_if_contact_does_not_exist() { Storage::fake(); diff --git a/tests/Unit/Services/Contact/LifeEvent/CreateLifeEventTest.php b/tests/Unit/Services/Contact/LifeEvent/CreateLifeEventTest.php index 06676263f..0ef36c6b1 100644 --- a/tests/Unit/Services/Contact/LifeEvent/CreateLifeEventTest.php +++ b/tests/Unit/Services/Contact/LifeEvent/CreateLifeEventTest.php @@ -16,7 +16,8 @@ class CreateLifeEventTest extends TestCase { use DatabaseTransactions; - public function test_it_stores_a_life_event() + /** @test */ + public function it_stores_a_life_event() { $contact = factory(Contact::class)->create([]); $lifeEventType = factory(LifeEventType::class)->create([ @@ -53,7 +54,8 @@ class CreateLifeEventTest extends TestCase ); } - public function test_it_stores_a_life_event_and_set_a_reminder() + /** @test */ + public function it_stores_a_life_event_and_set_a_reminder() { $contact = factory(Contact::class)->create([]); $lifeEventType = factory(LifeEventType::class)->create([ @@ -83,7 +85,8 @@ class CreateLifeEventTest extends TestCase ]); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $contact = factory(Contact::class)->create([]); @@ -97,7 +100,8 @@ class CreateLifeEventTest extends TestCase app(CreateLifeEvent::class)->execute($request); } - public function test_it_throws_an_exception_if_contact_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_contact_is_not_linked_to_account() { $account = factory(Account::class)->create(); $lifeEvent = factory(LifeEvent::class)->create([]); @@ -119,7 +123,8 @@ class CreateLifeEventTest extends TestCase app(CreateLifeEvent::class)->execute($request); } - public function test_it_throws_an_exception_if_life_event_type_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_life_event_type_is_not_linked_to_account() { $contact = factory(Contact::class)->create([]); $lifeEventType = factory(LifeEventType::class)->create([]); diff --git a/tests/Unit/Services/Contact/LifeEvent/DestroyLifeEventTest.php b/tests/Unit/Services/Contact/LifeEvent/DestroyLifeEventTest.php index dd875a8e3..dd35c69cc 100644 --- a/tests/Unit/Services/Contact/LifeEvent/DestroyLifeEventTest.php +++ b/tests/Unit/Services/Contact/LifeEvent/DestroyLifeEventTest.php @@ -15,7 +15,8 @@ class DestroyLifeEventTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_a_life_event() + /** @test */ + public function it_destroys_a_life_event() { $lifeEvent = factory(LifeEvent::class)->create([]); @@ -35,7 +36,8 @@ class DestroyLifeEventTest extends TestCase ]); } - public function test_it_destroys_a_life_event_and_associated_reminder() + /** @test */ + public function it_destroys_a_life_event_and_associated_reminder() { $lifeEvent = factory(LifeEvent::class)->create([]); $reminder = factory(Reminder::class)->create([ @@ -56,7 +58,8 @@ class DestroyLifeEventTest extends TestCase ]); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'account_id' => 1, @@ -67,7 +70,8 @@ class DestroyLifeEventTest extends TestCase app(DestroyLifeEvent::class)->execute($request); } - public function test_it_throws_an_exception_if_life_event_doesnt_exist() + /** @test */ + public function it_throws_an_exception_if_life_event_doesnt_exist() { $account = factory(Account::class)->create(); $lifeEvent = factory(LifeEvent::class)->create([]); diff --git a/tests/Unit/Services/Contact/LifeEvent/UpdateLifeEventTest.php b/tests/Unit/Services/Contact/LifeEvent/UpdateLifeEventTest.php index 1523c766e..2bb890fb7 100644 --- a/tests/Unit/Services/Contact/LifeEvent/UpdateLifeEventTest.php +++ b/tests/Unit/Services/Contact/LifeEvent/UpdateLifeEventTest.php @@ -16,7 +16,8 @@ class UpdateLifeEventTest extends TestCase { use DatabaseTransactions; - public function test_it_updates_a_life_event() + /** @test */ + public function it_updates_a_life_event() { $lifeEvent = factory(LifeEvent::class)->create([ 'happened_at' => '2008-01-01', @@ -52,7 +53,8 @@ class UpdateLifeEventTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $contact = factory(Contact::class)->create([]); @@ -66,7 +68,8 @@ class UpdateLifeEventTest extends TestCase app(UpdateLifeEvent::class)->execute($request); } - public function test_it_throws_an_exception_if_life_type_doesnt_exist() + /** @test */ + public function it_throws_an_exception_if_life_type_doesnt_exist() { $account = factory(Account::class)->create(); $lifeEvent = factory(LifeEvent::class)->create([]); diff --git a/tests/Unit/Services/Contact/Occupation/CreateOccupationTest.php b/tests/Unit/Services/Contact/Occupation/CreateOccupationTest.php index 63b11f0a7..1b01cf644 100644 --- a/tests/Unit/Services/Contact/Occupation/CreateOccupationTest.php +++ b/tests/Unit/Services/Contact/Occupation/CreateOccupationTest.php @@ -15,7 +15,8 @@ class CreateOccupationTest extends TestCase { use DatabaseTransactions; - public function test_it_stores_an_occupation() + /** @test */ + public function it_stores_an_occupation() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create([ @@ -47,7 +48,8 @@ class CreateOccupationTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $account = factory(Account::class)->create([]); diff --git a/tests/Unit/Services/Contact/Occupation/DestroyOccupationTest.php b/tests/Unit/Services/Contact/Occupation/DestroyOccupationTest.php index 6e59a9556..35f2d8c87 100644 --- a/tests/Unit/Services/Contact/Occupation/DestroyOccupationTest.php +++ b/tests/Unit/Services/Contact/Occupation/DestroyOccupationTest.php @@ -11,7 +11,8 @@ class DestroyOccupationTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_a_occupation() + /** @test */ + public function it_destroys_a_occupation() { $occupation = factory(Occupation::class)->create([]); diff --git a/tests/Unit/Services/Contact/Occupation/UpdateOccupationTest.php b/tests/Unit/Services/Contact/Occupation/UpdateOccupationTest.php index d961e4c3d..c3bf3fa52 100644 --- a/tests/Unit/Services/Contact/Occupation/UpdateOccupationTest.php +++ b/tests/Unit/Services/Contact/Occupation/UpdateOccupationTest.php @@ -14,7 +14,8 @@ class UpdateOccupationTest extends TestCase { use DatabaseTransactions; - public function test_it_updates_an_occupation() + /** @test */ + public function it_updates_an_occupation() { $occupation = factory(Occupation::class)->create([]); @@ -45,7 +46,8 @@ class UpdateOccupationTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $occupation = factory(Occupation::class)->create([]); @@ -57,7 +59,8 @@ class UpdateOccupationTest extends TestCase app(UpdateOccupation::class)->execute($request); } - public function test_it_throws_an_exception_if_occupation_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_occupation_is_not_linked_to_account() { $account = factory(Account::class)->create([]); $occupation = factory(Occupation::class)->create([]); diff --git a/tests/Unit/Services/Contact/Relationship/CreateRelationshipTest.php b/tests/Unit/Services/Contact/Relationship/CreateRelationshipTest.php index 10de246ea..5e8adc32e 100644 --- a/tests/Unit/Services/Contact/Relationship/CreateRelationshipTest.php +++ b/tests/Unit/Services/Contact/Relationship/CreateRelationshipTest.php @@ -14,7 +14,8 @@ class CreateRelationshipTest extends TestCase { use DatabaseTransactions; - public function test_it_stores_a_relationship() + /** @test */ + public function it_stores_a_relationship() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create([ @@ -45,7 +46,8 @@ class CreateRelationshipTest extends TestCase ]); } - public function test_it_fails_adding_relationship_when_relationship_type_is_unknown() + /** @test */ + public function it_fails_adding_relationship_when_relationship_type_is_unknown() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create([ @@ -68,7 +70,8 @@ class CreateRelationshipTest extends TestCase app(CreateRelationship::class)->execute($request); } - public function test_it_throws_an_exception_if_contact_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_contact_is_not_linked_to_account() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create(); @@ -90,7 +93,8 @@ class CreateRelationshipTest extends TestCase app(CreateRelationship::class)->execute($request); } - public function test_it_throws_an_exception_if_other_contact_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_other_contact_is_not_linked_to_account() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create([ @@ -113,7 +117,8 @@ class CreateRelationshipTest extends TestCase app(CreateRelationship::class)->execute($request); } - public function test_it_creates_a_relationship_and_reverse() + /** @test */ + public function it_creates_a_relationship_and_reverse() { $account = factory(Account::class)->create(); $contactA = factory(Contact::class)->create([ diff --git a/tests/Unit/Services/Contact/Relationship/DestroyRelationshipTest.php b/tests/Unit/Services/Contact/Relationship/DestroyRelationshipTest.php index 82e830ca8..dcf095edd 100644 --- a/tests/Unit/Services/Contact/Relationship/DestroyRelationshipTest.php +++ b/tests/Unit/Services/Contact/Relationship/DestroyRelationshipTest.php @@ -16,7 +16,8 @@ class DestroyRelationshipTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_a_relationship() + /** @test */ + public function it_destroys_a_relationship() { $contactA = factory(Contact::class)->create([]); $contactB = factory(Contact::class)->create([ @@ -41,7 +42,8 @@ class DestroyRelationshipTest extends TestCase ]); } - public function test_it_destroys_a_relationship_and_reverse() + /** @test */ + public function it_destroys_a_relationship_and_reverse() { $contactA = factory(Contact::class)->create([]); $contactB = factory(Contact::class)->create([ @@ -94,7 +96,8 @@ class DestroyRelationshipTest extends TestCase ]); } - public function test_it_destroys_a_relationship_and_reverse_and_partial_contact() + /** @test */ + public function it_destroys_a_relationship_and_reverse_and_partial_contact() { $contactA = factory(Contact::class)->create([]); $contactB = factory(Contact::class)->create([ @@ -151,7 +154,8 @@ class DestroyRelationshipTest extends TestCase ]); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $account = factory(Account::class)->create([]); @@ -164,7 +168,8 @@ class DestroyRelationshipTest extends TestCase app(DestroyRelationship::class)->execute($request); } - public function test_it_throws_an_exception_if_relationship_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_relationship_is_not_linked_to_account() { $account = factory(Account::class)->create(); $relationship = factory(Relationship::class)->create([]); @@ -179,7 +184,8 @@ class DestroyRelationshipTest extends TestCase app(DestroyRelationship::class)->execute($request); } - public function test_it_deletes_relationship_between_two_contacts_and_deletes_the_contact() + /** @test */ + public function it_deletes_relationship_between_two_contacts_and_deletes_the_contact() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -212,7 +218,8 @@ class DestroyRelationshipTest extends TestCase ); } - public function test_it_deletes_relationship_between_two_contacts_and_doesnt_delete_the_contact() + /** @test */ + public function it_deletes_relationship_between_two_contacts_and_doesnt_delete_the_contact() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create(['account_id' => $account->id]); diff --git a/tests/Unit/Services/Contact/Relationship/UpdateRelationshipTest.php b/tests/Unit/Services/Contact/Relationship/UpdateRelationshipTest.php index 2acf5b1c0..c58c806b7 100644 --- a/tests/Unit/Services/Contact/Relationship/UpdateRelationshipTest.php +++ b/tests/Unit/Services/Contact/Relationship/UpdateRelationshipTest.php @@ -16,7 +16,8 @@ class UpdateRelationshipTest extends TestCase { use DatabaseTransactions; - public function test_it_updates_a_relationship() + /** @test */ + public function it_updates_a_relationship() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create([ @@ -72,7 +73,8 @@ class UpdateRelationshipTest extends TestCase ]); } - public function test_it_updates_a_partial_relationship() + /** @test */ + public function it_updates_a_partial_relationship() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create([ @@ -113,7 +115,8 @@ class UpdateRelationshipTest extends TestCase ]); } - public function test_it_throws_an_exception_if_relationship_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_relationship_is_not_linked_to_account() { $account = factory(Account::class)->create(); $relationship = factory(Relationship::class)->create(); @@ -132,7 +135,8 @@ class UpdateRelationshipTest extends TestCase app(UpdateRelationship::class)->execute($request); } - public function test_it_throws_an_exception_if_relationship_type_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_relationship_type_is_not_linked_to_account() { $account = factory(Account::class)->create(); $relationship = factory(Relationship::class)->create([ diff --git a/tests/Unit/Services/Contact/Reminder/CreateReminderTest.php b/tests/Unit/Services/Contact/Reminder/CreateReminderTest.php index c00eff949..e3dae6d35 100644 --- a/tests/Unit/Services/Contact/Reminder/CreateReminderTest.php +++ b/tests/Unit/Services/Contact/Reminder/CreateReminderTest.php @@ -17,7 +17,8 @@ class CreateReminderTest extends TestCase { use DatabaseTransactions; - public function test_it_stores_a_recurring_reminder() + /** @test */ + public function it_stores_a_recurring_reminder() { Carbon::setTestNow(Carbon::create(2017, 1, 1)); $user = factory(User::class)->create([]); @@ -56,7 +57,8 @@ class CreateReminderTest extends TestCase ]); } - public function test_it_stores_a_one_time_reminder() + /** @test */ + public function it_stores_a_one_time_reminder() { Carbon::setTestNow(Carbon::create(2017, 1, 1)); $user = factory(User::class)->create([]); @@ -95,7 +97,8 @@ class CreateReminderTest extends TestCase ]); } - public function test_it_stores_a_reminder_for_each_user_of_an_account() + /** @test */ + public function it_stores_a_reminder_for_each_user_of_an_account() { Carbon::setTestNow(Carbon::create(2017, 1, 1)); $account = factory(Account::class)->create([]); @@ -148,7 +151,8 @@ class CreateReminderTest extends TestCase ]); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $contact = factory(Contact::class)->create([]); @@ -162,7 +166,8 @@ class CreateReminderTest extends TestCase $reminderService = app(CreateReminder::class)->execute($request); } - public function test_it_throws_an_exception_if_ids_are_not_found() + /** @test */ + public function it_throws_an_exception_if_ids_are_not_found() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create([]); @@ -196,7 +201,8 @@ class CreateReminderTest extends TestCase $reminderService = app(CreateReminder::class)->execute($request); } - public function test_it_throws_an_exception_if_frequency_type_is_not_right() + /** @test */ + public function it_throws_an_exception_if_frequency_type_is_not_right() { $contact = factory(Contact::class)->create([]); diff --git a/tests/Unit/Services/Contact/Reminder/DestroyReminderTest.php b/tests/Unit/Services/Contact/Reminder/DestroyReminderTest.php index 9f4cf81ed..0e778d585 100644 --- a/tests/Unit/Services/Contact/Reminder/DestroyReminderTest.php +++ b/tests/Unit/Services/Contact/Reminder/DestroyReminderTest.php @@ -14,7 +14,8 @@ class DestroyReminderTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_a_reminder() + /** @test */ + public function it_destroys_a_reminder() { $reminder = factory(Reminder::class)->create([ 'initial_date' => '2017-02-02', @@ -40,7 +41,8 @@ class DestroyReminderTest extends TestCase ]); } - public function test_it_destroys_scheduled_reminders() + /** @test */ + public function it_destroys_scheduled_reminders() { // prepare a reminder and schedule some notifications Carbon::setTestNow(Carbon::create(2017, 2, 1)); diff --git a/tests/Unit/Services/Contact/Reminder/UpdateReminderTest.php b/tests/Unit/Services/Contact/Reminder/UpdateReminderTest.php index e0ae3a791..579162a70 100644 --- a/tests/Unit/Services/Contact/Reminder/UpdateReminderTest.php +++ b/tests/Unit/Services/Contact/Reminder/UpdateReminderTest.php @@ -15,7 +15,8 @@ class UpdateReminderTest extends TestCase { use DatabaseTransactions; - public function test_it_updates_a_reminder() + /** @test */ + public function it_updates_a_reminder() { Carbon::setTestNow(Carbon::create(2017, 1, 1)); $user = factory(User::class)->create([]); @@ -60,7 +61,8 @@ class UpdateReminderTest extends TestCase ]); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $contact = factory(Contact::class)->create([]); @@ -74,7 +76,8 @@ class UpdateReminderTest extends TestCase app(UpdateReminder::class)->execute($request); } - public function test_it_throws_an_exception_if_frequency_type_is_not_right() + /** @test */ + public function it_throws_an_exception_if_frequency_type_is_not_right() { $reminder = factory(Reminder::class)->create([ 'initial_date' => '2017-02-02', diff --git a/tests/Unit/Services/Contact/Tag/AssociateTagTest.php b/tests/Unit/Services/Contact/Tag/AssociateTagTest.php index af0466100..7f67dc387 100644 --- a/tests/Unit/Services/Contact/Tag/AssociateTagTest.php +++ b/tests/Unit/Services/Contact/Tag/AssociateTagTest.php @@ -15,7 +15,8 @@ class AssociateTagTest extends TestCase { use DatabaseTransactions; - public function test_it_sets_a_non_english_tag_to_a_contact_when_tag_doesnt_exist_yet() + /** @test */ + public function it_sets_a_non_english_tag_to_a_contact_when_tag_doesnt_exist_yet() { $contact = factory(Contact::class)->create([]); @@ -45,7 +46,8 @@ class AssociateTagTest extends TestCase ); } - public function test_it_sets_a_tag_to_a_contact_when_tag_doesnt_exist_yet() + /** @test */ + public function it_sets_a_tag_to_a_contact_when_tag_doesnt_exist_yet() { $contact = factory(Contact::class)->create([]); @@ -75,7 +77,8 @@ class AssociateTagTest extends TestCase ); } - public function test_it_sets_a_tag_to_a_contact_when_tag_does_exist_yet() + /** @test */ + public function it_sets_a_tag_to_a_contact_when_tag_does_exist_yet() { $contact = factory(Contact::class)->create([]); $tag = factory(Tag::class)->create([ @@ -120,7 +123,8 @@ class AssociateTagTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'account_id' => 1, @@ -132,7 +136,8 @@ class AssociateTagTest extends TestCase app(AssociateTag::class)->execute($request); } - public function test_it_throws_an_exception_if_contact_does_not_exist() + /** @test */ + public function it_throws_an_exception_if_contact_does_not_exist() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create(); diff --git a/tests/Unit/Services/Contact/Tag/CreateTagTest.php b/tests/Unit/Services/Contact/Tag/CreateTagTest.php index 7e7f40330..76bc3c400 100644 --- a/tests/Unit/Services/Contact/Tag/CreateTagTest.php +++ b/tests/Unit/Services/Contact/Tag/CreateTagTest.php @@ -12,7 +12,8 @@ class CreateTagTest extends TestCase { use DatabaseTransactions; - public function test_it_creates_a_tag() + /** @test */ + public function it_creates_a_tag() { $tag = factory(Tag::class)->create([]); @@ -35,7 +36,8 @@ class CreateTagTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'account_id' => 1, diff --git a/tests/Unit/Services/Contact/Tag/DestroyTagTest.php b/tests/Unit/Services/Contact/Tag/DestroyTagTest.php index 254cd7202..d0371a462 100644 --- a/tests/Unit/Services/Contact/Tag/DestroyTagTest.php +++ b/tests/Unit/Services/Contact/Tag/DestroyTagTest.php @@ -15,7 +15,8 @@ class DestroyTagTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_a_tag() + /** @test */ + public function it_destroys_a_tag() { $contact = factory(Contact::class)->create([]); @@ -54,7 +55,8 @@ class DestroyTagTest extends TestCase ]); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'account_id' => 1, @@ -65,7 +67,8 @@ class DestroyTagTest extends TestCase app(DestroyTag::class)->execute($request); } - public function test_it_throws_an_exception_if_tag_does_not_exist() + /** @test */ + public function it_throws_an_exception_if_tag_does_not_exist() { $account = factory(Account::class)->create(); diff --git a/tests/Unit/Services/Contact/Tag/DetachTagTest.php b/tests/Unit/Services/Contact/Tag/DetachTagTest.php index e0f9f0970..ec3c97cbd 100644 --- a/tests/Unit/Services/Contact/Tag/DetachTagTest.php +++ b/tests/Unit/Services/Contact/Tag/DetachTagTest.php @@ -15,7 +15,8 @@ class DetachTagTest extends TestCase { use DatabaseTransactions; - public function test_it_detachs_a_tag() + /** @test */ + public function it_detachs_a_tag() { $contact = factory(Contact::class)->create([]); @@ -49,7 +50,8 @@ class DetachTagTest extends TestCase ]); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'account_id' => 1, @@ -60,7 +62,8 @@ class DetachTagTest extends TestCase app(DetachTag::class)->execute($request); } - public function test_it_throws_an_exception_if_contact_does_not_exist() + /** @test */ + public function it_throws_an_exception_if_contact_does_not_exist() { $account = factory(Account::class)->create(); $tag = factory(Tag::class)->create([ diff --git a/tests/Unit/Services/Contact/Tag/UpdateTagTest.php b/tests/Unit/Services/Contact/Tag/UpdateTagTest.php index e34f9b35d..596d94038 100644 --- a/tests/Unit/Services/Contact/Tag/UpdateTagTest.php +++ b/tests/Unit/Services/Contact/Tag/UpdateTagTest.php @@ -14,7 +14,8 @@ class UpdateTagTest extends TestCase { use DatabaseTransactions; - public function test_it_updates_a_tag() + /** @test */ + public function it_updates_a_tag() { $tag = factory(Tag::class)->create([]); @@ -38,7 +39,8 @@ class UpdateTagTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'account_id' => 1, @@ -50,7 +52,8 @@ class UpdateTagTest extends TestCase app(UpdateTag::class)->execute($request); } - public function test_it_throws_an_exception_if_tag_does_not_exist() + /** @test */ + public function it_throws_an_exception_if_tag_does_not_exist() { $account = factory(Account::class)->create(); diff --git a/tests/Unit/Services/Instance/Geolocalization/GetGPSCoordinateTest.php b/tests/Unit/Services/Instance/Geolocalization/GetGPSCoordinateTest.php index 42bc7dae1..ff8d87aa4 100644 --- a/tests/Unit/Services/Instance/Geolocalization/GetGPSCoordinateTest.php +++ b/tests/Unit/Services/Instance/Geolocalization/GetGPSCoordinateTest.php @@ -16,7 +16,8 @@ class GetGPSCoordinateTest extends TestCase { use DatabaseTransactions; - public function test_it_returns_null_if_geolocation_is_disabled() + /** @test */ + public function it_returns_null_if_geolocation_is_disabled() { config(['monica.enable_geolocation' => false]); @@ -32,7 +33,8 @@ class GetGPSCoordinateTest extends TestCase $this->assertNull($place); } - public function test_it_gets_gps_coordinates() + /** @test */ + public function it_gets_gps_coordinates() { config(['monica.enable_geolocation' => true]); config(['monica.location_iq_api_key' => 'test']); @@ -61,7 +63,8 @@ class GetGPSCoordinateTest extends TestCase ); } - public function test_it_returns_null_if_address_is_garbage() + /** @test */ + public function it_returns_null_if_address_is_garbage() { config(['monica.enable_geolocation' => true]); config(['monica.location_iq_api_key' => 'test']); @@ -88,7 +91,8 @@ class GetGPSCoordinateTest extends TestCase $this->assertNull($place); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'account_id' => 111, diff --git a/tests/Unit/Services/Instance/TokenCleanTest.php b/tests/Unit/Services/Instance/TokenCleanTest.php index 3ac9c23f5..bf9b9951d 100644 --- a/tests/Unit/Services/Instance/TokenCleanTest.php +++ b/tests/Unit/Services/Instance/TokenCleanTest.php @@ -15,7 +15,8 @@ class TokenCleanTest extends TestCase use DatabaseTransactions, PHPUnitAssertions; - public function test_tokenclean_left_one_token() + /** @test */ + public function tokenclean_left_one_token() { $account = factory(Account::class)->create(); $user = factory(User::class)->create([ @@ -37,7 +38,8 @@ class TokenCleanTest extends TestCase ]); } - public function test_tokenclean_left_all_token() + /** @test */ + public function tokenclean_left_all_token() { $account = factory(Account::class)->create(); $user = factory(User::class)->create([ diff --git a/tests/Unit/Services/Instance/Weather/GetWeatherInformationTest.php b/tests/Unit/Services/Instance/Weather/GetWeatherInformationTest.php index 2677954bf..d807a4080 100644 --- a/tests/Unit/Services/Instance/Weather/GetWeatherInformationTest.php +++ b/tests/Unit/Services/Instance/Weather/GetWeatherInformationTest.php @@ -18,7 +18,8 @@ class GetWeatherInformationTest extends TestCase { use DatabaseTransactions; - public function test_it_gets_weather_information() + /** @test */ + public function it_gets_weather_information() { $place = factory(Place::class)->create([ 'latitude' => '34.112456', @@ -56,7 +57,8 @@ class GetWeatherInformationTest extends TestCase ); } - public function test_it_cant_get_weather_info_if_weather_not_enabled() + /** @test */ + public function it_cant_get_weather_info_if_weather_not_enabled() { $place = factory(Place::class)->create([ 'latitude' => '34.112456', @@ -73,7 +75,8 @@ class GetWeatherInformationTest extends TestCase app(GetWeatherInformation::class)->execute($request); } - public function test_it_cant_get_weather_info_if_darksky_api_key_not_provided() + /** @test */ + public function it_cant_get_weather_info_if_darksky_api_key_not_provided() { $place = factory(Place::class)->create([ 'latitude' => '34.112456', @@ -91,7 +94,8 @@ class GetWeatherInformationTest extends TestCase app(GetWeatherInformation::class)->execute($request); } - public function test_it_cant_get_weather_info_if_latitude_longitude_are_null() + /** @test */ + public function it_cant_get_weather_info_if_latitude_longitude_are_null() { $place = factory(Place::class)->create([]); @@ -106,7 +110,8 @@ class GetWeatherInformationTest extends TestCase $this->assertNull(app(GetWeatherInformation::class)->execute($request)); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { config(['monica.enable_weather' => true]); config(['monica.darksky_api_key' => 'test']); diff --git a/tests/Unit/Services/Task/CreateTaskTest.php b/tests/Unit/Services/Task/CreateTaskTest.php index 0ce77886f..329498bff 100644 --- a/tests/Unit/Services/Task/CreateTaskTest.php +++ b/tests/Unit/Services/Task/CreateTaskTest.php @@ -15,7 +15,8 @@ class CreateTaskTest extends TestCase { use DatabaseTransactions; - public function test_it_stores_a_task() + /** @test */ + public function it_stores_a_task() { $contact = factory(Contact::class)->create([]); @@ -41,7 +42,8 @@ class CreateTaskTest extends TestCase ); } - public function test_it_stores_a_task_without_contact_id() + /** @test */ + public function it_stores_a_task_without_contact_id() { $contact = factory(Contact::class)->create([]); @@ -66,7 +68,8 @@ class CreateTaskTest extends TestCase ); } - public function test_it_stores_a_task_without_description() + /** @test */ + public function it_stores_a_task_without_description() { $contact = factory(Contact::class)->create([]); @@ -91,7 +94,8 @@ class CreateTaskTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $contact = factory(Contact::class)->create([]); @@ -105,7 +109,8 @@ class CreateTaskTest extends TestCase app(CreateTask::class)->execute($request); } - public function test_it_throws_an_exception_if_contact_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_contact_is_not_linked_to_account() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create(); diff --git a/tests/Unit/Services/Task/DestroyTaskTest.php b/tests/Unit/Services/Task/DestroyTaskTest.php index f5bb05699..5d015a1eb 100644 --- a/tests/Unit/Services/Task/DestroyTaskTest.php +++ b/tests/Unit/Services/Task/DestroyTaskTest.php @@ -14,7 +14,8 @@ class DestroyTaskTest extends TestCase { use DatabaseTransactions; - public function test_it_destroys_a_task() + /** @test */ + public function it_destroys_a_task() { $task = factory(Task::class)->create([]); @@ -34,7 +35,8 @@ class DestroyTaskTest extends TestCase ]); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $request = [ 'task_id' => 2, @@ -45,7 +47,8 @@ class DestroyTaskTest extends TestCase app(DestroyTask::class)->execute($request); } - public function test_it_throws_a_task_doesnt_exist() + /** @test */ + public function it_throws_a_task_doesnt_exist() { $task = factory(Task::class)->create([]); $account = factory(Account::class)->create([]); diff --git a/tests/Unit/Services/Task/UpdateTaskTest.php b/tests/Unit/Services/Task/UpdateTaskTest.php index 79bb7e198..344e0d46c 100644 --- a/tests/Unit/Services/Task/UpdateTaskTest.php +++ b/tests/Unit/Services/Task/UpdateTaskTest.php @@ -15,7 +15,8 @@ class UpdateTaskTest extends TestCase { use DatabaseTransactions; - public function test_it_updates_a_task_associated_with_a_contact() + /** @test */ + public function it_updates_a_task_associated_with_a_contact() { $task = factory(Task::class)->create([]); @@ -44,7 +45,8 @@ class UpdateTaskTest extends TestCase ); } - public function test_it_updates_a_task_associated_without_a_contact() + /** @test */ + public function it_updates_a_task_associated_without_a_contact() { $task = factory(Task::class)->create([ 'contact_id' => null, @@ -74,7 +76,8 @@ class UpdateTaskTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $task = factory(Task::class)->create([]); @@ -90,7 +93,8 @@ class UpdateTaskTest extends TestCase app(UpdateTask::class)->execute($request); } - public function test_it_throws_an_exception_if_contact_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_contact_is_not_linked_to_account() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create(); @@ -110,7 +114,8 @@ class UpdateTaskTest extends TestCase app(UpdateTask::class)->execute($request); } - public function test_it_throws_an_exception_if_task_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_task_is_not_linked_to_account() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create(); diff --git a/tests/Unit/Services/User/EmailChangeTest.php b/tests/Unit/Services/User/EmailChangeTest.php index f59144ea9..25c6cc6ac 100644 --- a/tests/Unit/Services/User/EmailChangeTest.php +++ b/tests/Unit/Services/User/EmailChangeTest.php @@ -16,7 +16,8 @@ class EmailChangeTest extends TestCase { use DatabaseTransactions; - public function test_it_update_user_email() + /** @test */ + public function it_updates_user_email() { NotificationFacade::fake(); config(['monica.signup_double_optin' => false]); @@ -46,7 +47,8 @@ class EmailChangeTest extends TestCase ); } - public function test_it_fails_if_wrong_parameters_are_given() + /** @test */ + public function it_fails_if_wrong_parameters_are_given() { $user = factory(User::class)->create([]); @@ -59,7 +61,8 @@ class EmailChangeTest extends TestCase app(EmailChange::class)->execute($request); } - public function test_it_throws_an_exception_if_user_is_not_linked_to_account() + /** @test */ + public function it_throws_an_exception_if_user_is_not_linked_to_account() { $account = factory(Account::class)->create(); $user = factory(User::class)->create(); @@ -75,7 +78,8 @@ class EmailChangeTest extends TestCase app(EmailChange::class)->execute($request); } - public function test_it_update_user_email_and_send_confirmation() + /** @test */ + public function it_updates_user_email_and_send_confirmation() { NotificationFacade::fake(); config(['monica.signup_double_optin' => true]); @@ -104,7 +108,8 @@ class EmailChangeTest extends TestCase ); } - public function test_it_send_confirmation_email() + /** @test */ + public function it_sends_confirmation_email() { NotificationFacade::fake(); config(['monica.signup_double_optin' => true]); diff --git a/tests/Unit/Services/VCard/ExportVCardTest.php b/tests/Unit/Services/VCard/ExportVCardTest.php index 065b98fd7..595539bae 100644 --- a/tests/Unit/Services/VCard/ExportVCardTest.php +++ b/tests/Unit/Services/VCard/ExportVCardTest.php @@ -26,7 +26,8 @@ class ExportVCardTest extends TestCase /** @var int */ const defaultPropsCount = 3; - public function test_vcard_add_names() + /** @test */ + public function vcard_add_names() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create([ @@ -45,7 +46,8 @@ class ExportVCardTest extends TestCase $this->assertStringContainsString('N:Doe;John;;;', $vCard->serialize()); } - public function test_vcard_add_nickname() + /** @test */ + public function vcard_add_nickname() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create([ @@ -66,7 +68,8 @@ class ExportVCardTest extends TestCase $this->assertStringContainsString('NICKNAME:the nickname', $vCard->serialize()); } - public function test_vcard_add_gender() + /** @test */ + public function vcard_add_gender() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create([ @@ -84,7 +87,8 @@ class ExportVCardTest extends TestCase $this->assertStringContainsString('GENDER:M', $vCard->serialize()); } - public function test_vcard_add_gender_female() + /** @test */ + public function vcard_add_gender_female() { $account = factory(Account::class)->create(); $gender = factory(Gender::class)->create([ @@ -108,7 +112,8 @@ class ExportVCardTest extends TestCase $this->assertStringContainsString('GENDER:F', $vCard->serialize()); } - public function test_vcard_add_gender_unknown() + /** @test */ + public function vcard_add_gender_unknown() { $account = factory(Account::class)->create(); $gender = factory(Gender::class)->create([ @@ -131,7 +136,8 @@ class ExportVCardTest extends TestCase $this->assertStringContainsString('GENDER:U', $vCard->serialize()); } - public function test_vcard_add_gender_type_null() + /** @test */ + public function vcard_add_gender_type_null() { $account = factory(Account::class)->create(); $gender = factory(Gender::class)->create([ @@ -155,7 +161,8 @@ class ExportVCardTest extends TestCase $this->assertStringContainsString('GENDER:O', $vCard->serialize()); } - public function test_vcard_add_gender_type_null_male() + /** @test */ + public function vcard_add_gender_type_null_male() { $account = factory(Account::class)->create(); $gender = factory(Gender::class)->create([ @@ -179,7 +186,8 @@ class ExportVCardTest extends TestCase $this->assertStringContainsString('GENDER:O', $vCard->serialize()); } - public function test_vcard_add_gender_type_null_female() + /** @test */ + public function vcard_add_gender_type_null_female() { $account = factory(Account::class)->create(); $gender = factory(Gender::class)->create([ @@ -203,7 +211,8 @@ class ExportVCardTest extends TestCase $this->assertStringContainsString('GENDER:F', $vCard->serialize()); } - public function test_vcard_add_photo() + /** @test */ + public function vcard_add_photo() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -222,7 +231,8 @@ class ExportVCardTest extends TestCase $this->assertStringContainsString('PHOTO;VALUE=URI:gravatar', $vCard->serialize()); } - public function test_vcard_add_work_org() + /** @test */ + public function vcard_add_work_org() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create([ @@ -241,7 +251,8 @@ class ExportVCardTest extends TestCase $this->assertStringContainsString('ORG:the company', $vCard->serialize()); } - public function test_vcard_add_work_title() + /** @test */ + public function vcard_add_work_title() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create([ @@ -260,7 +271,8 @@ class ExportVCardTest extends TestCase $this->assertStringContainsString('TITLE:job position', $vCard->serialize()); } - public function test_vcard_add_work_information() + /** @test */ + public function vcard_add_work_information() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create([ @@ -281,7 +293,8 @@ class ExportVCardTest extends TestCase $this->assertStringContainsString('TITLE:job position', $vCard->serialize()); } - public function test_vcard_add_birthday() + /** @test */ + public function vcard_add_birthday() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -298,7 +311,8 @@ class ExportVCardTest extends TestCase $this->assertStringContainsString('BDAY:20001005', $vCard->serialize()); } - public function test_vcard_add_contact_fields_empty() + /** @test */ + public function vcard_add_contact_fields_empty() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -313,7 +327,8 @@ class ExportVCardTest extends TestCase ); } - public function test_vcard_add_contact_fields() + /** @test */ + public function vcard_add_contact_fields() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -336,7 +351,8 @@ class ExportVCardTest extends TestCase $this->assertStringContainsString('EMAIL:john@doe.com', $vCard->serialize()); } - public function test_vcard_add_addresses_empty() + /** @test */ + public function vcard_add_addresses_empty() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -351,7 +367,8 @@ class ExportVCardTest extends TestCase ); } - public function test_vcard_add_addresses() + /** @test */ + public function vcard_add_addresses() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -380,7 +397,8 @@ class ExportVCardTest extends TestCase $this->assertStringContainsString('ADR:;;12;beverly hills;;90210;US', $vCard->serialize()); } - public function test_vcard_prepares_an_almost_empty_vcard() + /** @test */ + public function vcard_prepares_an_almost_empty_vcard() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create(['account_id' => $account->id])->refresh(); @@ -396,7 +414,8 @@ class ExportVCardTest extends TestCase $this->assertVObjectEqualsVObject($this->getCard($contact), $vCard); } - public function test_vcard_prepares_a_complete_vcard() + /** @test */ + public function vcard_prepares_a_complete_vcard() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create(['account_id' => $account->id]); @@ -432,7 +451,8 @@ class ExportVCardTest extends TestCase $this->assertVObjectEqualsVObject($this->getCard($contact), $vCard); } - public function test_vcard_with_tags() + /** @test */ + public function vcard_with_tags() { $account = factory(Account::class)->create(); $contact = factory(Contact::class)->create([ diff --git a/tests/Unit/Services/VCard/ImportVCardTest.php b/tests/Unit/Services/VCard/ImportVCardTest.php index bd19b4b77..14decb2aa 100644 --- a/tests/Unit/Services/VCard/ImportVCardTest.php +++ b/tests/Unit/Services/VCard/ImportVCardTest.php @@ -19,7 +19,8 @@ class ImportVCardTest extends TestCase use DatabaseTransactions, PHPUnitAssertions; - public function test_it_can_not_import_because_no_firstname_or_nickname_in_vcard() + /** @test */ + public function it_can_not_import_because_no_firstname_or_nickname_in_vcard() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -29,7 +30,8 @@ class ImportVCardTest extends TestCase $this->assertFalse($this->invokePrivateMethod($importVCard, 'canImportCurrentEntry', [$vcard])); } - public function test_it_can_not_import_because_no_firstname_in_vcard() + /** @test */ + public function it_can_not_import_because_no_firstname_in_vcard() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -41,7 +43,8 @@ class ImportVCardTest extends TestCase $this->assertFalse($this->invokePrivateMethod($importVCard, 'canImportCurrentEntry', [$vcard])); } - public function test_it_can_not_import_because_empty_nickname_in_vcard() + /** @test */ + public function it_can_not_import_because_empty_nickname_in_vcard() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -53,7 +56,8 @@ class ImportVCardTest extends TestCase $this->assertFalse($this->invokePrivateMethod($importVCard, 'canImportCurrentEntry', [$vcard])); } - public function test_it_can_not_import_because_empty_fullname_in_vcard() + /** @test */ + public function it_can_not_import_because_empty_fullname_in_vcard() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -65,7 +69,8 @@ class ImportVCardTest extends TestCase $this->assertFalse($this->invokePrivateMethod($importVCard, 'canImportCurrentEntry', [$vcard])); } - public function test_it_can_import_firstname() + /** @test */ + public function it_can_import_firstname() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -77,7 +82,8 @@ class ImportVCardTest extends TestCase $this->assertTrue($this->invokePrivateMethod($importVCard, 'canImportCurrentEntry', [$vcard])); } - public function test_it_can_import_nickname() + /** @test */ + public function it_can_import_nickname() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -89,7 +95,8 @@ class ImportVCardTest extends TestCase $this->assertTrue($this->invokePrivateMethod($importVCard, 'canImportCurrentEntry', [$vcard])); } - public function test_it_can_import_fullname() + /** @test */ + public function it_can_import_fullname() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -101,7 +108,8 @@ class ImportVCardTest extends TestCase $this->assertTrue($this->invokePrivateMethod($importVCard, 'canImportCurrentEntry', [$vcard])); } - public function test_it_validates_email() + /** @test */ + public function it_validates_email() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -115,7 +123,8 @@ class ImportVCardTest extends TestCase $this->assertTrue($this->invokePrivateMethod($importVCard, 'isValidEmail', [$validEmail])); } - public function test_it_checks_if_a_contact_exists() + /** @test */ + public function it_checks_if_a_contact_exists() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -142,7 +151,8 @@ class ImportVCardTest extends TestCase $this->assertNull($contact); } - public function test_it_returns_an_unknown_name_if_no_name_is_in_entry() + /** @test */ + public function it_returns_an_unknown_name_if_no_name_is_in_entry() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -157,7 +167,8 @@ class ImportVCardTest extends TestCase ); } - public function test_it_returns_a_name_for_N() + /** @test */ + public function it_returns_a_name_for_N() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -170,7 +181,8 @@ class ImportVCardTest extends TestCase $this->assertEquals('Doe John john@doe.com', $this->invokePrivateMethod($importVCard, 'name', [$vcard])); } - public function test_it_returns_a_name_for_N_incomplete() + /** @test */ + public function it_returns_a_name_for_N_incomplete() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -183,7 +195,8 @@ class ImportVCardTest extends TestCase $this->assertEquals('Doe John john@doe.com', $this->invokePrivateMethod($importVCard, 'name', [$vcard])); } - public function test_it_returns_a_name_for_NICKNAME() + /** @test */ + public function it_returns_a_name_for_NICKNAME() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -196,7 +209,8 @@ class ImportVCardTest extends TestCase $this->assertEquals('John john@doe.com', $this->invokePrivateMethod($importVCard, 'name', [$vcard])); } - public function test_it_returns_a_name_for_FN() + /** @test */ + public function it_returns_a_name_for_FN() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -209,7 +223,8 @@ class ImportVCardTest extends TestCase $this->assertEquals('John Doe john@doe.com', $this->invokePrivateMethod($importVCard, 'name', [$vcard])); } - public function test_it_formats_value() + /** @test */ + public function it_formats_value() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -224,7 +239,8 @@ class ImportVCardTest extends TestCase ); } - public function test_it_creates_a_contact() + /** @test */ + public function it_creates_a_contact() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -244,7 +260,8 @@ class ImportVCardTest extends TestCase $this->assertTrue($contact->exists); } - public function test_it_creates_a_contact_with_process() + /** @test */ + public function it_creates_a_contact_with_process() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -270,7 +287,8 @@ class ImportVCardTest extends TestCase ]); } - public function test_it_updates_a_contact_with_process() + /** @test */ + public function it_updates_a_contact_with_process() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create([ @@ -301,7 +319,8 @@ class ImportVCardTest extends TestCase $this->assertEquals('Miles', $contact->last_name); } - public function test_it_imports_names_N() + /** @test */ + public function it_imports_names_N() { $contact = new Contact; @@ -318,7 +337,8 @@ class ImportVCardTest extends TestCase $this->assertEquals('Jane', $contact->middle_name); } - public function test_it_imports_names_NICKNAME() + /** @test */ + public function it_imports_names_NICKNAME() { $contact = new Contact; @@ -333,7 +353,8 @@ class ImportVCardTest extends TestCase $this->assertEquals('John', $contact->first_name); } - public function test_it_imports_names_FN() + /** @test */ + public function it_imports_names_FN() { $contact = new Contact; @@ -352,7 +373,8 @@ class ImportVCardTest extends TestCase $this->assertEquals('Doe', $contact->last_name); } - public function test_it_imports_names_FN_last() + /** @test */ + public function it_imports_names_FN_last() { $contact = new Contact; @@ -374,7 +396,8 @@ class ImportVCardTest extends TestCase $this->assertEquals('John', $contact->last_name); } - public function test_it_imports_names_FN_extra_space() + /** @test */ + public function it_imports_names_FN_extra_space() { $contact = new Contact; @@ -393,7 +416,8 @@ class ImportVCardTest extends TestCase $this->assertEquals('Doe', $contact->last_name); } - public function test_it_imports_name_FN() + /** @test */ + public function it_imports_name_FN() { $contact = new Contact; @@ -413,7 +437,8 @@ class ImportVCardTest extends TestCase $this->assertEquals('', $contact->last_name); } - public function test_it_imports_name_FN_last() + /** @test */ + public function it_imports_name_FN_last() { $contact = new Contact; @@ -436,7 +461,8 @@ class ImportVCardTest extends TestCase $this->assertEquals('', $contact->last_name); } - public function test_it_imports_names_FN_multiple() + /** @test */ + public function it_imports_names_FN_multiple() { $contact = new Contact; @@ -456,7 +482,8 @@ class ImportVCardTest extends TestCase $this->assertEquals('Doe Marco', $contact->last_name); } - public function test_it_imports_work_information() + /** @test */ + public function it_imports_work_information() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -480,7 +507,8 @@ class ImportVCardTest extends TestCase ); } - public function test_it_imports_birthday() + /** @test */ + public function it_imports_birthday() { config(['monica.requires_subscription' => false]); @@ -505,7 +533,8 @@ class ImportVCardTest extends TestCase ]); } - public function test_it_imports_birthday_compact_format() + /** @test */ + public function it_imports_birthday_compact_format() { config(['monica.requires_subscription' => false]); @@ -530,7 +559,8 @@ class ImportVCardTest extends TestCase ]); } - public function test_it_imports_birthday_year_unknown() + /** @test */ + public function it_imports_birthday_year_unknown() { config(['monica.requires_subscription' => false]); @@ -556,7 +586,8 @@ class ImportVCardTest extends TestCase ]); } - public function test_import_vcard_imports_address() + /** @test */ + public function import_vcard_imports_address() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -592,7 +623,8 @@ class ImportVCardTest extends TestCase ]); } - public function test_import_vcard_imports_partial_address() + /** @test */ + public function import_vcard_imports_partial_address() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -624,7 +656,8 @@ class ImportVCardTest extends TestCase ]); } - public function test_import_vcard_updates_address() + /** @test */ + public function import_vcard_updates_address() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create([ @@ -673,7 +706,8 @@ class ImportVCardTest extends TestCase $this->assertEquals($place->country, 'US'); } - public function test_import_vcard_updates_and_destroy_address() + /** @test */ + public function import_vcard_updates_and_destroy_address() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create([ @@ -731,7 +765,8 @@ class ImportVCardTest extends TestCase $this->assertEquals($place->country, 'US'); } - public function test_import_vcard_imports_email() + /** @test */ + public function import_vcard_imports_email() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -757,7 +792,8 @@ class ImportVCardTest extends TestCase ]); } - public function test_import_vcard_updates_email() + /** @test */ + public function import_vcard_updates_email() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create([ @@ -786,7 +822,8 @@ class ImportVCardTest extends TestCase $this->assertEquals($email->data, 'other@doe.com'); } - public function test_import_vcard_updates_and_detroy_email() + /** @test */ + public function import_vcard_updates_and_detroy_email() { $account = factory(Account::class)->create([]); $contact = factory(Contact::class)->create([ @@ -825,7 +862,8 @@ class ImportVCardTest extends TestCase $this->assertEquals($email1->data, 'other@doe.com'); } - public function test_it_imports_phone() + /** @test */ + public function it_imports_phone() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -851,7 +889,8 @@ class ImportVCardTest extends TestCase ]); } - public function test_it_imports_phone_by_national_format() + /** @test */ + public function it_imports_phone_by_national_format() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard; @@ -878,7 +917,8 @@ class ImportVCardTest extends TestCase ]); } - public function test_it_imports_phone_by_international_format() + /** @test */ + public function it_imports_phone_by_international_format() { $account = factory(Account::class)->create([]); $importVCard = new ImportVCard;