aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-11-03 10:57:03 +0000
committerMario <mario@mariovavti.com>2024-11-03 10:57:03 +0000
commit5db3f93be9e9777184609a7f7e6988d36dfc5615 (patch)
tree113b13ddb540b0740f7f16badd67d2b59842795b /tests/unit
parente20327d26760adbea6554268119bc671e0199afb (diff)
parent8ab3ad65310abf558b85253c92b015879f31e594 (diff)
downloadvolse-hubzilla-5db3f93be9e9777184609a7f7e6988d36dfc5615.tar.gz
volse-hubzilla-5db3f93be9e9777184609a7f7e6988d36dfc5615.tar.bz2
volse-hubzilla-5db3f93be9e9777184609a7f7e6988d36dfc5615.zip
Merge branch 'php8.2-deprecations' into 'dev'
Fix deprecations uncovered by running tests on PHP 8.2 See merge request hubzilla/core!2156
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/UnitTestCase.php2
-rw-r--r--tests/unit/Widget/HelpindexTest.php10
2 files changed, 11 insertions, 1 deletions
diff --git a/tests/unit/UnitTestCase.php b/tests/unit/UnitTestCase.php
index afc309205..79f0ec440 100644
--- a/tests/unit/UnitTestCase.php
+++ b/tests/unit/UnitTestCase.php
@@ -47,7 +47,7 @@ require_once 'include/dba/dba_transaction.php';
*/
class UnitTestCase extends TestCase {
protected array $fixtures = array();
- protected ?\DbaTransaction $db_transacton = null;
+ protected ?\DbaTransaction $db_transaction = null;
/**
* Connect to the test db, load fixtures and global config.
diff --git a/tests/unit/Widget/HelpindexTest.php b/tests/unit/Widget/HelpindexTest.php
index 26aa34104..87042c559 100644
--- a/tests/unit/Widget/HelpindexTest.php
+++ b/tests/unit/Widget/HelpindexTest.php
@@ -8,6 +8,8 @@
* SPDX-License-Identifier: MIT
*/
+use PHPUnit\Framework\Attributes\Before;
+
/**
* Test class for testing the Helpindex widget.
*/
@@ -15,6 +17,8 @@ class HelpindexTest extends \Zotlabs\Tests\Unit\Module\TestCase {
use \phpmock\phpunit\PHPMock;
+ private string $output;
+
/**
* Define the stubs to make sure they work later in the test.
*
@@ -27,6 +31,12 @@ class HelpindexTest extends \Zotlabs\Tests\Unit\Module\TestCase {
self::defineFunctionMock('Zotlabs\Widget', 'file_get_contents');
}
+ #[Before]
+ public function setup_state(): void {
+ // Make sure the output is cleared before running the test
+ $this->output = '';
+ }
+
public function test_loading_toc(): void {
// Stub `file_get_contents` to plant our own content.
$fgc_stub = $this->getFunctionMock('Zotlabs\Widget', 'file_get_contents');