for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace GeneaLabs\LaravelModelCaching\Tests\Feature\Nova;
use GeneaLabs\LaravelModelCaching\Tests\Fixtures\Author;
use GeneaLabs\LaravelModelCaching\Tests\NovaTestCase;
class UpdateTest extends NovaTestCase
{
public function testUpdateFlushesCacheForModel()
$beforeAuthors = (new Author)->get();
$author = $beforeAuthors->first();
$this->putJson('nova-api/authors/' . $author->id, [
'name' => 'foo',
'email' => '[email protected]',
]);
$authors = (new Author)->get();
$this->response->assertStatus(200);
$this->assertCount(10, $beforeAuthors);
$this->assertCount(10, $authors);
$updatedAuthor = $authors->first();
$this->assertTrue($updatedAuthor->is($author));
$this->assertSame('foo', $updatedAuthor->name);
$this->assertSame('[email protected]', $updatedAuthor->email);
$author->refresh();
$this->assertSame('foo', $author->name);
$this->assertSame('[email protected]', $author->email);
}