| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace GeneaLabs\LaravelModelCaching\Tests\Integration\CachedBuilder; |
||
| 8 | public function testFirstOrCreateFlushesCacheForModel() |
||
| 9 | { |
||
| 10 | (new Author)->truncate(); |
||
| 11 | |||
| 12 | $items = [ |
||
| 13 | ['name' => 'foo', 'email' => '[email protected]'], |
||
| 14 | ['name' => 'foo', 'email' => '[email protected]'], |
||
| 15 | ['name' => 'foo', 'email' => '[email protected]'], |
||
| 16 | ['name' => 'foo', 'email' => '[email protected]'], |
||
| 17 | ['name' => 'foo', 'email' => '[email protected]'], |
||
| 18 | ]; |
||
| 19 | |||
| 20 | foreach ($items as $item) { |
||
| 21 | (new Author)->firstOrCreate($item); |
||
| 22 | } |
||
| 23 | |||
| 24 | $authors = (new Author)->get(); |
||
| 25 | |||
| 26 | $this->assertEquals(5, $authors->count()); |
||
| 27 | } |
||
| 28 | } |
||
| 29 |