From e0524cda14d69c5a6d25af49bf5a333c2f860a19 Mon Sep 17 00:00:00 2001 From: fentie Date: Sat, 14 Oct 2017 23:58:45 -0500 Subject: [PATCH 1/2] fixing case of method name --- tests/Unit/CachedBuilderTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Unit/CachedBuilderTest.php b/tests/Unit/CachedBuilderTest.php index 1b9983a..45789da 100644 --- a/tests/Unit/CachedBuilderTest.php +++ b/tests/Unit/CachedBuilderTest.php @@ -413,7 +413,7 @@ public function testValueModelResultsCreatesCache() $this->assertEquals($liveResults, $cachedResults); } - public function testNestedRelationshipEagerloading() + public function testNestedRelationshipEagerLoading() { $authors = collect([(new Author)->with('books.publisher') ->first()]); From 84092bbd9480610a0b297a73bd524be53bfa09a1 Mon Sep 17 00:00:00 2001 From: fentie Date: Sat, 14 Oct 2017 23:59:10 -0500 Subject: [PATCH 2/2] adding test for where column parsing --- tests/Unit/CachedBuilderTest.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/Unit/CachedBuilderTest.php b/tests/Unit/CachedBuilderTest.php index 45789da..b5d888a 100644 --- a/tests/Unit/CachedBuilderTest.php +++ b/tests/Unit/CachedBuilderTest.php @@ -510,8 +510,19 @@ public function testExistsRelationshipWhereClauseParsing() public function testColumnsRelationshipWhereClauseParsing() { - // ??? - $this->markTestIncomplete(); + $author = (new Author)->orderBy('name')->first(); + + $authors = collect([(new Author)->where('name', '=', $author->name)->first()]); + + $key = 'genealabslaravelmodelcachingtestsfixturesauthor-name_' . $author->name . '-first'; + $tags = ['genealabslaravelmodelcachingtestsfixturesauthor']; + + $cachedResults = collect([cache()->tags($tags)->get($key)]); + + $liveResults = collect([(new UncachedAuthor)->where('name', '=', $author->name)->first()]); + + $this->assertEmpty($authors->diffAssoc($cachedResults)); + $this->assertEmpty($liveResults->diffAssoc($cachedResults)); } public function testRawWhereClauseParsing()