Skip to content
This repository has been archived by the owner on Apr 30, 2023. It is now read-only.

[Bug]: PHP Unit test Cases are not updated #87

Open
1 task done
pratikvs opened this issue Oct 14, 2021 · 0 comments · May be fixed by #106
Open
1 task done

[Bug]: PHP Unit test Cases are not updated #87

pratikvs opened this issue Oct 14, 2021 · 0 comments · May be fixed by #106
Labels
bug Something isn't working

Comments

@pratikvs
Copy link

Contact Details

[email protected]

What happened?

I tried to run PHP unit test for the module it gives the compatibility issue with php unit testing. Please note the verion used in the composer for php unit test is below.
"phpunit/phpunit": "^9"
The Error is as follows :
`PHP Fatal error: Declaration of Facebook\BusinessExtension\Test\Unit\Block\Pixel\HeadTest::setUp() must be compatible with PHPUnit\Framework\TestCase::setUp(): void in /var/www/html/m242/vendor/facebook/facebook-for-magento2/Test/Unit/Block/Pixel/HeadTest.php on line 41

Fatal error: Declaration of Facebook\BusinessExtension\Test\Unit\Block\Pixel\HeadTest::setUp() must be compatible with PHPUnit\Framework\TestCase::setUp(): void in /var/www/html/m242/vendor/facebook/facebook-for-magento2/Test/Unit/Block/Pixel/HeadTest.php on line 41`

The issue exists because of not using : void after every setup() in every file in the Test files.

Magento Version

2.4.3 Enterprise Edition

Plugin Version

1.4.3

Relevant log output

`PHP Fatal error: Declaration of Facebook\BusinessExtension\Test\Unit\Block\Pixel\HeadTest::setUp() must be compatible with PHPUnit\Framework\TestCase::setUp(): void in /var/www/html/m242/vendor/facebook/facebook-for-magento2/Test/Unit/Block/Pixel/HeadTest.php on line 41

Fatal error: Declaration of Facebook\BusinessExtension\Test\Unit\Block\Pixel\HeadTest::setUp() must be compatible with PHPUnit\Framework\TestCase::setUp(): void in /var/www/html/m242/vendor/facebook/facebook-for-magento2/Test/Unit/Block/Pixel/HeadTest.php on line 41`

Code of Conduct

  • I agree to follow this project's Code of Conduct
@pratikvs pratikvs added the bug Something isn't working label Oct 14, 2021
julionc added a commit to julionc/facebook-for-magento2 that referenced this issue Feb 26, 2022
julionc added a commit to julionc/facebook-for-magento2 that referenced this issue Feb 26, 2022
- Replace createPartialMock function (deprecated) to getMockBuilder

Fixes facebookarchive#87
@julionc julionc linked a pull request Feb 26, 2022 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant