Skip to content

Commit 12475f2

Browse files
authored
Merge pull request #19 from GeneaLabs/laravel-5.5
Laravel 5.5
2 parents b7a3cc6 + 8fb0532 commit 12475f2

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Diff for: tests/Unit/CachedBuilderTest.php

+13-2
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,18 @@ public function testColumnsRelationshipWhereClauseParsing()
500500

501501
public function testRawWhereClauseParsing()
502502
{
503-
// ->whereRaw(...)
504-
$this->markTestIncomplete();
503+
$authors = collect([(new Author)
504+
->whereRaw('name <> \'\'')->first()]);
505+
506+
$key = 'genealabslaravelmodelcachingtestsfixturesauthor_and_name-first';
507+
$tags = ['genealabslaravelmodelcachingtestsfixturesauthor'];
508+
509+
$cachedResults = collect([cache()->tags($tags)->get($key)]);
510+
511+
$liveResults = collect([(new UncachedAuthor)
512+
->whereRaw('name <> \'\'')->first()]);
513+
514+
$this->assertTrue($authors->diffAssoc($cachedResults)->isEmpty());
515+
$this->assertTrue($liveResults->diffAssoc($cachedResults)->isEmpty());
505516
}
506517
}

0 commit comments

Comments
 (0)