public function testSearchId() { $this->module->greedySearch = false; $this->module->setConnection('local', 1); $model = new RedisModel(); $model->setAttributes(['pattern' => 'testfxt:*', 'type' => ['string', 'list'], 'perpage' => 30]); $model->validate(); $func = $this->getProtected('getSearchId'); $searchId = $func->invoke($model); Debug::debug($searchId); $expect = 'testfxt:*:stringlist:30:local:1:'; $this->assertEquals($expect, $searchId); $this->module->greedySearch = true; $model->setAttributes(['pattern' => '*:*', 'type' => ['set', 'zset'], 'perpage' => 20]); $model->validate(); $searchId = $func->invoke($model); Debug::debug($searchId); $expect = '*:*:setzset:20:local:1:1'; $this->assertEquals($expect, $searchId); $this->module->setConnection('remote1', 0); $model = new RedisModel(); $model->setAttributes(['pattern' => '*fxt*', 'perpage' => 30]); $model->validate(); $func = $this->getProtected('getSearchId'); $searchId = $func->invoke($model); Debug::debug($searchId); $expect = '*fxt*:stringsetlistzsethash:30:remote1:0:1'; $this->assertEquals($expect, $searchId); }