本文整理汇总了PHP中TestCase::model方法的典型用法代码示例。如果您正苦于以下问题:PHP TestCase::model方法的具体用法?PHP TestCase::model怎么用?PHP TestCase::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestCase
的用法示例。
在下文中一共展示了TestCase::model方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionSaveWPQuest
public function actionSaveWPQuest($id)
{
$run = Runs::model()->findByPk($id);
$plataforma = Platforms::model()->findByPk($run['id_platform']);
// array com os testes default
$defaultTestsKeys = array(1.1, 1.2, 1.3, 2.1, 2.2, 2.3, 2.4, 5.1, 5.2, 5.3, 5.4, 7.3, 7.4, 7.5, 7.6, 7.7, 8.1, 8.199999999999999, 8.300000000000001, 8.4, 8.5);
// pegar os ID,s selecionados
// verificar inde tem virgula
// montar uma lista com todos os compostos
// replicar esse codigo abaixo
// consertar essa gambiarra URGENTE
foreach ($defaultTestsKeys as $key) {
$testRuns = TestCase::model()->findBySql('SELECT * FROM `test_case` where num = ' . $key);
if ($testRuns["id"] != "") {
$id_testcase = $testRuns["id"];
// echo $testRuns["id"]."<br/>";
$id_runs = $id;
$connection = Yii::app()->db;
$command = $connection->createCommand("INSERT INTO `test_run`(`id_runs`, `id_test_case`, `status`) VALUES (" . $id_runs . "," . $testRuns["id"] . ",0)");
$rowCount = $command->execute();
}
}
$this->redirect(array('view', 'id' => $id));
}
示例2: loadModel
/**
* 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 TestCase the loaded model
* @throws CHttpException
*/
public function loadModel($id)
{
$model = TestCase::model()->findByPk($id);
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}