Skip to content

Commit d66b6c0

Browse files
authored
fix times() calls (#54141)
`times()` is a static method on the factory, and should be called as such, not as an instance method. `times()` also already calls `new()` so no reason to do it twice.
1 parent aed6bbe commit d66b6c0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/Database/DatabaseEloquentFactoryTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public function test_lazy_model_attributes_can_be_created()
233233

234234
public function test_multiple_model_attributes_can_be_created()
235235
{
236-
$posts = FactoryTestPostFactory::new()->times(10)->raw();
236+
$posts = FactoryTestPostFactory::times(10)->raw();
237237
$this->assertIsArray($posts);
238238

239239
$this->assertCount(10, $posts);

tests/Integration/Support/OnceHelperTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class OnceHelperTest extends TestCase
1717

1818
protected function afterRefreshingDatabase()
1919
{
20-
UserFactory::new()->times(3)->create();
21-
UserFactory::new()->times(2)->unverified()->create();
20+
UserFactory::times(3)->create();
21+
UserFactory::times(2)->unverified()->create();
2222
}
2323

2424
public function testItCanCacheStaticMethodWithoutParameters()

0 commit comments

Comments
 (0)