From 1359cbeb6b0f3821fefada4a3cdf162c8450e280 Mon Sep 17 00:00:00 2001 From: Jens True Date: Mon, 5 Feb 2024 13:29:57 +0000 Subject: [PATCH] More testing and reporting --- composer.lock | 12 ++++++------ phpmetrics.json | 3 ++- phpunit.xml | 1 + src/FactorGraphs/FactorGraph.php | 5 ----- tests/GameInfoTest.php | 22 ++++++++++++++++++++++ 5 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 tests/GameInfoTest.php diff --git a/composer.lock b/composer.lock index 866f2fb..609e1e9 100644 --- a/composer.lock +++ b/composer.lock @@ -1590,16 +1590,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.9", + "version": "10.5.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "0bd663704f0165c9e76fe4f06ffa6a1ca727fdbe" + "reference": "50b8e314b6d0dd06521dc31d1abffa73f25f850c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0bd663704f0165c9e76fe4f06ffa6a1ca727fdbe", - "reference": "0bd663704f0165c9e76fe4f06ffa6a1ca727fdbe", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/50b8e314b6d0dd06521dc31d1abffa73f25f850c", + "reference": "50b8e314b6d0dd06521dc31d1abffa73f25f850c", "shasum": "" }, "require": { @@ -1671,7 +1671,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.9" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.10" }, "funding": [ { @@ -1687,7 +1687,7 @@ "type": "tidelift" } ], - "time": "2024-01-22T14:35:40+00:00" + "time": "2024-02-04T09:07:51+00:00" }, { "name": "psr/container", diff --git a/phpmetrics.json b/phpmetrics.json index 126349b..0b47f1d 100644 --- a/phpmetrics.json +++ b/phpmetrics.json @@ -7,7 +7,8 @@ "tests" ], "report": { - "html": "output/metrics/" + "html": "output/metrics/", + "json": "output/metrics/report.json" }, "plugins": { "git": { diff --git a/phpunit.xml b/phpunit.xml index cdce282..0ab8991 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -18,6 +18,7 @@ + diff --git a/src/FactorGraphs/FactorGraph.php b/src/FactorGraphs/FactorGraph.php index 9a68f59..8698bb7 100644 --- a/src/FactorGraphs/FactorGraph.php +++ b/src/FactorGraphs/FactorGraph.php @@ -8,11 +8,6 @@ class FactorGraph { private VariableFactory $variableFactory; - public function __construct(VariableFactory $factory) - { - $this->variableFactory = $factory; - } - public function getVariableFactory(): VariableFactory { return $this->variableFactory; diff --git a/tests/GameInfoTest.php b/tests/GameInfoTest.php new file mode 100644 index 0000000..2311b88 --- /dev/null +++ b/tests/GameInfoTest.php @@ -0,0 +1,22 @@ +assertEquals(1, $gi->getInitialMean()); + $this->assertEquals(2, $gi->getInitialStandardDeviation()); + $this->assertEquals(3, $gi->getBeta()); + $this->assertEquals(4, $gi->getDynamicsFactor()); + $this->assertEquals(5, $gi->getDrawProbability()); + $this->assertInstanceOf(\DNW\Skills\Rating::class, $gi->getDefaultRating()); + } +}