/**
* Integration test for query caching.
*
* @return void
*/
public function testCacheWriteIntegration()
{
$table = TableRegistry::get('Articles');
$query = new Query($this->connection, $table);
$query->select(['id', 'title']);
$cacher = $this->getMock('Cake\\Cache\\CacheEngine');
$cacher->expects($this->once())->method('write')->with('my_key', $this->isInstanceOf('Cake\\Datasource\\ResultSetInterface'));
$query->cache('my_key', $cacher)->where(['id' => 1]);
$query->all();
}