From 6d1bcf627158549460a482dcd0d61e6155d1b784 Mon Sep 17 00:00:00 2001 From: Jason McCreary Date: Fri, 24 Nov 2023 19:37:40 -0500 Subject: [PATCH] Use Faker methods --- composer.json | 2 +- src/Generators/FactoryGenerator.php | 4 +- tests/fixtures/factories/all-column-types.php | 46 +++++++++---------- .../factories/model-key-constraints.php | 2 +- tests/fixtures/factories/model-modifiers.php | 4 +- .../fixtures/factories/nested-components.php | 4 +- tests/fixtures/factories/phone.php | 8 ++-- tests/fixtures/factories/post-configured.php | 2 +- tests/fixtures/factories/post.php | 2 +- .../factories/resource-statements.php | 6 +-- tests/fixtures/factories/team.php | 2 +- .../factories/unconventional-foreign-key.php | 2 +- tests/fixtures/factories/unconventional.php | 2 +- .../tests/pest/api-shorthand-validation.php | 12 ++--- ...umns-on-null-Api-PaymentControllerTest.php | 2 +- ...-columns-on-null-PaymentControllerTest.php | 2 +- .../pest/certificate-pascal-case-example.php | 12 ++--- .../certificate-type-pascal-case-example.php | 4 +- .../pest/models-with-custom-namespace.php | 12 ++--- tests/fixtures/tests/pest/reference-cache.php | 4 +- .../pest/routes-with-pluralized-names.php | 12 ++--- .../phpunit/api-shorthand-validation.php | 12 ++--- ...umns-on-null-Api-PaymentControllerTest.php | 2 +- ...-columns-on-null-PaymentControllerTest.php | 2 +- .../certificate-pascal-case-example.php | 12 ++--- .../certificate-type-pascal-case-example.php | 4 +- .../phpunit/models-with-custom-namespace.php | 12 ++--- .../tests/phpunit/reference-cache.php | 4 +- .../phpunit/routes-with-pluralized-names.php | 12 ++--- 29 files changed, 103 insertions(+), 103 deletions(-) diff --git a/composer.json b/composer.json index bece2d91..f731473b 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "illuminate/console": "^10.0", "illuminate/filesystem": "^10.0", "illuminate/support": "^10.0", - "laravel-shift/faker-registry": "^0.2.0", + "laravel-shift/faker-registry": "^0.3.0", "symfony/yaml": "^6.2" }, "require-dev": { diff --git a/src/Generators/FactoryGenerator.php b/src/Generators/FactoryGenerator.php index 65f2bee6..87f76d35 100644 --- a/src/Generators/FactoryGenerator.php +++ b/src/Generators/FactoryGenerator.php @@ -167,10 +167,10 @@ protected function buildDefinition(Model $model): string $faker = FakerRegistry::fakerData($column->name()) ?? (FakerRegistry::fakerDataType($type) ?? FakerRegistry::fakerDataType($column->dataType())); if ($faker === null) { - $faker = 'word'; + $faker = 'word()'; } - if (($faker === 'word') && (!empty($column->attributes()))) { + if ($faker === 'word()' && !empty($column->attributes())) { $faker = sprintf("regexify('[A-Za-z0-9]{%s}')", current($column->attributes())); } diff --git a/tests/fixtures/factories/all-column-types.php b/tests/fixtures/factories/all-column-types.php index 03957a56..741b3ad8 100644 --- a/tests/fixtures/factories/all-column-types.php +++ b/tests/fixtures/factories/all-column-types.php @@ -22,9 +22,9 @@ public function definition(): array { return [ 'bigInteger' => $this->faker->numberBetween(-100000, 100000), - 'binary' => $this->faker->sha256, - 'boolean' => $this->faker->boolean, - 'char' => $this->faker->randomLetter, + 'binary' => $this->faker->sha256(), + 'boolean' => $this->faker->boolean(), + 'char' => $this->faker->randomLetter(), 'date' => $this->faker->date(), 'dateTime' => $this->faker->dateTime(), 'dateTimeTz' => $this->faker->dateTime(), @@ -32,31 +32,31 @@ public function definition(): array 'double' => $this->faker->randomFloat(0, 0, 9999999999.), 'enum' => $this->faker->randomElement(["1","2","3"]), 'float' => $this->faker->randomFloat(0, 0, 9999999999.), - 'fullText' => $this->faker->text, - 'geometry' => $this->faker->word, - 'geometryCollection' => $this->faker->word, + 'fullText' => $this->faker->text(), + 'geometry' => $this->faker->word(), + 'geometryCollection' => $this->faker->word(), 'integer' => $this->faker->numberBetween(-10000, 10000), - 'ipAddress' => $this->faker->ipv4, + 'ipAddress' => $this->faker->ipv4(), 'json' => '{}', 'jsonb' => '{}', - 'lineString' => $this->faker->word, - 'longText' => $this->faker->text, - 'macAddress' => $this->faker->macAddress, + 'lineString' => $this->faker->word(), + 'longText' => $this->faker->text(), + 'macAddress' => $this->faker->macAddress(), 'mediumInteger' => $this->faker->numberBetween(-10000, 10000), - 'mediumText' => $this->faker->text, - 'morphs_id' => $this->faker->randomDigitNotNull, - 'morphs_type' => $this->faker->word, - 'uuidMorphs' => $this->faker->word, - 'multiLineString' => $this->faker->word, - 'multiPoint' => $this->faker->word, - 'multiPolygon' => $this->faker->word, - 'point' => $this->faker->word, - 'polygon' => $this->faker->word, + 'mediumText' => $this->faker->text(), + 'morphs_id' => $this->faker->randomDigitNotNull(), + 'morphs_type' => $this->faker->word(), + 'uuidMorphs' => $this->faker->word(), + 'multiLineString' => $this->faker->word(), + 'multiPoint' => $this->faker->word(), + 'multiPolygon' => $this->faker->word(), + 'point' => $this->faker->word(), + 'polygon' => $this->faker->word(), 'rememberToken' => Str::random(10), 'set' => $this->faker->randomElement(["1","2","3"]), 'smallInteger' => $this->faker->numberBetween(-1000, 1000), - 'string' => $this->faker->word, - 'text' => $this->faker->text, + 'string' => $this->faker->word(), + 'text' => $this->faker->text(), 'time' => $this->faker->time(), 'timeTz' => $this->faker->time(), 'timestamp' => $this->faker->dateTime(), @@ -67,8 +67,8 @@ public function definition(): array 'unsignedInteger' => $this->faker->randomNumber(), 'unsignedMediumInteger' => $this->faker->randomNumber(), 'unsignedSmallInteger' => $this->faker->randomNumber(), - 'unsignedTinyInteger' => $this->faker->randomDigitNotNull, - 'uuid' => $this->faker->uuid, + 'unsignedTinyInteger' => $this->faker->randomDigitNotNull(), + 'uuid' => $this->faker->uuid(), 'year' => $this->faker->year(), ]; } diff --git a/tests/fixtures/factories/model-key-constraints.php b/tests/fixtures/factories/model-key-constraints.php index b1923670..3cd3dc09 100644 --- a/tests/fixtures/factories/model-key-constraints.php +++ b/tests/fixtures/factories/model-key-constraints.php @@ -24,7 +24,7 @@ public function definition(): array { return [ 'user_id' => User::factory(), - 'external_id' => $this->faker->word, + 'external_id' => $this->faker->word(), 'sub_id' => Subscription::factory(), 'expires_at' => $this->faker->dateTime(), 'meta' => '[]', diff --git a/tests/fixtures/factories/model-modifiers.php b/tests/fixtures/factories/model-modifiers.php index 59ea9e47..4d5eafe8 100644 --- a/tests/fixtures/factories/model-modifiers.php +++ b/tests/fixtures/factories/model-modifiers.php @@ -22,12 +22,12 @@ public function definition(): array { return [ 'title' => $this->faker->sentence(4), - 'name' => $this->faker->name, + 'name' => $this->faker->name(), 'content' => $this->faker->paragraphs(3, true), 'amount' => $this->faker->randomFloat(3, 0, 999999.999), 'total' => $this->faker->randomFloat(2, 0, 99999999.99), 'overflow' => $this->faker->randomFloat(30, 0, 99999999999999999999999999999999999.999999999999999999999999999999), - 'ssn' => $this->faker->ssn, + 'ssn' => $this->faker->ssn(), 'role' => $this->faker->randomElement(["user","admin","owner"]), ]; } diff --git a/tests/fixtures/factories/nested-components.php b/tests/fixtures/factories/nested-components.php index 03f5e69b..3d268088 100644 --- a/tests/fixtures/factories/nested-components.php +++ b/tests/fixtures/factories/nested-components.php @@ -21,8 +21,8 @@ class UserFactory extends Factory public function definition(): array { return [ - 'name' => $this->faker->name, - 'password' => $this->faker->password, + 'name' => $this->faker->name(), + 'password' => $this->faker->password(), ]; } } diff --git a/tests/fixtures/factories/phone.php b/tests/fixtures/factories/phone.php index 49954f0f..56c63a8c 100644 --- a/tests/fixtures/factories/phone.php +++ b/tests/fixtures/factories/phone.php @@ -22,13 +22,13 @@ class PhoneFactory extends Factory public function definition(): array { return [ - 'label' => $this->faker->word, + 'label' => $this->faker->word(), 'user_id' => User::factory(), - 'phone_number' => $this->faker->phoneNumber, + 'phone_number' => $this->faker->phoneNumber(), 'type' => $this->faker->randomElement(["home","cell"]), 'status' => $this->faker->randomElement(["archived","deleted"]), - 'foo_id' => $this->faker->randomDigitNotNull, - 'foo_type' => $this->faker->word, + 'foo_id' => $this->faker->randomDigitNotNull(), + 'foo_type' => $this->faker->word(), 'tag' => $this->faker->regexify('[A-Za-z0-9]{3}'), ]; } diff --git a/tests/fixtures/factories/post-configured.php b/tests/fixtures/factories/post-configured.php index 36c62aa0..304f259e 100644 --- a/tests/fixtures/factories/post-configured.php +++ b/tests/fixtures/factories/post-configured.php @@ -24,7 +24,7 @@ public function definition(): array return [ 'title' => $this->faker->sentence(4), 'author_id' => Author::factory(), - 'author_bio' => $this->faker->text, + 'author_bio' => $this->faker->text(), 'content' => $this->faker->paragraphs(3, true), 'published_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/tests/fixtures/factories/post.php b/tests/fixtures/factories/post.php index c5e24cfc..706f4ccb 100644 --- a/tests/fixtures/factories/post.php +++ b/tests/fixtures/factories/post.php @@ -24,7 +24,7 @@ public function definition(): array return [ 'title' => $this->faker->sentence(4), 'author_id' => Author::factory(), - 'author_bio' => $this->faker->text, + 'author_bio' => $this->faker->text(), 'content' => $this->faker->paragraphs(3, true), 'published_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/tests/fixtures/factories/resource-statements.php b/tests/fixtures/factories/resource-statements.php index c5e3341e..00dc8863 100644 --- a/tests/fixtures/factories/resource-statements.php +++ b/tests/fixtures/factories/resource-statements.php @@ -21,9 +21,9 @@ class UserFactory extends Factory public function definition(): array { return [ - 'name' => $this->faker->name, - 'email' => $this->faker->safeEmail, - 'password' => $this->faker->password, + 'name' => $this->faker->name(), + 'email' => $this->faker->safeEmail(), + 'password' => $this->faker->password(), 'remember_token' => Str::random(10), ]; } diff --git a/tests/fixtures/factories/team.php b/tests/fixtures/factories/team.php index b2505fee..c21f26f5 100644 --- a/tests/fixtures/factories/team.php +++ b/tests/fixtures/factories/team.php @@ -22,7 +22,7 @@ class TeamFactory extends Factory public function definition(): array { return [ - 'name' => $this->faker->name, + 'name' => $this->faker->name(), 'owner_id' => User::factory(), ]; } diff --git a/tests/fixtures/factories/unconventional-foreign-key.php b/tests/fixtures/factories/unconventional-foreign-key.php index c514835b..99da6549 100644 --- a/tests/fixtures/factories/unconventional-foreign-key.php +++ b/tests/fixtures/factories/unconventional-foreign-key.php @@ -22,7 +22,7 @@ class StateFactory extends Factory public function definition(): array { return [ - 'name' => $this->faker->name, + 'name' => $this->faker->name(), 'countries_id' => Country::factory(), 'country_code' => Country::factory()->create()->code, 'ccid' => Country::factory()->create()->ccid, diff --git a/tests/fixtures/factories/unconventional.php b/tests/fixtures/factories/unconventional.php index c6ab039c..faf54792 100644 --- a/tests/fixtures/factories/unconventional.php +++ b/tests/fixtures/factories/unconventional.php @@ -23,7 +23,7 @@ class TeamFactory extends Factory public function definition(): array { return [ - 'name' => $this->faker->name, + 'name' => $this->faker->name(), 'owner' => Owner::factory(), 'manager' => User::factory(), 'options' => '{}', diff --git a/tests/fixtures/tests/pest/api-shorthand-validation.php b/tests/fixtures/tests/pest/api-shorthand-validation.php index 2e45c3fc..644066f5 100644 --- a/tests/fixtures/tests/pest/api-shorthand-validation.php +++ b/tests/fixtures/tests/pest/api-shorthand-validation.php @@ -30,10 +30,10 @@ ); test('store saves', function (): void { - $name = fake()->name; + $name = fake()->name(); $certificate_type = CertificateType::factory()->create(); - $reference = fake()->word; - $document = fake()->word; + $reference = fake()->word(); + $document = fake()->word(); $expiry_date = fake()->date(); $response = post(route('certificate.store'), [ @@ -78,10 +78,10 @@ test('update behaves as expected', function (): void { $certificate = Certificate::factory()->create(); - $name = fake()->name; + $name = fake()->name(); $certificate_type = CertificateType::factory()->create(); - $reference = fake()->word; - $document = fake()->word; + $reference = fake()->word(); + $document = fake()->word(); $expiry_date = fake()->date(); $response = put(route('certificate.update', $certificate), [ diff --git a/tests/fixtures/tests/pest/call-to-a-member-function-columns-on-null-Api-PaymentControllerTest.php b/tests/fixtures/tests/pest/call-to-a-member-function-columns-on-null-Api-PaymentControllerTest.php index 43bd1d4d..fa713f2e 100644 --- a/tests/fixtures/tests/pest/call-to-a-member-function-columns-on-null-Api-PaymentControllerTest.php +++ b/tests/fixtures/tests/pest/call-to-a-member-function-columns-on-null-Api-PaymentControllerTest.php @@ -20,7 +20,7 @@ ); test('store saves and responds with', function (): void { - $status = fake()->word; + $status = fake()->word(); $amount = fake()->randomFloat(/** decimal_attributes **/); $user = User::factory()->create(); diff --git a/tests/fixtures/tests/pest/call-to-a-member-function-columns-on-null-PaymentControllerTest.php b/tests/fixtures/tests/pest/call-to-a-member-function-columns-on-null-PaymentControllerTest.php index 6d7ab7cd..e108ef86 100644 --- a/tests/fixtures/tests/pest/call-to-a-member-function-columns-on-null-PaymentControllerTest.php +++ b/tests/fixtures/tests/pest/call-to-a-member-function-columns-on-null-PaymentControllerTest.php @@ -28,7 +28,7 @@ ); test('store saves and redirects', function (): void { - $status = fake()->word; + $status = fake()->word(); $amount = fake()->randomFloat(/** decimal_attributes **/); $user = User::factory()->create(); diff --git a/tests/fixtures/tests/pest/certificate-pascal-case-example.php b/tests/fixtures/tests/pest/certificate-pascal-case-example.php index 2e45c3fc..644066f5 100644 --- a/tests/fixtures/tests/pest/certificate-pascal-case-example.php +++ b/tests/fixtures/tests/pest/certificate-pascal-case-example.php @@ -30,10 +30,10 @@ ); test('store saves', function (): void { - $name = fake()->name; + $name = fake()->name(); $certificate_type = CertificateType::factory()->create(); - $reference = fake()->word; - $document = fake()->word; + $reference = fake()->word(); + $document = fake()->word(); $expiry_date = fake()->date(); $response = post(route('certificate.store'), [ @@ -78,10 +78,10 @@ test('update behaves as expected', function (): void { $certificate = Certificate::factory()->create(); - $name = fake()->name; + $name = fake()->name(); $certificate_type = CertificateType::factory()->create(); - $reference = fake()->word; - $document = fake()->word; + $reference = fake()->word(); + $document = fake()->word(); $expiry_date = fake()->date(); $response = put(route('certificate.update', $certificate), [ diff --git a/tests/fixtures/tests/pest/certificate-type-pascal-case-example.php b/tests/fixtures/tests/pest/certificate-type-pascal-case-example.php index ba6ef464..a0743405 100644 --- a/tests/fixtures/tests/pest/certificate-type-pascal-case-example.php +++ b/tests/fixtures/tests/pest/certificate-type-pascal-case-example.php @@ -28,7 +28,7 @@ ); test('store saves', function (): void { - $name = fake()->name; + $name = fake()->name(); $response = post(route('certificate-type.store'), [ 'name' => $name, @@ -64,7 +64,7 @@ test('update behaves as expected', function (): void { $certificateType = CertificateType::factory()->create(); - $name = fake()->name; + $name = fake()->name(); $response = put(route('certificate-type.update', $certificateType), [ 'name' => $name, diff --git a/tests/fixtures/tests/pest/models-with-custom-namespace.php b/tests/fixtures/tests/pest/models-with-custom-namespace.php index 6767d2a0..32ba02a4 100644 --- a/tests/fixtures/tests/pest/models-with-custom-namespace.php +++ b/tests/fixtures/tests/pest/models-with-custom-namespace.php @@ -28,9 +28,9 @@ ); test('store saves', function (): void { - $name = fake()->name; - $image = fake()->word; - $active = fake()->boolean; + $name = fake()->name(); + $image = fake()->word(); + $active = fake()->boolean(); $response = post(route('category.store'), [ 'name' => $name, @@ -70,9 +70,9 @@ test('update behaves as expected', function (): void { $category = Category::factory()->create(); - $name = fake()->name; - $image = fake()->word; - $active = fake()->boolean; + $name = fake()->name(); + $image = fake()->word(); + $active = fake()->boolean(); $response = put(route('category.update', $category), [ 'name' => $name, diff --git a/tests/fixtures/tests/pest/reference-cache.php b/tests/fixtures/tests/pest/reference-cache.php index d913161c..14446004 100644 --- a/tests/fixtures/tests/pest/reference-cache.php +++ b/tests/fixtures/tests/pest/reference-cache.php @@ -14,8 +14,8 @@ ); test('store saves and redirects', function (): void { - $email = fake()->safeEmail; - $password = fake()->password; + $email = fake()->safeEmail(); + $password = fake()->password(); $response = post(route('user.store'), [ 'email' => $email, diff --git a/tests/fixtures/tests/pest/routes-with-pluralized-names.php b/tests/fixtures/tests/pest/routes-with-pluralized-names.php index ed543925..75ac9091 100644 --- a/tests/fixtures/tests/pest/routes-with-pluralized-names.php +++ b/tests/fixtures/tests/pest/routes-with-pluralized-names.php @@ -28,9 +28,9 @@ ); test('store saves', function (): void { - $name = fake()->name; - $image = fake()->word; - $active = fake()->boolean; + $name = fake()->name(); + $image = fake()->word(); + $active = fake()->boolean(); $response = post(route('categories.store'), [ 'name' => $name, @@ -70,9 +70,9 @@ test('update behaves as expected', function (): void { $category = Category::factory()->create(); - $name = fake()->name; - $image = fake()->word; - $active = fake()->boolean; + $name = fake()->name(); + $image = fake()->word(); + $active = fake()->boolean(); $response = put(route('categories.update', $category), [ 'name' => $name, diff --git a/tests/fixtures/tests/phpunit/api-shorthand-validation.php b/tests/fixtures/tests/phpunit/api-shorthand-validation.php index 5ab4bdfb..ddfc94e1 100644 --- a/tests/fixtures/tests/phpunit/api-shorthand-validation.php +++ b/tests/fixtures/tests/phpunit/api-shorthand-validation.php @@ -43,10 +43,10 @@ public function store_uses_form_request_validation(): void #[Test] public function store_saves(): void { - $name = $this->faker->name; + $name = $this->faker->name(); $certificate_type = CertificateType::factory()->create(); - $reference = $this->faker->word; - $document = $this->faker->word; + $reference = $this->faker->word(); + $document = $this->faker->word(); $expiry_date = $this->faker->date(); $response = $this->post(route('certificate.store'), [ @@ -98,10 +98,10 @@ public function update_uses_form_request_validation(): void public function update_behaves_as_expected(): void { $certificate = Certificate::factory()->create(); - $name = $this->faker->name; + $name = $this->faker->name(); $certificate_type = CertificateType::factory()->create(); - $reference = $this->faker->word; - $document = $this->faker->word; + $reference = $this->faker->word(); + $document = $this->faker->word(); $expiry_date = $this->faker->date(); $response = $this->put(route('certificate.update', $certificate), [ diff --git a/tests/fixtures/tests/phpunit/call-to-a-member-function-columns-on-null-Api-PaymentControllerTest.php b/tests/fixtures/tests/phpunit/call-to-a-member-function-columns-on-null-Api-PaymentControllerTest.php index 1f6840c7..a7c662b2 100644 --- a/tests/fixtures/tests/phpunit/call-to-a-member-function-columns-on-null-Api-PaymentControllerTest.php +++ b/tests/fixtures/tests/phpunit/call-to-a-member-function-columns-on-null-Api-PaymentControllerTest.php @@ -34,7 +34,7 @@ public function store_uses_form_request_validation(): void #[Test] public function store_saves_and_responds_with(): void { - $status = $this->faker->word; + $status = $this->faker->word(); $amount = $this->faker->randomFloat(/** decimal_attributes **/); $user = User::factory()->create(); diff --git a/tests/fixtures/tests/phpunit/call-to-a-member-function-columns-on-null-PaymentControllerTest.php b/tests/fixtures/tests/phpunit/call-to-a-member-function-columns-on-null-PaymentControllerTest.php index a7c0014b..ea50caf8 100644 --- a/tests/fixtures/tests/phpunit/call-to-a-member-function-columns-on-null-PaymentControllerTest.php +++ b/tests/fixtures/tests/phpunit/call-to-a-member-function-columns-on-null-PaymentControllerTest.php @@ -44,7 +44,7 @@ public function store_uses_form_request_validation(): void #[Test] public function store_saves_and_redirects(): void { - $status = $this->faker->word; + $status = $this->faker->word(); $amount = $this->faker->randomFloat(/** decimal_attributes **/); $user = User::factory()->create(); diff --git a/tests/fixtures/tests/phpunit/certificate-pascal-case-example.php b/tests/fixtures/tests/phpunit/certificate-pascal-case-example.php index 5ab4bdfb..ddfc94e1 100644 --- a/tests/fixtures/tests/phpunit/certificate-pascal-case-example.php +++ b/tests/fixtures/tests/phpunit/certificate-pascal-case-example.php @@ -43,10 +43,10 @@ public function store_uses_form_request_validation(): void #[Test] public function store_saves(): void { - $name = $this->faker->name; + $name = $this->faker->name(); $certificate_type = CertificateType::factory()->create(); - $reference = $this->faker->word; - $document = $this->faker->word; + $reference = $this->faker->word(); + $document = $this->faker->word(); $expiry_date = $this->faker->date(); $response = $this->post(route('certificate.store'), [ @@ -98,10 +98,10 @@ public function update_uses_form_request_validation(): void public function update_behaves_as_expected(): void { $certificate = Certificate::factory()->create(); - $name = $this->faker->name; + $name = $this->faker->name(); $certificate_type = CertificateType::factory()->create(); - $reference = $this->faker->word; - $document = $this->faker->word; + $reference = $this->faker->word(); + $document = $this->faker->word(); $expiry_date = $this->faker->date(); $response = $this->put(route('certificate.update', $certificate), [ diff --git a/tests/fixtures/tests/phpunit/certificate-type-pascal-case-example.php b/tests/fixtures/tests/phpunit/certificate-type-pascal-case-example.php index a31de986..8f531719 100644 --- a/tests/fixtures/tests/phpunit/certificate-type-pascal-case-example.php +++ b/tests/fixtures/tests/phpunit/certificate-type-pascal-case-example.php @@ -41,7 +41,7 @@ public function store_uses_form_request_validation(): void #[Test] public function store_saves(): void { - $name = $this->faker->name; + $name = $this->faker->name(); $response = $this->post(route('certificate-type.store'), [ 'name' => $name, @@ -84,7 +84,7 @@ public function update_uses_form_request_validation(): void public function update_behaves_as_expected(): void { $certificateType = CertificateType::factory()->create(); - $name = $this->faker->name; + $name = $this->faker->name(); $response = $this->put(route('certificate-type.update', $certificateType), [ 'name' => $name, diff --git a/tests/fixtures/tests/phpunit/models-with-custom-namespace.php b/tests/fixtures/tests/phpunit/models-with-custom-namespace.php index 9d7d8dd9..ed83e9be 100644 --- a/tests/fixtures/tests/phpunit/models-with-custom-namespace.php +++ b/tests/fixtures/tests/phpunit/models-with-custom-namespace.php @@ -41,9 +41,9 @@ public function store_uses_form_request_validation(): void #[Test] public function store_saves(): void { - $name = $this->faker->name; - $image = $this->faker->word; - $active = $this->faker->boolean; + $name = $this->faker->name(); + $image = $this->faker->word(); + $active = $this->faker->boolean(); $response = $this->post(route('category.store'), [ 'name' => $name, @@ -90,9 +90,9 @@ public function update_uses_form_request_validation(): void public function update_behaves_as_expected(): void { $category = Category::factory()->create(); - $name = $this->faker->name; - $image = $this->faker->word; - $active = $this->faker->boolean; + $name = $this->faker->name(); + $image = $this->faker->word(); + $active = $this->faker->boolean(); $response = $this->put(route('category.update', $category), [ 'name' => $name, diff --git a/tests/fixtures/tests/phpunit/reference-cache.php b/tests/fixtures/tests/phpunit/reference-cache.php index f6090854..9ffcf7da 100644 --- a/tests/fixtures/tests/phpunit/reference-cache.php +++ b/tests/fixtures/tests/phpunit/reference-cache.php @@ -29,8 +29,8 @@ public function store_uses_form_request_validation(): void #[Test] public function store_saves_and_redirects(): void { - $email = $this->faker->safeEmail; - $password = $this->faker->password; + $email = $this->faker->safeEmail(); + $password = $this->faker->password(); $response = $this->post(route('user.store'), [ 'email' => $email, diff --git a/tests/fixtures/tests/phpunit/routes-with-pluralized-names.php b/tests/fixtures/tests/phpunit/routes-with-pluralized-names.php index 5cf09f0e..943d70a3 100644 --- a/tests/fixtures/tests/phpunit/routes-with-pluralized-names.php +++ b/tests/fixtures/tests/phpunit/routes-with-pluralized-names.php @@ -41,9 +41,9 @@ public function store_uses_form_request_validation(): void #[Test] public function store_saves(): void { - $name = $this->faker->name; - $image = $this->faker->word; - $active = $this->faker->boolean; + $name = $this->faker->name(); + $image = $this->faker->word(); + $active = $this->faker->boolean(); $response = $this->post(route('categories.store'), [ 'name' => $name, @@ -90,9 +90,9 @@ public function update_uses_form_request_validation(): void public function update_behaves_as_expected(): void { $category = Category::factory()->create(); - $name = $this->faker->name; - $image = $this->faker->word; - $active = $this->faker->boolean; + $name = $this->faker->name(); + $image = $this->faker->word(); + $active = $this->faker->boolean(); $response = $this->put(route('categories.update', $category), [ 'name' => $name,