Beispiel #1
0
 function test_find()
 {
     $name = "Sally";
     $phone = "555-555-5555";
     $test_stylist = new Stylist($name, $phone);
     $test_stylist->save();
     $name2 = "Judy";
     $test_stylist2 = new Stylist($name2, $phone);
     $test_stylist2->save();
     $result = Stylist::find($test_stylist->getId());
     $this->assertEquals($test_stylist, $result);
 }
Beispiel #2
0
 function testSave()
 {
     $stylist_name = "Kevin";
     $test_stylist = new Stylist($stylist_name);
     $test_stylist->save();
     $name = "Stuart";
     $phone = "555-555-5555";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($name, $phone, $stylist_id);
     $test_client->save();
     $result = Client::getAll();
     $this->assertEquals($test_client, $result[0]);
 }
Beispiel #3
0
 function test_stylist_delete()
 {
     $style = "Thai";
     $test_stylist = new Stylist($style);
     $test_stylist->save();
     $style2 = "burgers";
     $test_stylist2 = new Stylist($style2);
     $test_stylist2->save();
     $name = "Pok Pok";
     $category_id = $test_stylist->getId();
     $test_client = new Client($name, $category_id);
     $test_client->save();
     $name2 = "Dicks";
     $category_id2 = $test_stylist2->getId();
     $test_client2 = new Client($name2, $category_id2);
     $test_client2->save();
     //Act
     $test_stylist->delete();
     //Assert
     $this->assertEquals([$test_client2], Client::getAll());
 }
Beispiel #4
0
 function test_deleteAll()
 {
     $name = "Megan";
     $id = null;
     $test_stylist = new Stylist($name, $id);
     $test_stylist->save();
     $client_name = "Shawnee";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($id, $client_name, $stylist_id);
     $test_client->save();
     $client_name2 = "Katie";
     $stylist_id = $test_stylist->getId();
     $test_client2 = new Client($id, $client_name, $stylist_id);
     $test_client2->save();
     Client::deleteAll();
     $result = Client::getAll();
     $this->assertEquals([], $result);
 }
Beispiel #5
0
 function testGetClients()
 {
     //Arrange
     $name = "Bob";
     $id = null;
     $test_stylist = new Stylist($name, $id);
     $test_stylist->save();
     $test_stylist_id = $test_stylist->getId();
     $client_name = "Betty";
     $test_client = new Client($client_name, $test_stylist_id, $id);
     $test_client->save();
     $client_name2 = "Gertrude";
     $test_client2 = new Client($client_name2, $test_stylist_id, $id);
     $test_client2->save();
     //Act
     $result = $test_stylist->getClients();
     //Assert
     $this->assertEquals([$test_client, $test_client2], $result);
 }
Beispiel #6
0
 function test_getClients()
 {
     //Arrange
     $name = "Sasha";
     $id = null;
     $test_stylist = new Stylist($name, $id);
     $test_stylist->save();
     $name2 = "Sandra";
     $test_stylist2 = new Stylist($name2, $id);
     $test_stylist2->save();
     $c_name = "Garry Gergich";
     $phone = "503-472-8959";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($c_name, $phone, $id, $stylist_id);
     $test_client->save();
     $c_name2 = "Jerry Gergich";
     $phone2 = "503-864-4444";
     $stylist_id2 = $test_stylist2->getId();
     $test_client2 = new Client($c_name2, $phone2, $id, $stylist_id2);
     $test_client2->save();
     $c_name3 = "Brock Samson";
     $phone3 = "555-555-5555";
     $stylist_id3 = $test_stylist->getId();
     $test_client3 = new Client($c_name3, $phone3, $id, $stylist_id3);
     $test_client3->save();
     //Act
     $result = $test_stylist->getClients();
     //Assert
     $this->assertEquals([$test_client3, $test_client], $result);
 }
 function test_client_delete()
 {
     //Arrange
     $name = "Vidal Sassoon";
     $test_stylist = new Stylist($name);
     $test_stylist->save();
     $name2 = "Sweeney Todd";
     $test_stylist2 = new Stylist($name2);
     $test_stylist2->save();
     $name3 = "Mr. T";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($name3, $stylist_id, null);
     $test_client->save();
     $name4 = "Mrs. T";
     $stylist_id2 = $test_stylist2->getId();
     $test_client2 = new Client($name4, $stylist_id2, null);
     $test_client2->save();
     //Act
     $test_client->delete();
     //Assert
     $this->assertEquals([$test_client2], Client::getAll());
 }
