amargoCactus
02/14/2022, 12:51 PMFourStacks
02/14/2022, 2:39 PMFourStacks
02/14/2022, 2:39 PM/** @test */
public function testing()
{
Demo::factory()
->count(8)
->state(new Sequence(
['title' => 'Article 1'],
['title' => 'Article 2'],
['title' => 'Article 3'],
['title' => 'Article 4'],
['title' => 'Article 5'],
['title' => 'Article 6'],
['title' => 'Article 7'],
['title' => 'Article 8'],
))
->create();
$this->assertTrue(true);
}FourStacks
02/14/2022, 2:40 PMFourStacks
02/14/2022, 2:40 PM/** @test */
public function testing()
{
Article::factory()
->count(8)
->state(new Sequence(
['title' => 'Article 1'],
['title' => 'Article 2'],
['title' => 'Article 3'],
['title' => 'Article 4'],
['title' => 'Article 5'],
['title' => 'Article 6'],
['title' => 'Article 7'],
['title' => 'Article 8']
))
->create();
$this->assertTrue(true);
}FourStacks
02/14/2022, 2:41 PMRefreshDatabase. These tests are all using a sqlite in-memory DB by the way.FourStacks
02/14/2022, 2:43 PMFourStacks
02/14/2022, 2:49 PMArticle models via the repository create method:FourStacks
02/14/2022, 2:49 PM/** @test */
public function testing()
{
collect([
'Article 1',
'Article 2',
'Article 3',
'Article 4',
'Article 5',
'Article 6',
'Article 7',
'Article 8'
])->each(function($title){
app(ArticleRepository::class)->create([
'title' => $title,
'published' => true,
]);
});
$this->assertTrue(true);
}FourStacks
02/14/2022, 2:50 PMifox
02/14/2022, 2:51 PMFourStacks
02/14/2022, 2:51 PMifox
02/14/2022, 2:51 PMFourStacks
02/14/2022, 3:12 PMSearchable trait. Once I remove that they run like greased lightning. Just need to add <server name="SCOUT_DRIVER" value="null"/> to my phpunit.xml and all is well again. Sorry to have wasted your time @User!ifox
02/14/2022, 3:12 PMamargoCactus
02/15/2022, 12:45 PMamargoCactus
02/15/2022, 12:47 PMHarings Rob
02/15/2022, 12:57 PMamargoCactus
02/15/2022, 1:50 PMuser
02/16/2022, 7:39 PMifox
02/16/2022, 7:46 PMuser
02/16/2022, 7:47 PMamargoCactus
02/17/2022, 12:15 PMamargoCactus
02/17/2022, 12:17 PMifox
02/17/2022, 12:25 PMSami
02/17/2022, 12:25 PMifox
02/17/2022, 12:26 PMamargoCactus
02/17/2022, 12:26 PMSami
02/17/2022, 12:31 PM