/** * test useNotes */ public function testUseNotes() { $contact = $this->objects['initialContact']; $contact1 = clone $contact; $contact1->notes = array(new Tinebase_Record_RecordSet('Tinebase_Model_Note', array($this->objects['note']))); $contact->notes = array(new Tinebase_Record_RecordSet('Tinebase_Model_Note', array($this->objects['note']))); $newcontact1 = $this->_instance->create($contact1); $this->_instance->delete($newcontact1); $this->_instance->useNotes(false); $this->objects['contact'] = $this->_instance->create($contact); $compStr = 'Array ( [0] => Array ( [note_type_id] => 1 [note] => phpunit test note [record_backend] => Sql [id] => ) )'; $this->assertTrue($newcontact1->has('notes')); $this->assertEquals($compStr, $newcontact1->notes[0]->note); $this->setExpectedException('Tinebase_Exception_NotFound'); $this->objects['contact']->notes[0]->note = 'note'; }
/** * try to delete a contact * */ public function testDeleteUserAccountContact() { $this->setExpectedException('Addressbook_Exception_AccessDenied'); $userContact = $this->_instance->getContactByUserId(Tinebase_Core::getUser()->getId()); $this->_instance->delete($userContact->getId()); }
protected function _removeFixtures() { if ($this->_customerRecords) { Sales_Controller_Customer::getInstance()->delete($this->_customerRecords->getId()); } if ($this->_contactRecords) { $this->_contactController->delete($this->_contactRecords->getId()); } if ($this->_addressRecords) { $this->_addressController->delete($this->_addressRecords->getId()); } if ($this->_contractRecords) { Sales_Controller_Contract::getInstance()->delete($this->_contractRecords->getId()); } $paController = Sales_Controller_ProductAggregate::getInstance(); $paController->deleteByFilter(new Sales_Model_ProductAggregateFilter(array())); $this->_invoiceController = Sales_Controller_Invoice::getInstance(); $this->_invoiceController->deleteByFilter(new Sales_Model_InvoiceFilter(array())); }