本文整理汇总了PHP中Step::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Step::getAll方法的具体用法?PHP Step::getAll怎么用?PHP Step::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Step
的用法示例。
在下文中一共展示了Step::getAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_save
function test_save()
{
//Arrange
$description = "Buy book on learning French";
$project_id = 1;
$position = 1;
$test_step = new Step($description, $project_id, $position);
//Act
$test_step->save();
//Assert
$result = Step::getAll();
$this->assertEquals([$test_step], $result);
}
示例2: test_delete
function test_delete()
{
//Arrange
$description = "Buy book on learning French";
$project_id = 1;
$position = 1;
$test_step = new Step($description, $project_id, $position);
$test_step->save();
$description2 = "Buy French bread";
$project_id2 = 1;
$position2 = 2;
$test_step2 = new Step($description2, $project_id2, $position2);
$test_step2->save();
//Act
$test_step->delete();
$result = Step::getAll();
//Assert
$this->assertEquals([$test_step2], $result);
}
示例3: find
static function find($search_id)
{
$found_step = null;
$steps = Step::getAll();
foreach ($steps as $step) {
if ($step->getId() == $search_id) {
$found_step = $step;
}
}
return $found_step;
}