Commit 1e585707 by Paul Klimov

Unit test sphinx\ActiveRecordTest fixed

parent 4e6aa211
...@@ -148,7 +148,7 @@ class ActiveRecordTest extends SphinxTestCase ...@@ -148,7 +148,7 @@ class ActiveRecordTest extends SphinxTestCase
$record->save(); $record->save();
// save // save
$record = RuntimeIndex::find(['id' => 2]); $record = RuntimeIndex::find(2);
$this->assertTrue($record instanceof RuntimeIndex); $this->assertTrue($record instanceof RuntimeIndex);
$this->assertEquals(7, $record->type_id); $this->assertEquals(7, $record->type_id);
$this->assertFalse($record->isNewRecord); $this->assertFalse($record->isNewRecord);
...@@ -162,9 +162,9 @@ class ActiveRecordTest extends SphinxTestCase ...@@ -162,9 +162,9 @@ class ActiveRecordTest extends SphinxTestCase
// replace // replace
$query = 'replace'; $query = 'replace';
$rows = RuntimeIndex::find($query); $rows = RuntimeIndex::find()->match($query)->all();
$this->assertEmpty($rows); $this->assertEmpty($rows);
$record = RuntimeIndex::find(['id' => 2]); $record = RuntimeIndex::find(2);
$record->content = 'Test content with ' . $query; $record->content = 'Test content with ' . $query;
$record->save(); $record->save();
$rows = RuntimeIndex::find()->match($query); $rows = RuntimeIndex::find()->match($query);
...@@ -192,9 +192,9 @@ class ActiveRecordTest extends SphinxTestCase ...@@ -192,9 +192,9 @@ class ActiveRecordTest extends SphinxTestCase
$record->category = [1, 2]; $record->category = [1, 2];
$record->save(); $record->save();
$record = RuntimeIndex::find(['id' => 2]); $record = RuntimeIndex::find(2);
$record->delete(); $record->delete();
$record = RuntimeIndex::find(['id' => 2]); $record = RuntimeIndex::find(2);
$this->assertNull($record); $this->assertNull($record);
// deleteAll // deleteAll
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment