/** * @depends testInsert * * @see https://github.com/yiisoft/yii2/issues/6026 */ public function testInsertEmptyAttributes() { $record = new Customer(); $record->save(false); $this->assertTrue($record->_id instanceof \MongoId); $this->assertFalse($record->isNewRecord); }
/** * @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); }