コード例 #1
0
 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
0
 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
0
ファイル: CategoryTest.php プロジェクト: jtorrespdx/ToDo
 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
0
ファイル: CategoryTest.php プロジェクト: jlbethel/To-Do
 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
0
ファイル: CategoryTest.php プロジェクト: jtorrespdx/to_do
 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
0
 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
0
 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
0
 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
0
 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
0
 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
0
 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]);
 }