diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2024-11-03 08:39:21 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2024-11-03 08:39:21 +0100 |
commit | a29a1c768dd71464748efd3c620d167504f23aa7 (patch) | |
tree | d149d2147934d40c63c4c2bdf21b4aea27510be5 /tests/unit/Widget | |
parent | 90bc987ea7c7717ad29fe303989d2d1dcd7c92f9 (diff) | |
download | volse-hubzilla-a29a1c768dd71464748efd3c620d167504f23aa7.tar.gz volse-hubzilla-a29a1c768dd71464748efd3c620d167504f23aa7.tar.bz2 volse-hubzilla-a29a1c768dd71464748efd3c620d167504f23aa7.zip |
tests: Declare private property $output.
Uncovered by PHP 8.2 because dynamic properties are deprecated.
Diffstat (limited to 'tests/unit/Widget')
-rw-r--r-- | tests/unit/Widget/HelpindexTest.php | 10 |
1 files changed, 10 insertions, 0 deletions
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'); |