@@ 52-65 (lines=14) @@ | ||
49 | $this->assertNotNull($results); |
|
50 | } |
|
51 | ||
52 | public function testCreatingModelClearsCache() |
|
53 | { |
|
54 | $author = (new Author)->with('books')->get()->first(); |
|
55 | $author->name = "John Jinglheimer"; |
|
56 | $author->save(); |
|
57 | ||
58 | $results = cache()->tags([ |
|
59 | 'genealabslaravelmodelcachingtestsfixturesauthor', |
|
60 | 'genealabslaravelmodelcachingtestsfixturesbook' |
|
61 | ]) |
|
62 | ->get('genealabslaravelmodelcachingtestsfixturesauthor_1_2_3_4_5_6_7_8_9_10-genealabslaravelmodelcachingtestsfixturesbooks'); |
|
63 | ||
64 | $this->assertNull($results); |
|
65 | } |
|
66 | ||
67 | public function testDeletingModelClearsCache() |
|
68 | { |
|
@@ 67-79 (lines=13) @@ | ||
64 | $this->assertNull($results); |
|
65 | } |
|
66 | ||
67 | public function testDeletingModelClearsCache() |
|
68 | { |
|
69 | $author = (new Author)->with('books')->get()->first(); |
|
70 | $author->delete(); |
|
71 | ||
72 | $results = cache()->tags([ |
|
73 | 'genealabslaravelmodelcachingtestsfixturesauthor', |
|
74 | 'genealabslaravelmodelcachingtestsfixturesbook' |
|
75 | ]) |
|
76 | ->get('genealabslaravelmodelcachingtestsfixturesauthor_1_2_3_4_5_6_7_8_9_10-genealabslaravelmodelcachingtestsfixturesbooks'); |
|
77 | ||
78 | $this->assertNull($results); |
|
79 | } |
|
80 | } |
|
81 |