当前位置: 首页>>代码示例>>PHP>>正文


PHP Category::getTasks方法代码示例

本文整理汇总了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);
 }
开发者ID:jschold,项目名称:To_Do_With_Databases,代码行数:17,代码来源:CategoryTest.php

示例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]);
 }
开发者ID:CaseyH33,项目名称:epic_ToDo_mySQL,代码行数:18,代码来源:CategoryTest.php

示例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);
 }
开发者ID:jtorrespdx,项目名称:ToDo,代码行数:19,代码来源:CategoryTest.php

示例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);
 }
开发者ID:jlbethel,项目名称:To-Do,代码行数:23,代码来源:CategoryTest.php

示例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]);
 }
开发者ID:jtorrespdx,项目名称:to_do,代码行数:25,代码来源:CategoryTest.php

示例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]);
 }
开发者ID:jeffaustin81,项目名称:ToDo_many2many,代码行数:17,代码来源:CategoryTest.php

示例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]);
 }
开发者ID:julianstewart,项目名称:ToDoList,代码行数:21,代码来源:CategoryTest.php

示例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]);
 }
开发者ID:kennygrage,项目名称:epic_to_do_list_mySQL,代码行数:22,代码来源:CategoryTest.php

示例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]);
 }
开发者ID:jlbethel,项目名称:To-Do-Databases,代码行数:16,代码来源:CategoryTest.php

示例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]);
 }
开发者ID:kevintokheim,项目名称:To_Do_Join_Database,代码行数:23,代码来源:CategoryTest.php

示例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]);
 }
开发者ID:jaredbeckler,项目名称:to-do-list,代码行数:23,代码来源:CategoryTest.php


注:本文中的Category::getTasks方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。