From 56216073c5d6fb0633018e706e2f663da1325ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Nitzsche?= Date: Fri, 4 Oct 2024 15:03:37 +0200 Subject: [PATCH] #35 add some unit tests --- Tests/Unit/PHP/Series/Rule/LostRuleTest.php | 2 +- Tests/Unit/PHP/Series/Rule/NotLostRuleTest.php | 2 +- Tests/Unit/PHP/Series/Rule/NotWonRuleTest.php | 2 +- Tests/Unit/PHP/Series/Rule/WinRuleTest.php | 2 +- Tests/Unit/PHP/StatsIndexer/PlayerGoalStatsTest.php | 5 ----- composer.json | 2 +- 6 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Tests/Unit/PHP/Series/Rule/LostRuleTest.php b/Tests/Unit/PHP/Series/Rule/LostRuleTest.php index 439e60f..f95dd0c 100644 --- a/Tests/Unit/PHP/Series/Rule/LostRuleTest.php +++ b/Tests/Unit/PHP/Series/Rule/LostRuleTest.php @@ -32,7 +32,7 @@ * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ -class LostTest extends BaseTestCase +class LostRuleTest extends BaseTestCase { /** @var SeriesRuleInterface */ private $rule; diff --git a/Tests/Unit/PHP/Series/Rule/NotLostRuleTest.php b/Tests/Unit/PHP/Series/Rule/NotLostRuleTest.php index f734046..37604b7 100644 --- a/Tests/Unit/PHP/Series/Rule/NotLostRuleTest.php +++ b/Tests/Unit/PHP/Series/Rule/NotLostRuleTest.php @@ -32,7 +32,7 @@ * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ -class NotLostTest extends BaseTestCase +class NotLostRuleTest extends BaseTestCase { /** @var SeriesRuleInterface */ private $rule; diff --git a/Tests/Unit/PHP/Series/Rule/NotWonRuleTest.php b/Tests/Unit/PHP/Series/Rule/NotWonRuleTest.php index 2681f53..76569e3 100644 --- a/Tests/Unit/PHP/Series/Rule/NotWonRuleTest.php +++ b/Tests/Unit/PHP/Series/Rule/NotWonRuleTest.php @@ -32,7 +32,7 @@ * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ -class NotWonTest extends BaseTestCase +class NotWonRuleTest extends BaseTestCase { /** @var SeriesRuleInterface */ private $rule; diff --git a/Tests/Unit/PHP/Series/Rule/WinRuleTest.php b/Tests/Unit/PHP/Series/Rule/WinRuleTest.php index aee0611..1a18ea7 100644 --- a/Tests/Unit/PHP/Series/Rule/WinRuleTest.php +++ b/Tests/Unit/PHP/Series/Rule/WinRuleTest.php @@ -32,7 +32,7 @@ * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ -class WinTest extends BaseTestCase +class WinRuleTest extends BaseTestCase { /** @var SeriesRuleInterface */ private $rule; diff --git a/Tests/Unit/PHP/StatsIndexer/PlayerGoalStatsTest.php b/Tests/Unit/PHP/StatsIndexer/PlayerGoalStatsTest.php index 728941b..f30613b 100644 --- a/Tests/Unit/PHP/StatsIndexer/PlayerGoalStatsTest.php +++ b/Tests/Unit/PHP/StatsIndexer/PlayerGoalStatsTest.php @@ -108,11 +108,6 @@ public function testIndexPlayerStatsGuest() Assert::assertEquals(0, $bagHash[202]->getTypeValue('goalsjoker'), 'Goals joker are wrong'); } - public function testGetInstance() - { - Assert::assertTrue(is_object(Misc::getService('t3sportsPlayerStats', 'goals')), 'Service not registered.'); - } - /** * @return PlayerGoalStats */ diff --git a/composer.json b/composer.json index c45ad5f..33f0786 100644 --- a/composer.json +++ b/composer.json @@ -69,7 +69,7 @@ "test:phpcompat": ".Build/bin/phpcs --ignore=.Build/*,Resources/* -p . --standard=.Build/vendor/phpcompatibility/php-compatibility/PHPCompatibility --runtime-set testVersion ", "test:phpunit": [ "[ -e .Build/bin/phpunit ] || composer update --ansi", - "export TYPO3_PATH_WEB=$PWD/.Build/Web && .Build/bin/phpunit -c Tests/Unit/phpunit.php --colors=always" + "export TYPO3_PATH_WEB=$PWD/.Build/Web && .Build/bin/phpunit -c Tests/Unit/phpunit.xml --colors=always" ], "post-autoload-dump": [ "mkdir -p .Build/Web/typo3conf/ext/",