Bug位置:CDbFixtureManager::prepare()
受影响版本:1.1.0,1.1.1
原始代码:
119行 foreach($this->getFixtures() as $fixture)
120行 $this->loadFixture($fixture);
正确代码:
119行 foreach($this->getFixtures() as $tableName => $fixture)
120行 $this->loadFixture($tableName);
描述:配置了fixture元件以后,当使用Yii::app()->fixture访问该元件时,系统并没有插入tests/fixtures目录下的原始记录.
希望老大确认该Bug是否存在,谢谢.
另外还想问一下在YII的官方文档里好像有说到当首次访问Yii::app()->fixture元件时,系统会截断(truncating)tests/fixtures目录下对应的数据库表,但是好像源代码只进行了插入记录的操作而没有截断数据库表和恢复表主键顺序值,请问是不是还没有实现截断数据库表和恢复主键顺序值的功能?原文描述如下:
When CDbFixtureManager is referenced for the first time, it will go through every fixture file and use it to reset the corresponding table. It resets a table by truncating the table, resetting the sequence value for the table’s auto-incremental primary key, and then inserting the rows of data from the fixture file into the table.