Example #1
0
 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]);
 }
Example #2
0
 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]);
 }
Example #3
0
 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]);
 }
 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]);
 }
Example #5
0
 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]);
 }