From 1bbc4bb91c8cd5e650097030701c9153c8f93803 Mon Sep 17 00:00:00 2001 From: Jens True Date: Tue, 6 Feb 2024 12:05:19 +0000 Subject: [PATCH] Adding "CoversNothing" to split integration tests from unittests. --- README | 8 ++- composer.lock | 60 ++++++++----------- ...FactorGraphTeamTrueSkillCalculatorTest.php | 28 --------- .../FactorGraphTrueSkillCalculatorTest.php | 20 +++++++ .../TwoPlayerTrueSkillCalculatorTest.php | 2 + .../TwoTeamTrueSkillCalculatorTest.php | 2 + 6 files changed, 55 insertions(+), 65 deletions(-) delete mode 100644 tests/TrueSkill/FactorGraphTeamTrueSkillCalculatorTest.php diff --git a/README b/README index ce4c9d6..1ae7d27 100644 --- a/README +++ b/README @@ -6,4 +6,10 @@ For more details on how the algorithm works, see http://www.moserware.com/2010/03/computing-your-skill.html -For details on how to use this project, see the accompanying unit tests with this project \ No newline at end of file +For details on how to use this project, see the accompanying example snippets with this project. + +For development Composer and the following packages are used (Recommended as Phars installed via Phive) + +sudo phive install -g composer phpdocumentor infection phpcs phpcbf phploc phpbench overtrue/phplint +composer install +composer all \ No newline at end of file diff --git a/composer.lock b/composer.lock index 609e1e9..1ab36fc 100644 --- a/composer.lock +++ b/composer.lock @@ -2928,16 +2928,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", "shasum": "" }, "require": { @@ -2951,9 +2951,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -2990,7 +2987,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" }, "funding": [ { @@ -3006,20 +3003,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "875e90aeea2777b6f135677f618529449334a612" + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", - "reference": "875e90aeea2777b6f135677f618529449334a612", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", "shasum": "" }, "require": { @@ -3030,9 +3027,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3071,7 +3065,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" }, "funding": [ { @@ -3087,20 +3081,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", "shasum": "" }, "require": { @@ -3111,9 +3105,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3155,7 +3146,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" }, "funding": [ { @@ -3171,20 +3162,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", - "reference": "42292d99c55abe617799667f454222c54c60e229", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", "shasum": "" }, "require": { @@ -3198,9 +3189,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3238,7 +3226,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" }, "funding": [ { @@ -3254,7 +3242,7 @@ "type": "tidelift" } ], - "time": "2023-07-28T09:04:16+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/service-contracts", diff --git a/tests/TrueSkill/FactorGraphTeamTrueSkillCalculatorTest.php b/tests/TrueSkill/FactorGraphTeamTrueSkillCalculatorTest.php deleted file mode 100644 index 7870875..0000000 --- a/tests/TrueSkill/FactorGraphTeamTrueSkillCalculatorTest.php +++ /dev/null @@ -1,28 +0,0 @@ -assertEquals(TRUE, $calculator->isSupported(SkillCalculatorSupportedOptions::PARTIAL_PLAY)); - } -} diff --git a/tests/TrueSkill/FactorGraphTrueSkillCalculatorTest.php b/tests/TrueSkill/FactorGraphTrueSkillCalculatorTest.php index 54227df..ee14f4f 100644 --- a/tests/TrueSkill/FactorGraphTrueSkillCalculatorTest.php +++ b/tests/TrueSkill/FactorGraphTrueSkillCalculatorTest.php @@ -8,10 +8,13 @@ use DNW\Skills\GameInfo; use DNW\Skills\Player; use DNW\Skills\Team; use DNW\Skills\TrueSkill\FactorGraphTrueSkillCalculator; +use DNW\Skills\SkillCalculatorSupportedOptions; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\CoversNothing; class FactorGraphTrueSkillCalculatorTest extends TestCase { + #[CoversNothing] public function testMicrosoftResearchExample(): void { $gameInfo = new GameInfo(); @@ -53,4 +56,21 @@ class FactorGraphTrueSkillCalculatorTest extends TestCase $this->assertEqualsWithDelta($expected[$player->getId()][1], $rating->getStandardDeviation(), 0.001); } } + + #[CoversNothing] + public function testFactorGraphTrueSkillCalculator(): void + { + $calculator = new FactorGraphTrueSkillCalculator(); + + TrueSkillCalculatorTests::testAllTwoPlayerScenarios($this, $calculator); + TrueSkillCalculatorTests::testAllTwoTeamScenarios($this, $calculator); + TrueSkillCalculatorTests::testAllMultipleTeamScenarios($this, $calculator); + TrueSkillCalculatorTests::testPartialPlayScenarios($this, $calculator); + } + + public function testMethodisSupported(): void + { + $calculator = new FactorGraphTrueSkillCalculator(); + $this->assertEquals(TRUE, $calculator->isSupported(SkillCalculatorSupportedOptions::PARTIAL_PLAY)); + } } diff --git a/tests/TrueSkill/TwoPlayerTrueSkillCalculatorTest.php b/tests/TrueSkill/TwoPlayerTrueSkillCalculatorTest.php index 43b63d6..6a8c9aa 100644 --- a/tests/TrueSkill/TwoPlayerTrueSkillCalculatorTest.php +++ b/tests/TrueSkill/TwoPlayerTrueSkillCalculatorTest.php @@ -6,9 +6,11 @@ namespace DNW\Skills\Tests\TrueSkill; use DNW\Skills\TrueSkill\TwoPlayerTrueSkillCalculator; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\CoversNothing; class TwoPlayerTrueSkillCalculatorTest extends TestCase { + #[CoversNothing] public function testTwoPlayerTrueSkillCalculator(): void { $calculator = new TwoPlayerTrueSkillCalculator(); diff --git a/tests/TrueSkill/TwoTeamTrueSkillCalculatorTest.php b/tests/TrueSkill/TwoTeamTrueSkillCalculatorTest.php index d1ad033..215f956 100644 --- a/tests/TrueSkill/TwoTeamTrueSkillCalculatorTest.php +++ b/tests/TrueSkill/TwoTeamTrueSkillCalculatorTest.php @@ -6,9 +6,11 @@ namespace DNW\Skills\Tests\TrueSkill; use DNW\Skills\TrueSkill\TwoTeamTrueSkillCalculator; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Attributes\CoversNothing; class TwoTeamTrueSkillCalculatorTest extends TestCase { + #[CoversNothing] public function testTwoTeamTrueSkillCalculator(): void { $calculator = new TwoTeamTrueSkillCalculator();