|
@@ 58-74 (lines=17) @@
|
| 55 |
|
$this->assertNull($results); |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
public function testUpdatingModelClearsCache() |
| 59 |
|
{ |
| 60 |
|
$author = (new Author)->with('books')->get()->first(); |
| 61 |
|
$author->name = "John Jinglheimer"; |
| 62 |
|
$author->save(); |
| 63 |
|
|
| 64 |
|
$results = $this->cache()->tags([ |
| 65 |
|
"genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:genealabslaravelmodelcachingtestsfixturesauthor", |
| 66 |
|
"genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:genealabslaravelmodelcachingtestsfixturesbook" |
| 67 |
|
]) |
| 68 |
|
->get(sha1( |
| 69 |
|
"genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:authors:genealabslaravelmodelcachingtestsfixturesauthor_1_2_3_4_5_6_" . |
| 70 |
|
"7_8_9_10-genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:genealabslaravelmodelcachingtestsfixturesbooks" |
| 71 |
|
)); |
| 72 |
|
|
| 73 |
|
$this->assertNull($results); |
| 74 |
|
} |
| 75 |
|
|
| 76 |
|
public function testDeletingModelClearsCache() |
| 77 |
|
{ |
|
@@ 76-91 (lines=16) @@
|
| 73 |
|
$this->assertNull($results); |
| 74 |
|
} |
| 75 |
|
|
| 76 |
|
public function testDeletingModelClearsCache() |
| 77 |
|
{ |
| 78 |
|
$author = (new Author)->with('books')->get()->first(); |
| 79 |
|
$author->delete(); |
| 80 |
|
|
| 81 |
|
$results = $this->cache()->tags([ |
| 82 |
|
"genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:genealabslaravelmodelcachingtestsfixturesauthor", |
| 83 |
|
"genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:genealabslaravelmodelcachingtestsfixturesbook" |
| 84 |
|
]) |
| 85 |
|
->get(sha1( |
| 86 |
|
"genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:authors:genealabslaravelmodelcachingtestsfixturesauthor_1_2_3_4_5_6_" . |
| 87 |
|
"7_8_9_10-genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:genealabslaravelmodelcachingtestsfixturesbooks" |
| 88 |
|
)); |
| 89 |
|
|
| 90 |
|
$this->assertNull($results); |
| 91 |
|
} |
| 92 |
|
|
| 93 |
|
public function testHasManyRelationshipIsCached() |
| 94 |
|
{ |