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


PHP Task::addCategory方法代码示例

本文整理汇总了PHP中Task::addCategory方法的典型用法代码示例。如果您正苦于以下问题:PHP Task::addCategory方法的具体用法?PHP Task::addCategory怎么用?PHP Task::addCategory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Task的用法示例。


在下文中一共展示了Task::addCategory方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testUpdateMark

 function testUpdateMark()
 {
     $name = "Work stuff";
     $id = 1;
     $test_category = new Category($name, $id);
     $test_category->save();
     $description = "File reports";
     $mark = FALSE;
     $id2 = 2;
     $test_task = new Task($description, $mark, $id2);
     $test_task->save();
     $new_mark = True;
     $test_task->addCategory($test_category);
     $test_task->updateMark($new_mark);
     $this->assertEquals(TRUE, $test_task->getMark());
 }
开发者ID:bborealis,项目名称:final_to_do,代码行数:16,代码来源:TaskTest.php

示例2: testDelete

 function testDelete()
 {
     //Arrange
     $name = "Work stuff";
     $id = 1;
     $test_category = new Category($name, $id);
     $test_category->save();
     $description = "File reports";
     $id2 = 2;
     $due_date = '2015-01-01';
     $test_task = new Task($description, $id2, $due_date);
     $test_task->save();
     //Act
     $test_task->addCategory($test_category);
     $test_task->delete();
     //Assert
     $this->assertEquals([], $test_category->getTasks());
 }
开发者ID:bdspen,项目名称:todo_with_categories,代码行数:18,代码来源:TaskTest.php

示例3: testGetCategories

 function testGetCategories()
 {
     // Arrange
     $name = "Work stuff";
     $id = 1;
     $test_category = new Category($name, $id);
     $test_category->save();
     $name2 = "Volunteer stuff";
     $id2 = 2;
     $test_category2 = new Category($name2, $id2);
     $test_category2->save();
     $description = "Reply to emails";
     $id3 = 3;
     $due_date = "2016-02-28";
     $test_task = new Task($description, $id3, $due_date);
     $test_task->save();
     // Act
     $test_task->addCategory($test_category);
     $test_task->addCategory($test_category2);
     // Assert
     $this->assertEquals($test_task->getCategories(), [$test_category, $test_category2]);
 }
开发者ID:jaredbeckler,项目名称:to-do-list,代码行数:22,代码来源:TaskTest.php

示例4: testDelete

 function testDelete()
 {
     //Arrange
     $category_name = "Work stuff";
     $id = 1;
     $test_category = new Category($category_name, $id);
     $test_category->save();
     $task_name = "File reports";
     $id2 = 2;
     $due_date = null;
     $test_task = new Task($task_name, $id2, $due_date);
     $test_task->save();
     //Act
     $test_task->addCategory($test_category);
     $test_task->deleteOne();
     //Assert
     $this->assertEquals([], $test_category->getTasks());
 }
开发者ID:kennygrage,项目名称:epic_to_do_list_mySQL,代码行数:18,代码来源:TaskTest.php

示例5: Category

 function test_delete()
 {
     //Arrange
     $name = "Work stuff";
     $test_category = new Category($name);
     $test_category->save();
     $description = "File reports";
     $due_date = "2014-09-08";
     $test_task = new Task($description, $due_date);
     $test_task->save();
     //Act
     $test_task->addCategory($test_category);
     $test_task->delete();
     //Assert
     $this->assertEquals([], $test_category->getTasks());
 }
开发者ID:kevintokheim,项目名称:To_Do_Join_Database,代码行数:16,代码来源:TaskTest.php

示例6: testGetCategories

 function testGetCategories()
 {
     //Arrange
     $name = "Home stuff";
     $id = 1;
     $test_category = new Category($name, $id);
     $test_category->save();
     $name2 = "not home stuff";
     $id2 = 2;
     $test_category2 = new Category($name, $id2);
     $test_category2->save();
     $description = "File reports";
     $id3 = 3;
     $test_task = new Task($description, $id3);
     $test_task->save();
     //Act
     $test_task->addCategory($test_category);
     $test_task->addCategory($test_category2);
     //Assert
     $this->assertEquals($test_task->getCategories(), [$test_category, $test_category2]);
 }
开发者ID:julianstewart,项目名称:ToDoList,代码行数:21,代码来源:TaskTest.php

示例7: testDeleteTask

 function testDeleteTask()
 {
     //Arrange
     $name = "Work stuff";
     $id = 1;
     $test_category = new Category($name, $id);
     $test_category->save();
     $description2 = "Water the lawn";
     $id2 = 2;
     $due_date2 = "3094-09-21";
     $test_task2 = new Task($description2, $id2, $due_date2);
     $test_task2->save();
     //Act
     $test_task2->addCategory($test_category);
     $test_task2->delete();
     //Assert
     $this->assertEquals([], $test_category->getTasks());
 }
开发者ID:alexdbrown,项目名称:to_do_SQL_linked,代码行数:18,代码来源:TaskTest.php


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