public function testShowPeople()
 {
     $contact = \App\PeopleContact::where('first_name', 'LIKE', 'PHPUNIT%')->take(1)->first();
     $contact = $this->contactsController->showPeople($contact->id);
     $contactData = $contact->getData()['contact']->toArray();
     $this->assertTrue(isset($contactData['id']));
     $this->assertTrue(isset($contactData['first_name']));
     $this->assertTrue(isset($contactData['last_name']));
     $this->assertTrue(isset($contactData['email_1']));
 }
Exemplo n.º 2
0
 public function storeContactComplete($model, $catModel, $data)
 {
     $contact = $this->createContact($model, $data);
     if (isset($data['category']) && !is_null($data['category'])) {
         $categoryIds = $this->updateCategories($catModel, $data['category']);
         $contact->category()->sync($categoryIds);
     }
     if (isset($data['company']) && $data['company'] !== '0') {
         $contact = PeopleContact::find($contact['id']);
         $contact->companies()->attach($data['company']);
         $contact->save();
     }
     return $contact;
 }