Commit 91c86fb7 by Paul Klimov

MongoDB ActiveRecord uit test advanced to check integer value handling.

parent 8ede55a0
...@@ -243,4 +243,24 @@ class ActiveRecordTest extends MongoDbTestCase ...@@ -243,4 +243,24 @@ class ActiveRecordTest extends MongoDbTestCase
$record2 = Customer::find($record->_id); $record2 = Customer::find($record->_id);
$this->assertEquals($newAddress, $record2->address); $this->assertEquals($newAddress, $record2->address);
} }
/**
* @depends testFind
* @depends testInsert
*/
public function testQueryByIntegerField()
{
$record = new Customer;
$record->name = 'new name';
$record->status = 7;
$record->save();
$row = Customer::find()->where(['status' => 7])->one();
$this->assertNotEmpty($row);
$this->assertEquals(7, $row->status);
$rowRefreshed = Customer::find()->where(['status' => $row->status])->one();
$this->assertNotEmpty($rowRefreshed);
$this->assertEquals(7, $rowRefreshed->status);
}
} }
\ No newline at end of file
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