/** 
  * @param Batchblue_Service_BatchBook_Deal $deal
  * @return Batchblue_Service_BatchBook_Deal
  */
 public function testAddPersonToToDo()
 {
     $person = new Batchblue_Service_BatchBook_Person();
     $person->setFirstName('TestFirstNameWithToDo')->setLastName('TestLastNameWithToDo')->setNotes('Downloaded my product and linking todo');
     $todo = new Batchblue_Service_BatchBook_ToDo();
     $todo->setTitle('Test ToDo Title with person')->setDescription('Test ToDo Description with contact attached')->setFlagged(false)->setDueDate(new DateTime('2013-12-13'));
     $this->_toDoService->postToDo($todo);
     $this->_personService->postPerson($person);
     $this->_toDoService->addPersonToToDo($todo, $person);
     $getTodo = $this->_toDoService->getToDo($todo->getId());
     $this->assertEquals($todo, $getTodo);
     return $todo;
 }
 /** 
  * @param Batchblue_Service_BatchBook_Deal $deal
  * @return Batchblue_Service_BatchBook_Deal
  */
 public function testAddPersonToDeal()
 {
     $person = new Batchblue_Service_BatchBook_Person();
     $person->setFirstName('TestFirstNameWithDeal')->setLastName('TestLastNameWithDeal')->setNotes('Downloaded my product');
     $deal = new Batchblue_Service_BatchBook_Deal();
     $deal->setTitle('Test Deal Title With Person')->setDescription('Test Deal Description With Person')->setStatus('pending');
     $this->_dealService->postDeal($deal);
     $this->_personService->postPerson($person);
     $this->_dealService->addPersonToDeal($deal, $person);
     $getDeal = $this->_dealService->getDeal($deal->getId());
     $this->assertEquals($deal, $getDeal);
     return $deal;
 }
 /**
  * @depends testGetPerson
  * @param Batchblue_Service_BatchBook_Person $person
  * @return Batchblue_Service_BatchBook_Person
  */
 public function testPutPerson(Batchblue_Service_BatchBook_Person $person)
 {
     $location = new Batchblue_Service_BatchBook_Location();
     $location->setEmail(md5(uniqid(rand(), true)) . '*****@*****.**')->setPhone('123-123-9999');
     $locations = array($location);
     $person->setFirstName('TestFirstName')->setLastName('TestLastName')->setTitle('Developer')->setCompany('Test Company')->setNotes('Test notes go here')->setLocations($locations);
     $this->_personService->putPerson($person);
     $getPerson = $this->_personService->getPerson($person->getId());
     //the id is in there when it comes back, so to make the test pass, put it in!
     $getLocations = $getPerson->getLocations();
     $location->setId($getLocations[0]->getId());
     $this->assertEquals($person, $getPerson);
     return $person;
 }