Tests failing - Class not found

Issue #3 resolved
Archibald Thurston created an issue

Heya, sorry to bug you again. This is happening on Elementary OS (so, Ubuntu 14.04 really) with PHPUnit 5.5.4 & PHP 7.0.14-1+deb.sury.org~trusty+1

Tests: 227, Assertions: 1230, Errors: 8, Failures: 2.

1) SynergyWholesale\Commands\DisableIDProtectionCommandTest::testCommand
Error: Class 'SynergyWholesale\Commands\DisableIDProtectionCommand' not found

Similar errors for EnableIDProtectionCommand, GetUSNexusDataCommand, InitiateAUCORCommand, DisableIDProtectionResponse, EnableIDProtectionResponse, GetUSNexusDataResponse, InitiateAUCORResponse

Also I see the following, though I think it's related.

There were 2 failures:

1) SynergyWholesale\Responses\InitiateAUCORResponseTest::testMissingCostPrice
Failed asserting that exception of type "Error" matches expected exception "SynergyWholesale\Exception\BadDataException". Message was: "Class 'SynergyWholesale\Responses\InitiateAUCORResponse' not found" at
/home/jarrod/workspace/synergy-wholesale/tests/Responses/InitiateAuCorResponseTest.php:14
.

2) SynergyWholesale\Responses\InitiateAUCORResponseTest::testBadCostPrice
Failed asserting that exception of type "Error" matches expected exception "SynergyWholesale\Exception\BadDataException". Message was: "Class 'SynergyWholesale\Responses\InitiateAUCORResponse' not found" at
/home/jarrod/workspace/synergy-wholesale/tests/Responses/InitiateAuCorResponseTest.php:25

The trend here seems to be casing in the class name is different to that of its containing PHP file - ie, SynergyWholesale\Commands\DisableIDProtectionCommandTest is in src/Commands/DisableIdProtectionCommand.php (ID vs Id)

I'm not a PHP guru by any means, and I've honestly never used PHPUnit, but I was hoping to add support for the various "Registry Hosts" functions of the Synergy API, ideally adding tests to make everything legitimate and try and remember how to create a pull request but wanted to get this sorted first. No idea how to proceed without renaming the files and potentially breaking things with that, or somehow getting PHPUnit to autoload them case-insensitively

Comments (3)

  1. Simon Hampel repo owner
    • changed status to open

    ahh - good old case insensitive Windows and case sensitive Linux

    Those classes were all renamed (case change) to be consistent with the API in a much earlier version, but while my system shows them as renamed, my git client never picked it up because of the whole case insensitive thing.

    Works for me locally (and all my unit tests pass) because my client really has renamed the files (unit tests are running on a local Linux VM pushed directly from my IDE), but the version in source control is incorrect

    Will fix.

  2. Log in to comment