| Conditions | 1 |
| Paths | 1 |
| Total Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace GeneaLabs\LaravelModelCaching\Tests\Feature\Nova; |
||
| 8 | public function testUpdateFlushesCacheForModel() |
||
| 9 | { |
||
| 10 | $beforeAuthors = (new Author)->get(); |
||
| 11 | $author = $beforeAuthors->first(); |
||
| 12 | |||
| 13 | $this->putJson('nova-api/authors/' . $author->id, [ |
||
| 14 | 'name' => 'foo', |
||
| 15 | 'email' => '[email protected]', |
||
| 16 | ]); |
||
| 17 | |||
| 18 | $authors = (new Author)->get(); |
||
| 19 | |||
| 20 | $this->response->assertStatus(200); |
||
| 21 | $this->assertCount(10, $beforeAuthors); |
||
| 22 | $this->assertCount(10, $authors); |
||
| 23 | |||
| 24 | $updatedAuthor = $authors->first(); |
||
| 25 | $this->assertTrue($updatedAuthor->is($author)); |
||
| 26 | $this->assertSame('foo', $updatedAuthor->name); |
||
| 27 | $this->assertSame('[email protected]', $updatedAuthor->email); |
||
| 28 | |||
| 29 | $author->refresh(); |
||
| 30 | $this->assertSame('foo', $author->name); |
||
| 31 | $this->assertSame('[email protected]', $author->email); |
||
| 32 | } |
||
| 33 | } |
||
| 34 |