Skip to content

Commit 57cd24c

Browse files
committed
Update test for whereHas testing
1 parent 6ab9107 commit 57cd24c

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

tests/Unit/CachedBuilderTest.php

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -504,26 +504,17 @@ public function testNestedRelationshipWhereClauseParsing()
504504

505505
public function testExistsRelationshipWhereClauseParsing()
506506
{
507-
508-
$authors = collect([(new Author)->whereHas('books')->first()]);
509-
510-
$key = 'genealabslaravelmodelcachingtestsfixturesauthor_and_authors.id_=_books.author_id-first';
507+
$authors = (new Author)->whereHas('books')
508+
->get();
509+
$key = 'genealabslaravelmodelcachingtestsfixturesauthor_and_authors.id_=_books.author_id';
511510
$tags = ['genealabslaravelmodelcachingtestsfixturesauthor'];
512511

513-
$cachedResults = collect([cache()->tags($tags)->get($key)]);
514-
515-
$liveResults = collect([(new UncachedAuthor)
516-
->whereHas('books')->first()]);
517-
518-
$this->assertTrue($authors->diffAssoc($cachedResults)->isEmpty());
519-
$this->assertTrue($liveResults->diffAssoc($cachedResults)->isEmpty());
520-
521-
}
512+
$cachedResults = cache()->tags($tags)->get($key);
513+
$liveResults = (new UncachedAuthor)->whereHas('books')
514+
->get();
522515

523-
public function testColumnsRelationshipWhereClauseParsing()
524-
{
525-
// ???
526-
$this->markTestIncomplete();
516+
$this->assertEmpty($authors->diffAssoc($cachedResults));
517+
$this->assertEmpty($liveResults->diffAssoc($cachedResults));
527518
}
528519

529520
public function testRawWhereClauseParsing()

0 commit comments

Comments
 (0)