/** * Tests returning a model directly from a SELECT. * * @dataProvider provider_single_select * @param Jelly $model * @param bool $exists * @return void */ public function test_single_select($model, $exists) { $this->assertTrue($model instanceof Jelly_Model); if ($exists) { $this->assertTrue($model->loaded()); $this->assertTrue($model->saved()); $this->assertTrue($model->id > 0); } else { $this->assertFalse($model->loaded()); $this->assertFalse($model->saved()); $this->assertTrue($model->id === $model->meta()->field('id')->default); } }