Fatal error when running the PHPSkills UnitTests with phpunit
Closed this issue · 3 comments
Hi there,
Thanks for providing a PHP-based port of the TrueSkill algorithm! I've tried running the UnitTests for this project but unfortunately, I get the following error:
PHP Fatal error: Class 'Moserware\Skills\TrueSkill\Layers\InvalidOperationExcep
tion' not found in C:\wamp\www\test_project\trunk\TrueSkill\Skills\TrueSkill\L
ayers\IteratedTeamDifferencesInnerLayer.php on line 55
PHP Stack trace:
PHP 1. {main}() C:\wamp\bin\php\php5.4.12\phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.4.12\phpunit:49
PHP 3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.4.12\pear\PHPUnit\Te
xtUI\Command.php:129
PHP 4. PHPUnit_Runner_BaseTestRunner->getTest() C:\wamp\bin\php\php5.4.12\pear
\PHPUnit\TextUI\Command.php:150
PHP 5. PHPUnit_Framework_TestSuite->addTestFiles() C:\wamp\bin\php\php5.4.12\p
ear\PHPUnit\Runner\BaseTestRunner.php:96
PHP 6. PHPUnit_Framework_TestSuite->addTestFile() C:\wamp\bin\php\php5.4.12\pe
ar\PHPUnit\Framework\TestSuite.php:430
PHP 7. PHPUnit_Util_Fileloader::checkAndLoad() C:\wamp\bin\php\php5.4.12\pear
PHPUnit\Framework\TestSuite.php:369
PHP 8. PHPUnit_Util_Fileloader::load() C:\wamp\bin\php\php5.4.12\pear\PHPUnit
Util\Fileloader.php:86
PHP 9. include_once() C:\wamp\bin\php\php5.4.12\pear\PHPUnit\Util\Fileloader.p
hp:102
PHP 10. PHPUnit_TextUI_TestRunner::run() C:\wamp\www\test_project\trunk\TrueS
kill\UnitTests\TrueSkill\FactorGraphTeamTrueSkillCalculatorTest.php:26
PHP 11. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.4.12\pear\PHPUn
it\TextUI\TestRunner.php:106
PHP 12. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.4.12\pear\PHPUn
it\TextUI\TestRunner.php:305
PHP 13. PHPUnit_Framework_TestSuite->runTest() C:\wamp\bin\php\php5.4.12\pear\P
HPUnit\Framework\TestSuite.php:733
PHP 14. PHPUnit_Framework_TestCase->run() C:\wamp\bin\php\php5.4.12\pear\PHPUni
t\Framework\TestSuite.php:757
PHP 15. PHPUnit_Framework_TestResult->run() C:\wamp\bin\php\php5.4.12\pear\PHPU
nit\Framework\TestCase.php:576
PHP 16. PHPUnit_Framework_TestCase->runBare() C:\wamp\bin\php\php5.4.12\pear\PH
PUnit\Framework\TestResult.php:666
PHP 17. PHPUnit_Framework_TestCase->runTest() C:\wamp\bin\php\php5.4.12\pear\PH
PUnit\Framework\TestCase.php:628
PHP 18. ReflectionMethod->invokeArgs() C:\wamp\bin\php\php5.4.12\pear\PHPUnit\F
ramework\TestCase.php:738
PHP 19. FactorGraphTrueSkillCalculatorTest->testFactorGraphTrueSkillCalculator(
) C:\wamp\bin\php\php5.4.12\pear\PHPUnit\Framework\TestCase.php:738
PHP 20. TrueSkillCalculatorTests::testAllTwoPlayerScenarios() C:\wamp\www\test_project\trunk\TrueSkill\UnitTests\TrueSkill\FactorGraphTeamTrueSkillCalculator
Test.php:16
PHP 21. TrueSkillCalculatorTests::twoPlayerTestNotDrawn() C:\wamp\www\test_project\trunk\TrueSkill\UnitTests\TrueSkill\TrueSkillCalculatorTests.php:25
PHP 22. Moserware\Skills\TrueSkill\FactorGraphTrueSkillCalculator->calculateNew
Ratings() C:\wamp\www\test_project\trunk\TrueSkill\UnitTests\TrueSkill\TrueSki
llCalculatorTests.php:91
PHP 23. Moserware\Skills\TrueSkill\TrueSkillFactorGraph->runSchedule() C:\wamp
www\test_project\trunk\TrueSkill\Skills\TrueSkill\FactorGraphTrueSkillCalculat
or.php:54
PHP 24. Moserware\Skills\TrueSkill\TrueSkillFactorGraph->createFullSchedule() C
:\wamp\www\test_project\trunk\TrueSkill\Skills\TrueSkill\TrueSkillFactorGraph.
php:87
PHP 25. Moserware\Skills\TrueSkill\Layers\IteratedTeamDifferencesInnerLayer->cr
eatePriorSchedule() C:\wamp\www\test_project\trunk\TrueSkill\Skills\TrueSkill
TrueSkillFactorGraph.php:117
Do you know if there is something I am missing? Have you seen this problem before?
Note that I'm using PHP version 5.4.12, PEAR version 1.9.4, and PHPUnit version 3.5.15. I've also tried a newer version of PHPUnit (version 3.7.xx) with no success.
Any help would be much appreciated,
-sponge8
This error will be fixed with with the currently pending pull request
#7
Thanks -- I tried running your updates and using composer, things go farther now but I'm (unfortunately) still getting one error:
C:\PHPSkills>composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing phpunit/php-token-stream (1.2.1)
Loading from cache - Installing symfony/yaml (v2.3.5)
Loading from cache - Installing phpunit/php-text-template (1.1.4)
Loading from cache - Installing phpunit/phpunit-mock-objects (1.2.3)
Loading from cache - Installing phpunit/php-timer (1.0.5)
Loading from cache - Installing phpunit/php-file-iterator (1.3.3)
Loading from cache - Installing phpunit/php-code-coverage (1.2.13)
Loading from cache - Installing phpunit/phpunit (3.7.27)
Loading from cache
phpunit/phpunit-mock-objects suggests installing ext-soap (*)
phpunit/phpunit suggests installing phpunit/php-invoker (>=1.1.0,<1.2.0)
Generating autoload files
C:\PHPSkills>vendor\bin\phpunit src\Moserware\UnitTests
PHPUnit 3.7.27 by Sebastian Bergmann.
.
..................E..
Time: 2.31 seconds, Memory: 8.00Mb
There was 1 error:
- Moserware\UnitTests\TrueSkill\FactorGraphTrueSkillCalculatorTest::testFactorG
raphTrueSkillCalculator
InvalidArgumentException:
C:\PHPSkills\src\Moserware\Skills\TrueSkill\Layers\IteratedTeamDifferencesInnerL
ayer.php:49
C:\PHPSkills\src\Moserware\Skills\TrueSkill\TrueSkillFactorGraph.php:105
C:\PHPSkills\src\Moserware\Skills\TrueSkill\TrueSkillFactorGraph.php:75
C:\PHPSkills\src\Moserware\Skills\TrueSkill\FactorGraphTrueSkillCalculator.php:4
1
C:\PHPSkills\src\Moserware\UnitTests\TrueSkill\TrueSkillCalculatorTests.php:86
C:\PHPSkills\src\Moserware\UnitTests\TrueSkill\TrueSkillCalculatorTests.php:20
C:\PHPSkills\src\Moserware\UnitTests\TrueSkill\FactorGraphTeamTrueSkillCalculato
rTest.php:13
FAILURES!
Tests: 22, Assertions: 230, Errors: 1.