Skip to content

Commit

Permalink
adding test for where column parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
fentie committed Oct 15, 2017
1 parent e0524cd commit 84092bb
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 @@ -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()
Expand Down

0 comments on commit 84092bb

Please sign in to comment.