예제 #1
0
 /**
  * @covers Moneybird\Contact::save
  */
 public function testSave()
 {
     $contact = new Contact(array('address1' => 'Address line 1', 'address2' => 'Address line 2', 'attention' => 'Attention', 'bankAccount' => 'Bank account', 'chamberOfCommerce' => '1234567', 'city' => 'City name', 'companyName' => 'My Test company', 'contactName' => 'Contact name', 'country' => 'Country name', 'customerId' => self::$customerId, 'email' => '*****@*****.**', 'firstname' => 'John', 'lastname' => 'Doe', 'phone' => '073-1234567', 'sendMethod' => 'email', 'taxNumber' => '12345678B01', 'zipcode' => '1111 AA'));
     $contact->save($this->service);
     $this->assertInstanceOf('Moneybird\\Contact', $contact);
     self::$contactId = $contact->id;
     $this->assertNotNull(self::$contactId);
     $this->assertGreaterThan(0, self::$contactId);
 }
 /**
  * @covers Moneybird\Contact\Note::save
  */
 public function testSaveNote()
 {
     $numNotes = count($this->object->notes);
     $note = new Contact\Note(array('note' => 'Note ' . time()));
     $note->save($this->service, $this->object);
     self::$note = $note;
     $this->assertNotNull($note->id);
     $this->assertNotEquals($note->id, $this->object->id);
     $this->assertNotEquals($numNotes, count($this->object->notes));
 }