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

Failed unit_tests.php #59

Closed
rafael-anschau opened this issue May 24, 2019 · 3 comments
Closed

Failed unit_tests.php #59

rafael-anschau opened this issue May 24, 2019 · 3 comments

Comments

@rafael-anschau
Copy link

rafael-anschau commented May 24, 2019

Just installed simpleTest 1.1.7 on the XAMPP htdocs directory on Windows 7(unziping to it) and got this message after running unit_tests.php. Is there a need to configure any dependency ?

unit_tests.php
Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\mock_objects.php line 512]

Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\mock_objects.php line 512]

Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\mock_objects.php line 774]

Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\mock_objects.php line 774]

Fatal error: Uncaught ArgumentCountError: Too few arguments to function MockDummyInterface::anotherMethod(), 0 passed in
C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\test\interfaces_test.php on line 33 and exactly 1 expected in C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\mock_objects.php(1403) : eval()'d code:10 Stack trace: #0

C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\test\interfaces_test.php(33): MockDummyInterface->anotherMethod() #1

C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\invoker.php(72): TestOfMockInterfaces->testMockedInterfaceExpectsParameters() #2 C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\invoker.php(136): SimpleInvoker->invoke('testMockedInter...') #3

C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\exceptions.php(44): SimpleInvokerDecorator->invoke('testMockedInter...') #4

C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\invoker.php(136): SimpleExceptionTrappingInvoker->invoke('testMockedInter...') #5

C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7 in C:\ArquivosDeProgramas\xampp\htdocs\simpleTest_1_1_7\mock_objects.php(1403) : eval()'d code on line 10

When install through Composer, I get this:

unit_tests.php
Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\mock_objects.php line 512]
Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\mock_objects.php line 512]
Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\mock_objects.php line 774]
Exception: Unit tests -> C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\test/mock_objects_test.php -> TestOfMockExpectations -> testNonArrayForExpectedParametersGivesError -> Unexpected PHP Error [count(): Parameter must be an array or an object that implements Countable] severity [2] in [C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\mock_objects.php line 774]

Fatal error: Uncaught ArgumentCountError: Too few arguments to function MockDummyInterface::anotherMethod(), 0 passed in C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\test\interfaces_test.php on line 33 and exactly 1 expected in C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\mock_objects.php(1403) : eval()'d code:10 Stack trace: #0 C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\test\interfaces_test.php(33): MockDummyInterface->anotherMethod() #1 C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\invoker.php(72): TestOfMockInterfaces->testMockedInterfaceExpectsParameters() #2 C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\invoker.php(136): SimpleInvoker->invoke('testMockedInter...') #3 C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\exceptions.php(44): SimpleInvokerDecorator->invoke('testMockedInter...') #4 C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpl in C:\ArquivosDeProgramas\xampp\htdocs\projIni\vendor\simpletest\simpletest\mock_objects.php(1403) : eval()'d code on line 10

@asmundstavdahl
Copy link
Contributor

The test for SimpleTest have not passed for a long time (https://travis-ci.org/simpletest/simpletest/builds).

I'm currently looking at rectifying this and so far it seems that most of the failing tests actually fail because of bad test code and not errors in SimpleTest itself.

@asmundstavdahl
Copy link
Contributor

You may download the following branch for a v1.1.7 with passing self-tests:
https://github.com/asmundstavdahl/simpletest/tree/2019-09-12_v1.1.7-fix-tests

Do note that PHP versions of 7.0 and below, including 5.x, has reached End of life.

@jakoch
Copy link
Member

jakoch commented Jul 27, 2023

Not sure if the original issue is fixed,
but this is an old issue and the mock tests of the main branch pass,
so i'm closing this as can not reproduce + possibly fixed.

@jakoch jakoch closed this as completed Jul 27, 2023
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

3 participants