From 2532a67d84b8b401f4ff6da5c515a928a5931692 Mon Sep 17 00:00:00 2001
From: Paul Mehrer
Date: Mon, 5 Aug 2024 11:08:03 +0200
Subject: [PATCH] tweak(tests) fixed some tests for php82
---
tests/tine20/Admin/Frontend/TestCase.php | 2 ++
tests/tine20/Crm/ControllerTest.php | 6 +++---
tests/tine20/Sales/PurchaseInvoiceTest.php | 2 ++
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/tests/tine20/Admin/Frontend/TestCase.php b/tests/tine20/Admin/Frontend/TestCase.php
index 29a179c896b..07be83ede9c 100644
--- a/tests/tine20/Admin/Frontend/TestCase.php
+++ b/tests/tine20/Admin/Frontend/TestCase.php
@@ -20,6 +20,8 @@ abstract class Admin_Frontend_TestCase extends TestCase
*/
protected $_json;
+ protected $objects = [];
+
/**
* Sets up the fixture.
* This method is called before a test is executed.
diff --git a/tests/tine20/Crm/ControllerTest.php b/tests/tine20/Crm/ControllerTest.php
index 77834a939ee..8490e46a378 100644
--- a/tests/tine20/Crm/ControllerTest.php
+++ b/tests/tine20/Crm/ControllerTest.php
@@ -168,7 +168,7 @@ protected function setUp(): void
'summary' => 'phpunit: crm test task',
));
- $this->objects['note'] = new Tinebase_Model_Note(array(
+ $this->_objects['note'] = new Tinebase_Model_Note(array(
'note_type_id' => Tinebase_Model_Note::SYSTEM_NOTE_NAME_NOTE,
'note' => 'phpunit test note',
));
@@ -193,7 +193,7 @@ public function testAddLead()
$translate = Tinebase_Translation::getTranslation('Tinebase');
$lead = $this->_objects['initialLead'];
- $lead->notes = new Tinebase_Record_RecordSet('Tinebase_Model_Note', array($this->objects['note']));
+ $lead->notes = new Tinebase_Record_RecordSet('Tinebase_Model_Note', array($this->_objects['note']));
$lead = Crm_Controller_Lead::getInstance()->create($lead);
// TODO remove this nonsense
$GLOBALS['Addressbook_ControllerTest']['leadId'] = $lead->getId();
@@ -209,7 +209,7 @@ public function testAddLead()
$translatedMessage = $translate->_('created') . ' ' . $translate->_('by') . ' ';
$this->assertEquals($translatedMessage.Zend_Registry::get('currentAccount')->accountDisplayName, $note->note);
} else {
- $this->assertEquals($this->objects['note']->note, $note->note);
+ $this->assertEquals($this->_objects['note']->note, $note->note);
}
}
}
diff --git a/tests/tine20/Sales/PurchaseInvoiceTest.php b/tests/tine20/Sales/PurchaseInvoiceTest.php
index 7c6858f4c85..921057067b4 100644
--- a/tests/tine20/Sales/PurchaseInvoiceTest.php
+++ b/tests/tine20/Sales/PurchaseInvoiceTest.php
@@ -20,6 +20,8 @@ class Sales_PurchaseInvoiceTest extends TestCase
protected $_json;
protected $_recordsToDelete = array();
+
+ protected $_contactController = null;
/**
* get paging