Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests won't run on pinned phpunit version #17

Closed
reedy opened this issue Jul 11, 2024 · 0 comments
Closed

Tests won't run on pinned phpunit version #17

reedy opened this issue Jul 11, 2024 · 0 comments
Assignees

Comments

@reedy
Copy link
Contributor

reedy commented Jul 11, 2024

dc476ec replaced assertObjectHasAttribute with assertObjectHasProperty, but this doesn't exist in the versions of phpunit allowed.

This results in:

$ php vendor/bin/phpunit
PHPUnit 8.5.39 by Sebastian Bergmann and contributors.

EEEEEE.EEEEE.EEEEEE.EEEEEEE.EEEEEEEE                              36 / 36 (100%)

Time: 32.09 seconds, Memory: 6.00 MB

There were 32 errors:

1) TwoCaptcha\Tests\AmazonWafTest::testAllOptions
Error: Call to undefined method TwoCaptcha\Tests\AmazonWafTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/AmazonWafTest.php:33

2) TwoCaptcha\Tests\AudioTest::test
Error: Call to undefined method TwoCaptcha\Tests\AudioTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/AudioTest.php:27

3) TwoCaptcha\Tests\AudioTest::testAllParameters
Error: Call to undefined method TwoCaptcha\Tests\AudioTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/AudioTest.php:53

4) TwoCaptcha\Tests\CanvasTest::testSingleFileParameter
Error: Call to undefined method TwoCaptcha\Tests\CanvasTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/CanvasTest.php:23

5) TwoCaptcha\Tests\CanvasTest::testBase64
Error: Call to undefined method TwoCaptcha\Tests\CanvasTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/CanvasTest.php:32

6) TwoCaptcha\Tests\CanvasTest::testAllParameters
Error: Call to undefined method TwoCaptcha\Tests\CanvasTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/CanvasTest.php:68

7) TwoCaptcha\Tests\CapyTest::testAllOptions
Error: Call to undefined method TwoCaptcha\Tests\CapyTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/CapyTest.php:23

8) TwoCaptcha\Tests\CoordinatesTest::testSingleFile
Error: Call to undefined method TwoCaptcha\Tests\CoordinatesTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/CoordinatesTest.php:13

9) TwoCaptcha\Tests\CoordinatesTest::testSingleFileParameter
Error: Call to undefined method TwoCaptcha\Tests\CoordinatesTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/CoordinatesTest.php:22

10) TwoCaptcha\Tests\CoordinatesTest::testBase64
Error: Call to undefined method TwoCaptcha\Tests\CoordinatesTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/CoordinatesTest.php:31

11) TwoCaptcha\Tests\CoordinatesTest::testAllParameters
Error: Call to undefined method TwoCaptcha\Tests\CoordinatesTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/CoordinatesTest.php:62

12) TwoCaptcha\Tests\FunCaptchaTest::testAllOptions
Error: Call to undefined method TwoCaptcha\Tests\FunCaptchaTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/FunCaptchaTest.php:39

13) TwoCaptcha\Tests\GeeTest::testAllOptions
Error: Call to undefined method TwoCaptcha\Tests\GeeTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/GeeTest.php:33

14) TwoCaptcha\Tests\GridTest::testSingleFile
Error: Call to undefined method TwoCaptcha\Tests\GridTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/GridTest.php:13

15) TwoCaptcha\Tests\GridTest::testSingleFileParameter
Error: Call to undefined method TwoCaptcha\Tests\GridTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/GridTest.php:22

16) TwoCaptcha\Tests\GridTest::testBase64
Error: Call to undefined method TwoCaptcha\Tests\GridTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/GridTest.php:31

17) TwoCaptcha\Tests\GridTest::testAllParameters
Error: Call to undefined method TwoCaptcha\Tests\GridTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/GridTest.php:69

18) TwoCaptcha\Tests\HCaptchaTest::testAllOptions
Error: Call to undefined method TwoCaptcha\Tests\HCaptchaTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/HCaptchaTest.php:29

