Passed
Push — feature/immutable-application-... ( 724692...212613 )
by Chris
34:25 queued 17:29
created
database/factories/WorkEnvironmentFactory.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -6,15 +6,15 @@
 block discarded – undo
6 6
 use App\Models\Manager;
7 7
 use App\Models\Lookup\Frequency;
8 8
 
9
-$factory->define(WorkEnvironment::class, function (Faker $faker) {
10
-    $faker_fr = FakerFactory::create('fr');
9
+$factory->define (WorkEnvironment::class, function (Faker $faker) {
10
+    $faker_fr = FakerFactory::create ('fr');
11 11
     return [
12
-        'telework_allowed_frequency_id' => Frequency::inRandomOrder()->first()->id,
13
-        'flexible_hours_frequency_id' => Frequency::inRandomOrder()->first()->id,
14
-        'things_to_know:en' => $faker->paragraph(),
15
-        'things_to_know:fr' => $faker_fr->paragraph(),
12
+        'telework_allowed_frequency_id' => Frequency::inRandomOrder ()->first ()->id,
13
+        'flexible_hours_frequency_id' => Frequency::inRandomOrder ()->first ()->id,
14
+        'things_to_know:en' => $faker->paragraph (),
15
+        'things_to_know:fr' => $faker_fr->paragraph (),
16 16
         'manager_id' => function () {
17
-            return factory(Manager::class)->create()->id;
17
+            return factory (Manager::class)->create ()->id;
18 18
         }
19 19
     ];
20 20
 });
Please login to merge, or discard this patch.
database/factories/ApplicationFactory.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -10,49 +10,49 @@  discard block
 block discarded – undo
10 10
 use App\Models\JobApplicationAnswer;
11 11
 use App\Models\SkillDeclaration;
12 12
 
13
-$factory->define(JobApplication::class, function (Faker\Generator $faker) {
13
+$factory->define (JobApplication::class, function (Faker\Generator $faker) {
14 14
     return [
15 15
         'job_poster_id' => function () {
16
-            return factory(JobPoster::class)->states('published')->create()->id;
16
+            return factory (JobPoster::class)->states ('published')->create ()->id;
17 17
         },
18 18
         'language_requirement_confirmed' => true,
19
-        'application_status_id' => ApplicationStatus::where('name', 'submitted')->firstOrFail()->id,
20
-        'citizenship_declaration_id' => CitizenshipDeclaration::inRandomOrder()->first()->id,
21
-        'veteran_status_id' => VeteranStatus::inRandomOrder()->first()->id,
22
-        'preferred_language_id' => PreferredLanguage::inRandomOrder()->first()->id,
19
+        'application_status_id' => ApplicationStatus::where ('name', 'submitted')->firstOrFail ()->id,
20
+        'citizenship_declaration_id' => CitizenshipDeclaration::inRandomOrder ()->first ()->id,
21
+        'veteran_status_id' => VeteranStatus::inRandomOrder ()->first ()->id,
22
+        'preferred_language_id' => PreferredLanguage::inRandomOrder ()->first ()->id,
23 23
         'experience_saved' => true,
24
-        'submission_signature' => $faker->name(),
25
-        'submission_date' => $faker->dateTimeBetween('yesterday', 'tomorrow')->format('Y-m-d H:i:s'),
24
+        'submission_signature' => $faker->name (),
25
+        'submission_date' => $faker->dateTimeBetween ('yesterday', 'tomorrow')->format ('Y-m-d H:i:s'),
26 26
         'applicant_id' => function () {
27
-            return factory(Applicant::class)->create()->id;
27
+            return factory (Applicant::class)->create ()->id;
28 28
         }
29 29
     ];
30 30
 });
31 31
 
32
-$factory->state(JobApplication::class, 'draft', [
33
-    'application_status_id' => ApplicationStatus::where('name', 'draft')->firstOrFail()->id,
32
+$factory->state (JobApplication::class, 'draft', [
33
+    'application_status_id' => ApplicationStatus::where ('name', 'draft')->firstOrFail ()->id,
34 34
     'submission_signature' => null,
35 35
     'submission_date' => null,
36 36
 ]);
37 37
 
38
-$factory->state(JobApplication::class, 'submitted', function (Faker\Generator $faker) {
38
+$factory->state (JobApplication::class, 'submitted', function (Faker\Generator $faker) {
39 39
     return [
40
-        'application_status_id' => ApplicationStatus::where('name', 'submitted')->firstOrFail()->id,
41
-        'submission_signature' => $faker->name(),
42
-        'submission_date' => $faker->dateTimeBetween('yesterday', 'tomorrow')->format('Y-m-d H:i:s'),
40
+        'application_status_id' => ApplicationStatus::where ('name', 'submitted')->firstOrFail ()->id,
41
+        'submission_signature' => $faker->name (),
42
+        'submission_date' => $faker->dateTimeBetween ('yesterday', 'tomorrow')->format ('Y-m-d H:i:s'),
43 43
         'experience_saved' => true,
44 44
     ];
45 45
 });
46 46
 
47
-$factory->afterCreating(JobApplication::class, function ($application) : void {
47
+$factory->afterCreating (JobApplication::class, function ($application) : void {
48 48
     foreach ($application->job_poster->job_poster_questions as $question) {
49
-        $answer = factory(JobApplicationAnswer::class)->create([
49
+        $answer = factory (JobApplicationAnswer::class)->create ([
50 50
             'job_poster_question_id' => $question->id,
51 51
             'job_application_id' => $application->id
52 52
         ]);
53
-        $application->job_application_answers()->save($answer);
53
+        $application->job_application_answers ()->save ($answer);
54 54
     }
55
-    if ($application->isDraft()) {
55
+    if ($application->isDraft ()) {
56 56
         $skillableType = 'applicant';
57 57
         $owner = $application->applicant;
58 58
     } else {
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         $owner = $application;
61 61
     }
62 62
     foreach ($application->job_poster->criteria as $criterion) {
63
-        $owner->skill_declarations()->save(factory(SkillDeclaration::class)->create([
63
+        $owner->skill_declarations ()->save (factory (SkillDeclaration::class)->create ([
64 64
             'skill_id' => $criterion->skill_id,
65 65
             'skillable_id' => $owner->id,
66 66
             'skillable_type' => $skillableType,
Please login to merge, or discard this patch.
database/factories/JobPosterKeyTaskFactory.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -3,14 +3,14 @@
 block discarded – undo
3 3
 use App\Models\JobPoster;
4 4
 use App\Models\JobPosterKeyTask;
5 5
 
6
-$faker_fr = Faker\Factory::create('fr');
6
+$faker_fr = Faker\Factory::create ('fr');
7 7
 
8
-$factory->define(JobPosterKeyTask::class, function (Faker\Generator $faker) use ($faker_fr) {
8
+$factory->define (JobPosterKeyTask::class, function (Faker\Generator $faker) use ($faker_fr) {
9 9
     return [
10 10
         'job_poster_id' => function () {
11
-            return factory(JobPoster::class)->create()->id;
11
+            return factory (JobPoster::class)->create ()->id;
12 12
         },
13
-        'description:en' => $faker->sentence(),
14
-        'description:fr' => $faker_fr->sentence()
13
+        'description:en' => $faker->sentence (),
14
+        'description:fr' => $faker_fr->sentence ()
15 15
     ];
16 16
 });
Please login to merge, or discard this patch.
database/factories/JobApplicationAnswerFactory.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@
 block discarded – undo
5 5
 use App\Models\JobApplication;
6 6
 use App\Models\JobApplicationAnswer;
7 7
 
8
-$factory->define(JobApplicationAnswer::class, function (Faker\Generator $faker) {
8
+$factory->define (JobApplicationAnswer::class, function (Faker\Generator $faker) {
9 9
     return [
10 10
         'job_poster_question_id' => function () {
11
-            return factory(JobPosterQuestion::class)->create()->id;
11
+            return factory (JobPosterQuestion::class)->create ()->id;
12 12
         },
13 13
         'job_application_id' => function () {
14
-            return factory(JobApplication::class)->create()->id;
14
+            return factory (JobApplication::class)->create ()->id;
15 15
         },
16
-        'answer' => $faker->paragraph()
16
+        'answer' => $faker->paragraph ()
17 17
     ];
18 18
 });
Please login to merge, or discard this patch.
database/factories/DegreeFactory.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -5,17 +5,17 @@
 block discarded – undo
5 5
 use App\Models\Degree;
6 6
 use App\Models\Lookup\DegreeType;
7 7
 
8
-$factory->define(Degree::class, function (Faker $faker) {
8
+$factory->define (Degree::class, function (Faker $faker) {
9 9
     return [
10
-        'degree_type_id' => DegreeType::inRandomOrder()->first()->id,
11
-        'area_of_study' => $faker->word(),
12
-        'institution' => $faker->company(),
13
-        'thesis' => $faker->sentence(),
14
-        'start_date' => $faker->dateTimeBetween('-3 years', '-1 years'),
15
-        'end_date' => $faker->dateTimeBetween('-1 years', '-1 day'),
10
+        'degree_type_id' => DegreeType::inRandomOrder ()->first ()->id,
11
+        'area_of_study' => $faker->word (),
12
+        'institution' => $faker->company (),
13
+        'thesis' => $faker->sentence (),
14
+        'start_date' => $faker->dateTimeBetween ('-3 years', '-1 years'),
15
+        'end_date' => $faker->dateTimeBetween ('-1 years', '-1 day'),
16 16
         'degreeable_id' => function () {
17 17
             // Default factory degrees to belong to Applicant, not JobApplication
18
-            return factory(Applicant::class)->create()->id;
18
+            return factory (Applicant::class)->create ()->id;
19 19
         },
20 20
         'degreeable_type' => 'applicant',
21 21
         'blockcert_url' => null,
Please login to merge, or discard this patch.
database/factories/RatingGuideQuestionFactory.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,12 +5,12 @@
 block discarded – undo
5 5
 use App\Models\RatingGuideQuestion;
6 6
 use App\Models\JobPoster;
7 7
 
8
-$factory->define(RatingGuideQuestion::class, function (Faker\Generator $faker) {
8
+$factory->define (RatingGuideQuestion::class, function (Faker\Generator $faker) {
9 9
     return [
10 10
         'job_poster_id' => function () {
11
-            return factory(JobPoster::class)->create()->id;
11
+            return factory (JobPoster::class)->create ()->id;
12 12
         },
13
-        'assessment_type_id' => AssessmentType::inRandomOrder()->first()->id,
14
-        'question' => $faker->sentence(),
13
+        'assessment_type_id' => AssessmentType::inRandomOrder ()->first ()->id,
14
+        'question' => $faker->sentence (),
15 15
     ];
16 16
 });
Please login to merge, or discard this patch.
database/factories/SkillDeclarationFactory.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,15 +6,15 @@
 block discarded – undo
6 6
 use App\Models\Lookup\SkillLevel;
7 7
 use App\Models\Applicant;
8 8
 
9
-$factory->define(SkillDeclaration::class, function (Faker\Generator $faker) {
9
+$factory->define (SkillDeclaration::class, function (Faker\Generator $faker) {
10 10
     return [
11
-        'skill_id' => Skill::inRandomOrder()->first()->id,
12
-        'skill_status_id' => SkillStatus::inRandomOrder()->first()->id,
13
-        'skill_level_id' => SkillLevel::inRandomOrder()->first()->id,
11
+        'skill_id' => Skill::inRandomOrder ()->first ()->id,
12
+        'skill_status_id' => SkillStatus::inRandomOrder ()->first ()->id,
13
+        'skill_level_id' => SkillLevel::inRandomOrder ()->first ()->id,
14 14
         'skillable_id' => function () {
15
-            return factory(Applicant::class)->create()->id;
15
+            return factory (Applicant::class)->create ()->id;
16 16
         },
17 17
         'skillable_type' => 'applicant',
18
-        'description' => $faker->paragraphs(3, true),
18
+        'description' => $faker->paragraphs (3, true),
19 19
     ];
20 20
 });
Please login to merge, or discard this patch.
database/factories/WorkExperienceFactory.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,16 +4,16 @@
 block discarded – undo
4 4
 use App\Models\Applicant;
5 5
 use App\Models\WorkExperience;
6 6
 
7
-$factory->define(WorkExperience::class, function (Faker $faker) {
7
+$factory->define (WorkExperience::class, function (Faker $faker) {
8 8
     return [
9
-        'role' => $faker->word(),
10
-        'company' => $faker->company(),
11
-        'description' => $faker->paragraph(),
12
-        'start_date' => $faker->dateTimeBetween('-3 years', '-1 years'),
13
-        'end_date' => $faker->dateTimeBetween('-1 years', '-1 day'),
9
+        'role' => $faker->word (),
10
+        'company' => $faker->company (),
11
+        'description' => $faker->paragraph (),
12
+        'start_date' => $faker->dateTimeBetween ('-3 years', '-1 years'),
13
+        'end_date' => $faker->dateTimeBetween ('-1 years', '-1 day'),
14 14
         'experienceable_id' => function () {
15 15
             // Factory items to belong to Applicant by default, not JobApplication
16
-            return factory(Applicant::class)->create()->id;
16
+            return factory (Applicant::class)->create ()->id;
17 17
         },
18 18
         'experienceable_type' => 'applicant',
19 19
     ];
Please login to merge, or discard this patch.
database/factories/TeamCultureFactory.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -5,21 +5,21 @@
 block discarded – undo
5 5
 use App\Models\TeamCulture;
6 6
 use App\Models\Manager;
7 7
 
8
-$factory->define(TeamCulture::class, function (Faker $faker) {
9
-    $faker_fr = FakerFactory::create('fr');
8
+$factory->define (TeamCulture::class, function (Faker $faker) {
9
+    $faker_fr = FakerFactory::create ('fr');
10 10
     return [
11
-        'team_size' => $faker->numberBetween(5, 15),
12
-        'gc_directory_url' => $faker->url(),
13
-        'narrative_text:en' => $faker->paragraphs(2, true),
14
-        'operating_context:en' => $faker->paragraph(),
15
-        'what_we_value:en' => $faker->paragraph(),
16
-        'how_we_work:en' => $faker->paragraph(),
17
-        'narrative_text:fr' => $faker_fr->paragraphs(2, true),
18
-        'operating_context:fr' => $faker_fr->paragraph(),
19
-        'what_we_value:fr' => $faker_fr->paragraph(),
20
-        'how_we_work:fr' => $faker_fr->paragraph(),
11
+        'team_size' => $faker->numberBetween (5, 15),
12
+        'gc_directory_url' => $faker->url (),
13
+        'narrative_text:en' => $faker->paragraphs (2, true),
14
+        'operating_context:en' => $faker->paragraph (),
15
+        'what_we_value:en' => $faker->paragraph (),
16
+        'how_we_work:en' => $faker->paragraph (),
17
+        'narrative_text:fr' => $faker_fr->paragraphs (2, true),
18
+        'operating_context:fr' => $faker_fr->paragraph (),
19
+        'what_we_value:fr' => $faker_fr->paragraph (),
20
+        'how_we_work:fr' => $faker_fr->paragraph (),
21 21
         'manager_id' => function () {
22
-            return factory(Manager::class)->create()->id;
22
+            return factory (Manager::class)->create ()->id;
23 23
         }
24 24
     ];
25 25
 });
Please login to merge, or discard this patch.