@@ 92-104 (lines=13) @@ | ||
89 | $this->assertNull($results); |
|
90 | } |
|
91 | ||
92 | public function testHasManyRelationshipIsCached() |
|
93 | { |
|
94 | $authors = (new Author)->with('books')->get(); |
|
95 | $authorIds = implode('_', $authors->pluck('id')->toArray()); |
|
96 | ||
97 | $results = cache()->tags([ |
|
98 | 'genealabslaravelmodelcachingtestsfixturesauthor', |
|
99 | 'genealabslaravelmodelcachingtestsfixturesbook' |
|
100 | ]) |
|
101 | ->get("genealabslaravelmodelcachingtestsfixturesauthor_{$authorIds}-genealabslaravelmodelcachingtestsfixturesbooks"); |
|
102 | ||
103 | $this->assertNotNull($results); |
|
104 | } |
|
105 | ||
106 | public function testBelongsToRelationshipIsCached() |
|
107 | { |
|
@@ 106-118 (lines=13) @@ | ||
103 | $this->assertNotNull($results); |
|
104 | } |
|
105 | ||
106 | public function testBelongsToRelationshipIsCached() |
|
107 | { |
|
108 | $books = (new Book)->with('author')->get()->first(); |
|
109 | $bookIds = implode('_', $books->pluck('id')->toArray()); |
|
110 | ||
111 | $results = cache()->tags([ |
|
112 | 'genealabslaravelmodelcachingtestsfixturesbook', |
|
113 | 'genealabslaravelmodelcachingtestsfixturesauthor' |
|
114 | ]) |
|
115 | ->get("genealabslaravelmodelcachingtestsfixturesbook_{$bookIds}-genealabslaravelmodelcachingtestsfixturesauthors"); |
|
116 | ||
117 | $this->assertNotNull($results); |
|
118 | } |
|
119 | ||
120 | public function testBelongsToManyRelationshipIsCached() |
|
121 | { |
|
@@ 120-132 (lines=13) @@ | ||
117 | $this->assertNotNull($results); |
|
118 | } |
|
119 | ||
120 | public function testBelongsToManyRelationshipIsCached() |
|
121 | { |
|
122 | $books = (new Book)->with('stores')->get(); |
|
123 | $bookIds = implode('_', $books->pluck('id')->toArray()); |
|
124 | ||
125 | $results = cache()->tags([ |
|
126 | 'genealabslaravelmodelcachingtestsfixturesbook', |
|
127 | 'genealabslaravelmodelcachingtestsfixturesstore' |
|
128 | ]) |
|
129 | ->get("genealabslaravelmodelcachingtestsfixturesbook_{$bookIds}-genealabslaravelmodelcachingtestsfixturesstores"); |
|
130 | ||
131 | $this->assertNotNull($results); |
|
132 | } |
|
133 | ||
134 | public function testHasOneRelationshipIsCached() |
|
135 | { |
|
@@ 134-146 (lines=13) @@ | ||
131 | $this->assertNotNull($results); |
|
132 | } |
|
133 | ||
134 | public function testHasOneRelationshipIsCached() |
|
135 | { |
|
136 | $authors = (new Author)->with('profile')->get(); |
|
137 | $authorIds = implode('_', $authors->pluck('id')->toArray()); |
|
138 | ||
139 | $results = cache()->tags([ |
|
140 | 'genealabslaravelmodelcachingtestsfixturesauthor', |
|
141 | 'genealabslaravelmodelcachingtestsfixturesprofile' |
|
142 | ]) |
|
143 | ->get("genealabslaravelmodelcachingtestsfixturesauthor_{$authorIds}-genealabslaravelmodelcachingtestsfixturesprofiles"); |
|
144 | ||
145 | $this->assertNotNull($results); |
|
146 | } |
|
147 | } |
|
148 |