@@ 518-539 (lines=22) @@ | ||
515 | $this->assertEmpty($liveResults->diffKeys($cachedResults)); |
|
516 | } |
|
517 | ||
518 | public function testRelationshipQueriesAreCached() |
|
519 | { |
|
520 | $books = (new Author) |
|
521 | ->first() |
|
522 | ->books() |
|
523 | ->get(); |
|
524 | $key = sha1("genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:books:genealabslaravelmodelcachingtestsfixturesbook-books.author_id_=_1-books.author_id_notnull"); |
|
525 | $tags = [ |
|
526 | "genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:genealabslaravelmodelcachingtestsfixturesbook" |
|
527 | ]; |
|
528 | ||
529 | $cachedResults = $this->cache() |
|
530 | ->tags($tags) |
|
531 | ->get($key)['value']; |
|
532 | $liveResults = (new UncachedAuthor) |
|
533 | ->first() |
|
534 | ->books() |
|
535 | ->get(); |
|
536 | ||
537 | $this->assertTrue($cachedResults->diffKeys($books)->isEmpty()); |
|
538 | $this->assertTrue($liveResults->diffKeys($books)->isEmpty()); |
|
539 | } |
|
540 | ||
541 | public function testRawOrderByWithoutColumnReference() |
|
542 | { |
|
@@ 541-560 (lines=20) @@ | ||
538 | $this->assertTrue($liveResults->diffKeys($books)->isEmpty()); |
|
539 | } |
|
540 | ||
541 | public function testRawOrderByWithoutColumnReference() |
|
542 | { |
|
543 | $authors = (new Author) |
|
544 | ->orderByRaw('DATE()') |
|
545 | ->get(); |
|
546 | ||
547 | $key = sha1("genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:authors:genealabslaravelmodelcachingtestsfixturesauthor-authors.deleted_at_null_orderByRaw_date"); |
|
548 | $tags = ["genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:genealabslaravelmodelcachingtestsfixturesauthor"]; |
|
549 | ||
550 | $cachedResults = $this->cache() |
|
551 | ->tags($tags) |
|
552 | ->get($key)['value']; |
|
553 | ||
554 | $liveResults = (new UncachedAuthor) |
|
555 | ->orderByRaw('DATE()') |
|
556 | ->get(); |
|
557 | ||
558 | $this->assertTrue($cachedResults->diffKeys($authors)->isEmpty()); |
|
559 | $this->assertTrue($liveResults->diffKeys($authors)->isEmpty()); |
|
560 | } |
|
561 | ||
562 | public function testDelete() |
|
563 | { |