/** * try to add a system note * */ public function testAddSystemNote() { $translate = Tinebase_Translation::getTranslation('Tinebase'); $translatedNoteString = $translate->_('created') . ' ' . $translate->_('by'); $this->_instance->addSystemNote($this->_objects['contact'], Zend_Registry::get('currentAccount')->getId(), Tinebase_Model_Note::SYSTEM_NOTE_NAME_CREATED); $filter = new Tinebase_Model_NoteFilter(array(array('field' => 'query', 'operator' => 'contains', 'value' => $translatedNoteString))); $notes = $this->_instance->searchNotes($filter, new Tinebase_Model_Pagination()); $this->assertGreaterThan(0, count($notes)); $found = FALSE; foreach ($notes as $note) { if ($translatedNoteString . ' ' . Zend_Registry::get('currentAccount')->accountDisplayName == $note->note) { $found = TRUE; break; } } $this->assertTrue($found); }