Beispiel #8
0
 function testFind()
 {
     //Arrange
     $stylist_name = "Gandalf the Gray";
     $test_stylist = new Stylist($stylist_name, $id = null);
     $test_stylist->save();
     $client_name = "Samwise";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($client_name, $id = null, $stylist_id);
     $test_client->save();
     $client_name2 = "Arwen";
     $test_client2 = new Client($client_name2, $id = null, $stylist_id);
     $test_client2->save();
     //Act
     $result = Client::find($test_client->getId());
     //Assert
     $this->assertEquals($test_client, $result);
 }
 function test_find()
 {
     //Arrange
     $name = "Stylist1";
     $id = null;
     $test_stylist = new Stylist($name, $id);
     $test_stylist->save();
     $name = "Client1";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($name, $id, $stylist_id);
     $test_client->save();
     $name = "Client2";
     $test_client2 = new Client($name, $id, $stylist_id);
     $test_client2->save();
     //Act
     $result = Client::find($test_client->getId());
     //Assert
     $this->assertEquals($test_client, $result);
 }
Beispiel #10
0
 function test_GetClients()
 {
     //Arrange
     $stylist_name = "Big Bird";
     $test_stylist = new Stylist($stylist_name);
     $test_stylist->save();
     $test_stylist_id = $test_stylist->getId();
     $client_name = "Harry Potter";
     $test_client = new Client($client_name, $test_stylist_id);
     $test_client->save();
     $client_name2 = "Spock";
     $test_client2 = new Client($client_name2, $test_stylist_id);
     $test_client2->save();
     //Act
     $result = $test_stylist->getClients();
     //Assert
     $this->assertEquals([$test_client, $test_client2], $result);
 }
Beispiel #11
0
 function test_getClients()
 {
     //Arrange
     $name = "Erin";
     $id = null;
     $test_stylist = new Stylist($name, $id);
     $test_stylist->save();
     $name = "George";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($name, $stylist_id, $id);
     $test_client->save();
     $name2 = "Judy";
     $test_client2 = new Client($name2, $stylist_id, $id);
     $test_client2->save();
     //Act
     $result = $test_stylist->getClients();
     //Assert
     $this->assertEquals([$test_client, $test_client2], $result);
 }
Beispiel #12
0
 function testDeleteStylistClient()
 {
     //Arrange
     $stylist_name = "Bilbo Baggins";
     $test_stylist = new Stylist($stylist_name, $id = null);
     $test_stylist->save();
     $client_name = "The Necromancer";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($client_name, $id = null, $stylist_id);
     $test_client->save();
     //Act
     $test_stylist->delete();
     //Assert
     $this->assertEquals([], Client::getAll());
 }
Beispiel #13
0
 function test_find()
 {
     //Arrange
     $name = "vicki";
     $test_stylist = new Stylist($name);
     $test_stylist->save();
     //Act
     $result = Stylist::find($test_stylist->getId());
     //Assert
     $this->assertEquals($test_stylist, $result);
 }
 function testDeleteStylistClients()
 {
     //Arrange
     $stylist_name = "Bob";
     $id = null;
     $test_stylist = new Stylist($stylist_name, $id);
     $test_stylist->save();
     $client_name = "Joe";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($client_name, $id, $stylist_id);
     $test_client->save();
     //Act
     $test_stylist->delete();
     //Assert
     $this->assertEquals([], Client::getAll());
 }
Beispiel #15
0
 function test_delete()
 {
     $name = "Sally";
     $phone = "555-555-5555";
     $id = null;
     $test_stylist = new Stylist($name, $phone, $id);
     $test_stylist->save();
     $name = "Maggie";
     $phone = "123-321-1234";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($name, $phone, $id, $stylist_id);
     $test_client->save();
     $name2 = "Steve";
     $phone2 = "999-777-6666";
     $stylist_id2 = $test_stylist->getId();
     $test_client2 = new Client($name2, $phone2, $id, $stylist_id2);
     $test_client2->save();
     $test_client->delete();
     $this->assertEquals([$test_client2], Client::getAll());
 }
