本文整理汇总了PHP中Category::getTasks方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::getTasks方法的具体用法?PHP Category::getTasks怎么用?PHP Category::getTasks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Category
的用法示例。
在下文中一共展示了Category::getTasks方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetTasks
function testGetTasks()
{
$name = "Work stuff";
$id = null;
$test_category = new Category($name, $id);
$test_category->save();
$test_category_id = $test_category->getId();
$due_date = '0000-00-00';
$description = "Email client";
$test_task = new Task($description, $id, $test_category_id, $due_date);
$test_task->save();
$description2 = "Meet with boss";
$test_task2 = new Task($description2, $id, $test_category_id, $due_date);
$test_task2->save();
$result = $test_category->getTasks();
$this->assertEquals([$test_task, $test_task2], $result);
}
示例2: testGetTasks
function testGetTasks()
{
$name = "Home stuff";
$id = 1;
$test_category = new Category($name, $id);
$test_category->save();
$description = "Wash the dog";
$id2 = 2;
$test_task = new Task($description, $id2, "2000-01-01");
$test_task->save();
$description2 = "Take out the trash";
$id3 = 3;
$test_task2 = new Task($description2, $id3, "2000-01-01");
$test_task2->save();
$test_category->addTask($test_task);
$test_category->addTask($test_task2);
$this->assertEquals($test_category->getTasks(), [$test_task, $test_task2]);
}
示例3: testGetTasks
function testGetTasks()
{
//Arrange
$name = "Work stuff";
$id = null;
$test_category = new Category($name, $id);
$test_category->save();
$test_category_id = $test_category->getId();
$description = "Email client";
$test_task = new Task($description, $id, $test_category_id);
$test_task->save();
$description2 = "Meet the boss";
$test_task2 = new Task($description2, $id, $test_category_id);
$test_task2->save();
//Act
$result = $test_category->getTasks();
//Assert
$this->assertEquals([$test_task, $test_task2], $result);
}
示例4: testGetTasks
function testGetTasks()
{
//Arrange
$name = "Work stuff";
$id = null;
$test_category = new Category($name, $id);
$test_category->save();
$test_category_id = $test_category->getId();
$description = "Email Client";
$date_due = "1/3/1390";
$time_due = "6:00pm";
$test_task = new Task($id, $description, $date_due, $time_due, $test_category_id);
$test_task->save();
$description2 = "Meet with the Boss";
$date_due2 = "7/7/5000";
$time_due2 = "2:00am";
$test_task2 = new Task($id, $description2, $date_due2, $time_due2, $test_category_id);
$test_task2->save();
//Act
$result = $test_category->getTasks();
//Assert
$this->assertEquals([$test_task, $test_task2], $result);
}
示例5: testGetTasks
function testGetTasks()
{
//Arrange
$name = "Home stuff";
$id = 1;
$test_category = new Category($name, $id);
$test_category->save();
$description = "Wash the dog";
$id2 = 2;
$completed = 0;
$due_date = null;
$test_task = new Task($description, $id2, $completed, $due_date);
$test_task->save();
$description2 = "Take out the trash";
$id3 = 3;
$completed = 0;
$due_date = null;
$test_task2 = new Task($description2, $id3, $completed, $due_date);
$test_task2->save();
//Act
$test_category->addTask($test_task);
$test_category->addTask($test_task2);
//Assert
$this->assertEquals($test_category->getTasks(), [$test_task, $test_task2]);
}
示例6: testAddTask
function testAddTask()
{
//Arrange
$name = "Work stuff";
$id = 1;
$test_category = new Category($name, $id);
$test_category->save();
$description = "File reports";
$id2 = 2;
$due_date = "2015-10-10";
$test_task = new Task($description, $id2, $due_date);
$test_task->save();
//Act
$test_category->addTask($test_task);
//Assert
$this->assertEquals($test_category->getTasks(), [$test_task]);
}
示例7: testGetTasks
function testGetTasks()
{
//Arrange
$name = "Work stuff";
$id = 1;
$test_category = new Category($name, $id);
$test_category->save();
$description = "Email the client";
$id2 = 2;
$test_task = new Task($description, $id2);
$test_task->save();
$description2 = "Meet with boss";
$id3 = 3;
$test_task2 = new Task($description2, $id3);
$test_task2->save();
//Act
$test_category->addTask($test_task);
$test_category->addTask($test_task2);
//Assert
$this->assertEquals($test_category->getTasks(), [$test_task, $test_task2]);
}
示例8: testGetTasks
function testGetTasks()
{
//Arrange
$category_name = "Home stuff";
$id1 = 1;
$test_category = new Category($category_name, $id1);
$test_category->save();
$task_name = "Wash the dog";
$id2 = 2;
$due_date = null;
$test_task = new Task($task_name, $id2, $due_date);
$test_task->save();
$task_name2 = "Take out the trash";
$id3 = 3;
$test_task2 = new Task($task_name2, $id3, $due_date);
$test_task2->save();
//Act
$test_category->addTask($test_task);
$test_category->addTask($test_task2);
//Assert
$this->assertEquals($test_category->getTasks(), [$test_task, $test_task2]);
}
示例9: testAddTask
function testAddTask()
{
//Arrange
$name = "Work stuff";
$id = 1;
$test_category = new Category($name, $id);
$test_category->save();
$id2 = 2;
$description = "Water the lawn";
$test_task = new Task($id, $description);
$test_task->save();
//Act
$test_category->addTask($test_task);
//Assert
$this->assertEquals($test_category->getTasks(), [$test_task]);
}
示例10: testGetTasks
function testGetTasks()
{
//Arrange
$name = "Home stuff";
// $id = 1;
$test_category = new Category($name);
$test_category->save();
$description = "Wash the dog";
// $id2 = 2;
$due_date = "1800-12-13";
$test_task = new Task($description, $due_date);
$test_task->save();
$description2 = "Take out the trash";
// $id3 = 3;
$due_date2 = "3000-01-10";
$test_task2 = new Task($description2, $due_date2);
$test_task2->save();
//Act
$test_category->addTask($test_task);
$test_category->addTask($test_task2);
//Assert
$this->assertEquals($test_category->getTasks(), [$test_task, $test_task2]);
}
示例11: testGetTasks
function testGetTasks()
{
// Arrange
$name = "Work stuff";
$id = 1;
$test_category = new Category($name, $id);
$test_category->save();
$description = "Reply to emails";
$id2 = 2;
$due_date = "2016-02-28";
$test_task = new Task($description, $id2, $due_date);
$test_task->save();
$description2 = "Go to meeting";
$id3 = 3;
$due_date2 = "2016-03-01";
$test_task2 = new Task($description2, $id3, $due_date2);
$test_task2->save();
// Act
$test_category->addTask($test_task);
$test_category->addTask($test_task2);
// Assert
$this->assertEquals($test_category->getTasks(), [$test_task, $test_task2]);
}