public function testGetObjectTag()
 {
     $ar = new Table();
     $this->assertEquals($ar->className() . '[ObjectTag:1]', ActiveRecordCacheTags::getObjectTag($ar, 1));
     $this->assertEquals($ar->className() . '[ObjectTag:1|2]', ActiveRecordCacheTags::getObjectTag($ar, ['id1' => 1, 'id2' => 2]));
     $this->assertEquals($ar->className() . '[ObjectTag:1|2]', ActiveRecordCacheTags::getObjectTag($ar, ['id2' => 2, 'id1' => 1]));
 }
 public function testInvalidateTags()
 {
     $dependency = new TagDependency(['tags' => [ActiveRecordCacheTags::getCommonTag(Table::className())], 'reusable' => true]);
     $model = Table::getDb()->cache(function ($db) {
         return Table::findOne(['title' => 'row1']);
     }, 86400, $dependency);
     $this->assertFalse($dependency->getHasChanged(Yii::$app->cache));
     $model->delete();
     $this->assertTrue($dependency->getHasChanged(Yii::$app->cache));
 }