Beispiel #16
0
 function testGetClients()
 {
     //Arrange
     $name = "jerry";
     $id = null;
     $test_stylist = new Stylist($name, $id);
     $test_stylist->save();
     $test_stylist_id = $test_stylist->getId();
     $name = "kramer";
     $phone = "123-321-1234";
     $style_choice = "bowl cut";
     $test_client = new Client($name, $phone, $style_choice, $test_stylist_id);
     $test_client->save();
     $name2 = "ben";
     $phone2 = "123-456-1234";
     $style_choice2 = "trim";
     $test_client2 = new Client($name2, $phone2, $style_choice2, $test_stylist_id);
     $test_client2->save();
     //Act
     $result = $test_stylist->getClients();
     //Assert
     $this->assertEquals([$test_client, $test_client2], $result);
 }
 function test_delete()
 {
     //Arrange
     $stylist_name = "bob";
     $id = null;
     $test_stylist = new Stylist($stylist_name, $id);
     $test_stylist->save();
     $client_name = "joe";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($client_name, $id, $stylist_id);
     $test_client->save();
     $client_name2 = "jerry";
     $test_client2 = new Client($client_name2, $id, $stylist_id);
     $test_client2->save();
     //Act
     $test_client->delete();
     //Assert
     $this->assertEquals([$test_client2], Client::getAll());
 }
Beispiel #18
0
 function testDeleteClientTasks()
 {
     //Arrange
     $stylist_name = "Allison";
     $id = null;
     $test_stylist = new Stylist($stylist_name, $id);
     $test_stylist->save();
     $client_name = "Paco";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($client_name, $id, $stylist_id);
     $test_client->save();
     //Act
     $test_stylist->deleteOne();
     //Assert
     $this->assertEquals([], Client::getAll());
 }
 function test_find()
 {
     //Arrange
     $name = "Tessa";
     $id = null;
     $visits = 4;
     $description = "The best!";
     $test_stylist = new Stylist($name, $id);
     $test_stylist->save();
     $name = "jack";
     $name2 = "Bob";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($name, $stylist_id, $id, $visits, $description);
     $test_client->save();
     $test_client2 = new Client($name, $stylist_id, $id, $visits, $description);
     $test_client2->save();
     //Act
     $result = Client::find($test_client->getId());
     //Assert
     $this->assertEquals($test_client, $result);
 }
Beispiel #20
0
 function test_delete()
 {
     $name = "Jane Doe";
     $test_stylist = new Stylist($name);
     $test_stylist->save();
     $client_name = "Jimmy";
     $client_stylist_id = $test_stylist->getId();
     $test_client = new Client($client_name, $client_stylist_id);
     $test_client->save();
     $client_name2 = "Coco";
     $test_client2 = new Client($client_name2, $client_stylist_id);
     $test_client2->save();
     $test_client->delete();
     $result = Client::getAll();
     $this->assertEquals([$test_client2], $result);
 }
Beispiel #21
0
 function test_getClients()
 {
     $stylist_name = "Hank Airpair";
     $id = null;
     $test_stylist = new Stylist($stylist_name, $id);
     $test_stylist->save();
     $client_name = "Wesley Pong";
     $stylist_id = $test_stylist->getId();
     $email = "*****@*****.**";
     $test_client = new Client($client_name, $id, $email, $stylist_id);
     $test_client->save();
     $client_name2 = "Wendy Git";
     $email = "*****@*****.**";
     $test_client2 = new Client($client_name2, $id, $email, $stylist_id);
     $test_client2->save();
     $result = $test_stylist->getClients();
     $this->assertEquals([$test_client, $test_client2], $result);
 }
