/** * @covers ::save * @covers ::get */ public function testGet() { $positionData = (object) array('reasons' => 'TOO COOL', 'attendance' => 'EVERY HOUR OF EVERY DAY', 'attitude' => 'GODLIKE', 'performance' => 'THE BEST', 'netID' => 'netId', 'submitter' => 'employee2', 'area' => 2, 'rehirable' => 'true', 'guid' => null); $positionAccessor = new EmployeeTermination(); $positionAccessor->save($positionData); $position = $positionAccessor->get('netId'); $this->assertEquals($position->reasons, 'TOO COOL'); $this->assertEquals($position->attendance, 'EVERY HOUR OF EVERY DAY'); $this->assertEquals($position->attitude, 'GODLIKE'); $this->assertEquals($position->performance, 'THE BEST'); $this->assertEquals($position->netID, 'netId'); $this->assertEquals($position->submitter, 'employee2'); $this->assertEquals($position->area, 2); $this->assertEquals($position->rehirable, 'true'); }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return EmployeeTermination the loaded model * @throws CHttpException */ public function loadModel($id) { $model = EmployeeTermination::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<button type="button" class="btn btn-default" id="choose_employee">Choose</button> </span> </div> <?php echo CHtml::error($model, 'employee_id'); ?> </div> </div> <div class="form-group"> <?php echo CHtml::activeLabelEx($model, 'terminate_type', array('class' => $label_class)); ?> <div class="col-md-6 col-xs-12"> <?php echo CHtml::activeDropDownList($model, 'terminate_type', EmployeeTermination::model()->getTypes(), array('prompt' => '', 'class' => 'validate[required] form-control select')); ?> <?php echo CHtml::error($model, 'terminate_type'); ?> </div> </div> <div class="form-group"> <?php echo CHtml::activeLabelEx($model, 'terminate_date', array('class' => $label_class)); ?> <div class="col-md-6 col-xs-12"> <div class="input-group"> <span class="input-group-addon"><span class="fa fa-calendar"></span></span> <?php