Skip to content

Commit 5afc0d7

Browse files
committed
Change times to count
1 parent 03692fe commit 5afc0d7

12 files changed

+12
-12
lines changed

src/Generators/SeederGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ protected function build(string $model)
7575
{
7676
if (Blueprint::isLaravel8OrHigher()) {
7777
$this->addImport($model, $this->tree->fqcnForContext($model));
78-
return sprintf('%s::factory()->times(5)->create();', class_basename($this->tree->fqcnForContext($model)));
78+
return sprintf('%s::factory()->count(5)->create();', class_basename($this->tree->fqcnForContext($model)));
7979
}
8080
return sprintf('factory(\\%s::class, 5)->create();', $this->tree->fqcnForContext($model));
8181
}

src/Generators/TestGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ protected function buildTestCases(Controller $controller)
459459
} elseif ($statement instanceof QueryStatement) {
460460
$this->addRefreshDatabaseTrait($controller);
461461
if (Blueprint::isLaravel8OrHigher()) {
462-
$setup['data'][] = sprintf('$%s = %s::factory()->times(3)->create();', Str::plural($variable), $model);
462+
$setup['data'][] = sprintf('$%s = %s::factory()->count(3)->create();', Str::plural($variable), $model);
463463
} else {
464464
$setup['data'][] = sprintf('$%s = factory(%s::class, 3)->create();', Str::plural($variable), $model);
465465
}

tests/fixtures/seeders/CommentSeeder-laravel8.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ class CommentSeeder extends Seeder
1414
*/
1515
public function run()
1616
{
17-
Comment::factory()->times(5)->create();
17+
Comment::factory()->count(5)->create();
1818
}
1919
}

tests/fixtures/seeders/PostSeeder-laravel8.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ class PostSeeder extends Seeder
1414
*/
1515
public function run()
1616
{
17-
Post::factory()->times(5)->create();
17+
Post::factory()->count(5)->create();
1818
}
1919
}

tests/fixtures/tests/api-shorthand-validation-laravel8.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class CertificateControllerTest extends TestCase
2121
*/
2222
public function index_behaves_as_expected()
2323
{
24-
$certificates = Certificate::factory()->times(3)->create();
24+
$certificates = Certificate::factory()->count(3)->create();
2525

2626
$response = $this->get(route('certificate.index'));
2727

tests/fixtures/tests/certificate-pascal-case-example-laravel8.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class CertificateControllerTest extends TestCase
2121
*/
2222
public function index_behaves_as_expected()
2323
{
24-
$certificates = Certificate::factory()->times(3)->create();
24+
$certificates = Certificate::factory()->count(3)->create();
2525

2626
$response = $this->get(route('certificate.index'));
2727

tests/fixtures/tests/certificate-type-pascal-case-example-laravel8.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class CertificateTypeControllerTest extends TestCase
2020
*/
2121
public function index_behaves_as_expected()
2222
{
23-
$certificateTypes = CertificateType::factory()->times(3)->create();
23+
$certificateTypes = CertificateType::factory()->count(3)->create();
2424

2525
$response = $this->get(route('certificate-type.index'));
2626

tests/fixtures/tests/full-crud-example-laravel8.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class PostControllerTest extends TestCase
2020
*/
2121
public function index_displays_view()
2222
{
23-
$posts = Post::factory()->times(3)->create();
23+
$posts = Post::factory()->count(3)->create();
2424

2525
$response = $this->get(route('post.index'));
2626

tests/fixtures/tests/models-with-custom-namespace-laravel8.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class CategoryControllerTest extends TestCase
2020
*/
2121
public function index_behaves_as_expected()
2222
{
23-
$categories = Category::factory()->times(3)->create();
23+
$categories = Category::factory()->count(3)->create();
2424

2525
$response = $this->get(route('category.index'));
2626

tests/fixtures/tests/readme-example-laravel8.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class PostControllerTest extends TestCase
2727
*/
2828
public function index_displays_view()
2929
{
30-
$posts = Post::factory()->times(3)->create();
30+
$posts = Post::factory()->count(3)->create();
3131

3232
$response = $this->get(route('post.index'));
3333

0 commit comments

Comments
 (0)