for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace GeneaLabs\LaravelModelCaching\Tests\Integration\CachedBuilder;
use GeneaLabs\LaravelModelCaching\Tests\Fixtures\Author;
use GeneaLabs\LaravelModelCaching\Tests\IntegrationTestCase;
class FirstOrCreateTest extends IntegrationTestCase
{
public function testFirstOrCreateFlushesCacheForModel()
(new Author)->truncate();
$items = [
['name' => 'foo', 'email' => '[email protected]'],
];
foreach ($items as $item) {
(new Author)->firstOrCreate($item);
}
$authors = (new Author)->get();
$this->assertEquals(5, $authors->count());