|
@@ 63-76 (lines=14) @@
|
| 60 |
|
$this->assertNotNull($results); |
| 61 |
|
} |
| 62 |
|
|
| 63 |
|
public function testCreatingModelClearsCache() |
| 64 |
|
{ |
| 65 |
|
$author = (new Author)->with('books')->get()->first(); |
| 66 |
|
$author->name = "John Jinglheimer"; |
| 67 |
|
$author->save(); |
| 68 |
|
|
| 69 |
|
$results = cache()->tags([ |
| 70 |
|
'genealabslaravelmodelcachingtestsfixturesauthor', |
| 71 |
|
'genealabslaravelmodelcachingtestsfixturesbook' |
| 72 |
|
]) |
| 73 |
|
->get('genealabslaravelmodelcachingtestsfixturesauthor_1_2_3_4_5_6_7_8_9_10-genealabslaravelmodelcachingtestsfixturesbooks'); |
| 74 |
|
|
| 75 |
|
$this->assertNull($results); |
| 76 |
|
} |
| 77 |
|
|
| 78 |
|
public function testDeletingModelClearsCache() |
| 79 |
|
{ |
|
@@ 78-90 (lines=13) @@
|
| 75 |
|
$this->assertNull($results); |
| 76 |
|
} |
| 77 |
|
|
| 78 |
|
public function testDeletingModelClearsCache() |
| 79 |
|
{ |
| 80 |
|
$author = (new Author)->with('books')->get()->first(); |
| 81 |
|
$author->delete(); |
| 82 |
|
|
| 83 |
|
$results = cache()->tags([ |
| 84 |
|
'genealabslaravelmodelcachingtestsfixturesauthor', |
| 85 |
|
'genealabslaravelmodelcachingtestsfixturesbook' |
| 86 |
|
]) |
| 87 |
|
->get('genealabslaravelmodelcachingtestsfixturesauthor_1_2_3_4_5_6_7_8_9_10-genealabslaravelmodelcachingtestsfixturesbooks'); |
| 88 |
|
|
| 89 |
|
$this->assertNull($results); |
| 90 |
|
} |
| 91 |
|
|
| 92 |
|
public function testHasManyRelationshipIsCached() |
| 93 |
|
{ |