19) TwoCaptcha\Tests\KeyCaptchaTest::testAllOptions
Error: Call to undefined method TwoCaptcha\Tests\KeyCaptchaTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/KeyCaptchaTest.php:35

20) TwoCaptcha\Tests\LeminTest::testAllOptions
Error: Call to undefined method TwoCaptcha\Tests\LeminTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/LeminTest.php:31

21) TwoCaptcha\Tests\NormalTest::testSingleFile
Error: Call to undefined method TwoCaptcha\Tests\NormalTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/NormalTest.php:13

22) TwoCaptcha\Tests\NormalTest::testSingleFileParameter
Error: Call to undefined method TwoCaptcha\Tests\NormalTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/NormalTest.php:22

23) TwoCaptcha\Tests\NormalTest::testBase64
Error: Call to undefined method TwoCaptcha\Tests\NormalTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/NormalTest.php:31

24) TwoCaptcha\Tests\NormalTest::testAllParameters
Error: Call to undefined method TwoCaptcha\Tests\NormalTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/NormalTest.php:73

25) TwoCaptcha\Tests\ReCaptchaTest::testV2
Error: Call to undefined method TwoCaptcha\Tests\ReCaptchaTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/ReCaptchaTest.php:33

26) TwoCaptcha\Tests\ReCaptchaTest::testV3
Error: Call to undefined method TwoCaptcha\Tests\ReCaptchaTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/ReCaptchaTest.php:60

27) TwoCaptcha\Tests\RotateTest::testAllParameters
Error: Call to undefined method TwoCaptcha\Tests\RotateTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/RotateTest.php:34

28) TwoCaptcha\Tests\TextTest::testSimpleText
Error: Call to undefined method TwoCaptcha\Tests\TextTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/TextTest.php:11

29) TwoCaptcha\Tests\TextTest::testTextParameter
Error: Call to undefined method TwoCaptcha\Tests\TextTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/TextTest.php:20

30) TwoCaptcha\Tests\TextTest::testAllParameters
Error: Call to undefined method TwoCaptcha\Tests\TextTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/TextTest.php:29

31) TwoCaptcha\Tests\TurnstileTest::testAllOptions
Error: Call to undefined method TwoCaptcha\Tests\TurnstileTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/TurnstileTest.php:29

32) TwoCaptcha\Tests\YandexTest::testAllOptions
Error: Call to undefined method TwoCaptcha\Tests\YandexTest::assertObjectHasProperty()

/home/reedy/2captcha-php/tests/AbstractWrapperTestCase.php:56
/home/reedy/2captcha-php/tests/YandexTest.php:29

ERRORS!
Tests: 36, Assertions: 36, Errors: 32.

As per sebastianbergmann/phpunit#5478 and the linked fixing commit sebastianbergmann/phpunit@adc23ac...

And the title of the issue itself

Add assertObjectHasProperty() and assertObjectNotHasProperty() to PHPUnit 9.6

It is in (as of writing):

11.2.7 11.2.6 11.2.5 11.2.4 11.2.3 11.2.2 11.2.1 11.2.0 11.1.3 11.1.2 11.1.1 11.1.0 11.0.10 11.0.9 11.0.8 11.0.7 11.0.6 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.5.27 10.5.26 10.5.25 10.5.24 10.5.23 10.5.22 10.5.21 10.5.20 10.5.19 10.5.18 10.5.17 10.5.16 10.5.15 10.5.14 10.5.13 10.5.12 10.5.11 10.5.10 10.5.9 10.5.8 10.5.7 10.5.6 10.5.5 10.5.4 10.5.3 10.5.2 10.5.1 10.5.0 10.4.2 10.4.1 10.4.0 10.3.5 10.3.4 10.3.3 9.6.20 9.6.19 9.6.18 9.6.17 9.6.16 9.6.15 9.6.14 9.6.13 9.6.12 9.6.11

None of which can be used as per the constraint in composer.json.

    "require-dev": {
        "phpunit/phpunit": "8.5.*"
    },

Reverting dc476ec does fix the issue, and allows the tests to be run.. But I suspect the constraint for PHPUnit really wants increasing...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants