Skip to content

Commit

Permalink
Add integration test for #5267
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Dec 2, 2014
1 parent 4a99d68 commit fa9b7f8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/TestCase/ORM/QueryRegressionTest.php
Expand Up @@ -535,4 +535,18 @@ public function testCountWithUnionQuery() {
$this->assertEquals(2, $query->count());
}

/**
* Integration test when selecting no fields on the primary table.
*
* @return void
*/
public function testSelectNoFieldsOnPrimaryAlias() {
$table = TableRegistry::get('Articles');
$table->belongsTo('Users');
$query = $table->find()
->select(['Users__id' => 'id']);
$results = $query->toArray();
$this->assertCount(3, $results);
}

}

0 comments on commit fa9b7f8

Please sign in to comment.