Skip to content

Commit

Permalink
Merge pull request #18 from hanneskaeufler/hk-issue-17
Browse files Browse the repository at this point in the history
Add unit test for raw clause parsing
  • Loading branch information
mikebronner committed Oct 12, 2017
2 parents 0e0add1 + 73de75f commit 8fb0532
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/Unit/CachedBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,18 @@ public function testColumnsRelationshipWhereClauseParsing()

public function testRawWhereClauseParsing()
{
// ->whereRaw(...)
$this->markTestIncomplete();
$authors = collect([(new Author)
->whereRaw('name <> \'\'')->first()]);

$key = 'genealabslaravelmodelcachingtestsfixturesauthor_and_name-first';
$tags = ['genealabslaravelmodelcachingtestsfixturesauthor'];

$cachedResults = collect([cache()->tags($tags)->get($key)]);

$liveResults = collect([(new UncachedAuthor)
->whereRaw('name <> \'\'')->first()]);

$this->assertTrue($authors->diffAssoc($cachedResults)->isEmpty());
$this->assertTrue($liveResults->diffAssoc($cachedResults)->isEmpty());
}
}

0 comments on commit 8fb0532

Please sign in to comment.