public function testEmptySimpleGet()
{
// 模拟获取主键列表,返回空结果
$this->conn->shouldReceive('select')->with('select * from "user" where "id" in (?, ?)', [1, 2], true)->andReturn([(object) ['id' => 2, 'name' => '海涛']]);
// 查询完成后需要将数据写入缓存
$this->cache->shouldReceive('set')->with(['3558193cd9818af7fe4d2c2f5bd9d00f' => [], '343a10e6c2480e111dd3e9e564eb7966' => (object) ['id' => 2, 'name' => '海涛']]);
// 模拟未命中表级缓存
$this->cache->shouldReceive('get')->with(['3558193cd9818af7fe4d2c2f5bd9d00f', '343a10e6c2480e111dd3e9e564eb7966'])->andReturn([]);
$users = User::whereIn('id', [1, 2])->get();
$this->assertEquals(1, count($users));
$user = $users[0];
$this->assertEquals('海涛', $user->name);
}