Beispiel #22
0
 function test_getAllClients()
 {
     //Arrange
     $stylist_name = "Donna";
     $id = null;
     $test_stylist = new Stylist($stylist_name, $id);
     $test_stylist->save();
     $client_name = "Robin";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($client_name, $stylist_id);
     $test_client->save();
     $client_name2 = "Darla";
     $test_client2 = new Client($client_name2, $stylist_id);
     $test_client2->save();
     //Act
     $result = $test_stylist->getAllClients();
     //Assert
     $this->assertEquals([$test_client, $test_client2], $result);
 }
 function test_stylist_getClient()
 {
     //Arrange
     $name = "Vidal Sassoon";
     $test_stylist = new Stylist($name);
     $test_stylist->save();
     $name2 = "Sweeney Todd";
     $test_stylist2 = new Stylist($name2);
     $test_stylist2->save();
     $name3 = "Mr. T";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($name3, $stylist_id, null);
     $test_client->save();
     $name4 = "Mrs. T";
     $stylist_id2 = $test_stylist2->getId();
     $test_client2 = new Client($name4, $stylist_id2, null);
     $test_client2->save();
     //Act
     $result = $test_stylist->getClient();
     //Assert
     $this->assertEquals($test_client, $result[0]);
 }
 function testGetClients()
 {
     //Arrange
     $id = null;
     $name = "Nova";
     $test_stylist = new Stylist($id, $name);
     $test_stylist->save();
     $test_stylist_id = $test_stylist->getId();
     $client_name = "Martha Stewart";
     $phone = "(888) 888-8888";
     $next_visit = "2015-09-06";
     $test_client = new Client($id, $client_name, $phone, $next_visit, $test_stylist_id);
     $test_client->save();
     $name2 = "Jennifer Lopez";
     $phone2 = "(609) 999-9999";
     $next_visit2 = "2015-10-12";
     $test_client2 = new Client($id, $client_name2, $phone2, $next_visit2, $test_stylist_id);
     $test_client2->save();
     //Act
     $result = $test_stylist->getClients();
     //Assert
     $this->assertEquals([$test_client, $test_client2], $result);
 }
Beispiel #25
0
 function testGetClients()
 {
     //Arrange
     $name = "Jackie";
     $id = null;
     $test_stylist = new Stylist($name, $id);
     $test_stylist->save();
     $test_stylist_id = $test_stylist->getId();
     $name = "Sandra Jane";
     $phone = "542-334-0984";
     $style_choice = "The Rachel";
     $test_client = new Client($name, $phone, $style_choice, $test_stylist_id);
     $test_client->save();
     $name2 = "Jordy Duran";
     $phone2 = "239-094-0281";
     $style_choice2 = "Bowl Cut";
     $test_client2 = new Client($name2, $phone2, $style_choice2, $test_stylist_id);
     $test_client2->save();
     //Act
     $result = $test_stylist->getClients();
     //Assert
     $this->assertEquals([$test_client, $test_client2], $result);
 }
 function test_find()
 {
     //arrange
     $stylist_name = "Agnes";
     $test_stylist = new Stylist($stylist_name);
     $test_stylist->save();
     $stylist_name2 = "Cathy";
     $test_stylist2 = new Stylist($stylist_name2);
     $test_stylist2->save();
     //act
     $result = Stylist::find($test_stylist2->getId());
     //assert
     $this->assertEquals($test_stylist2, $result);
 }
 function testFind()
 {
     //Arrange
     $id = null;
     $stylist_name = "Gina";
     $test_stylist = new Stylist($id, $stylist_name);
     $test_stylist->save();
     $stylist_name2 = "Tony";
     $test_stylist2 = new Stylist($id, $stylist_name2);
     $test_stylist2->save();
     //Act
     $result = Stylist::find($test_stylist->getId());
     //Assert
     $this->assertEquals($test_stylist, $result);
 }
Beispiel #28
0
 function test_delete()
 {
     //Arrange
     $name = "Erin";
     $id = null;
     $test_stylist = new Stylist($name, $id);
     $test_stylist->save();
     $name = "George";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($name, $stylist_id, $id);
     $test_client->save();
     $name2 = "Judy";
     $test_client2 = new Client($name2, $stylist_id, $id);
     $test_client2->save();
     //Act
     $test_client2->delete();
     //Assert
     $this->assertEquals([$test_client], Client::getAll());
 }
 function test_find()
 {
     //Arrange
     $name = "Tessa";
     $name2 = "Alex";
     $test_Stylist = new Stylist($name);
     $test_Stylist->save();
     $test_Stylist2 = new Stylist($name2);
     $test_Stylist2->save();
     //Act
     $result = Stylist::find($test_Stylist->getId());
     //Assert
     $this->assertEquals($test_Stylist, $result);
 }
 function test_delete()
 {
     //arrange
     $stylist_name = "Lisa";
     $id = null;
     $test_stylist = new Stylist($stylist_name, $id);
     $test_stylist->save();
     $client_name = "Alfred";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($client_name, $id, $stylist_id);
     $test_client->save();
     $client_name2 = "Ludacris";
     $stylist_id = $test_stylist->getId();
     $test_client2 = new Client($client_name2, $id, $stylist_id);
     $test_client2->save();
     $test_client->delete();
     //assert
     $this->assertEquals([$test_client2], Client::getAll());
 }