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


PHP Task::getCategories方法代码示例

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


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

示例1: testGetCategories

 function testGetCategories()
 {
     $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 = "File reports";
     $id3 = 3;
     $due_date = "2000-01-01";
     $test_task = new Task($description, $id3, $due_date);
     $test_task->save();
     $test_task->addCategory($test_category);
     $test_task->addCategory($test_category2);
     $this->assertEquals($test_task->getCategories(), [$test_category, $test_category2]);
 }
开发者ID:CaseyH33,项目名称:epic_ToDo_mySQL,代码行数:19,代码来源:TaskTest.php

示例2: 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 = "File reports";
     $id3 = 3;
     $due_date = null;
     $completed = 0;
     $test_task = new Task($description, $id3, $completed, $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:jtorrespdx,项目名称:to_do,代码行数:23,代码来源:TaskTest.php

示例3: Category

 function test_getCategories()
 {
     //Arrange
     $name = "Halloween Stuff";
     $id = 1;
     $test_category = new Category($name, $id);
     $test_category->save();
     $name2 = "Carve the pumpkin";
     $id2 = 2;
     $test_category2 = new Category($name2, $id2);
     $test_category2->save();
     $description = "Scare trick or treaters";
     $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:kevintokheim,项目名称:To_Do_Join_Database,代码行数:21,代码来源:TaskTest.php

示例4: 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


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