diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6020e96..2c83202 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.PHP }} - coverage: xdebug + coverage: pcov tools: composer:v2 - name: CI-Bootstrap diff --git a/.gitignore b/.gitignore index 6667882..4105b00 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ +.Build .buildpath .project .settings/ -.Build \ No newline at end of file +composer.lock diff --git a/Build/Test/phpunit.xml b/Build/Test/phpunit.xml index 7ace0f9..15f5020 100644 --- a/Build/Test/phpunit.xml +++ b/Build/Test/phpunit.xml @@ -1,27 +1,27 @@ - - - ../../Classes/ - - - - - ../../Tests/ - - + + + ../../Classes/ + + + + + ../../Tests/ + + diff --git a/Tests/Domain/AbstractSolrTestCase.php b/Tests/Domain/AbstractSolrTestCase.php index 19cdebf..031b635 100644 --- a/Tests/Domain/AbstractSolrTestCase.php +++ b/Tests/Domain/AbstractSolrTestCase.php @@ -6,7 +6,6 @@ abstract class AbstractSolrTest extends TestCase { - /** * Helper method to get the path of a "fixtures" folder that is relative to the current class folder. * @@ -31,4 +30,4 @@ protected function getFixtureContent($fixtureFilename) return file_get_contents($this->getTestFixturePath().$fixtureFilename); } -} \ No newline at end of file +} diff --git a/Tests/Domain/Result/Explanation/ExplainServiceTestCase.php b/Tests/Domain/Result/Explanation/ExplainServiceTestCase.php index 6acbae0..e70da97 100644 --- a/Tests/Domain/Result/Explanation/ExplainServiceTestCase.php +++ b/Tests/Domain/Result/Explanation/ExplainServiceTestCase.php @@ -48,7 +48,7 @@ public function testCanNotCreateEmptyNodes() /** * @test */ - public function testCanParseSynonymeNodes() + public function testCanParseSynonymNodes() { $content = $this->getFixtureContent('6.6.001.txt'); $result = ExplainService::getFieldImpactsFromRawContent( @@ -58,10 +58,10 @@ public function testCanParseSynonymeNodes() ); $expectedResult = [ - 'keywords' => 8.2394580648419, - 'description' => 2.1925963619964, - 'tagsH1' => 8.539163146877, - 'content' => 81.028780249768 + 'keywords' => 8.239458064841905, + 'description' => 2.1925963619964572, + 'tagsH1' => 8.539163146876982, + 'content' => 81.02878024976832, ]; $this->assertEquals($expectedResult, $result); diff --git a/Tests/Domain/Result/Explanation/ExplanationSolr3TestCase.php b/Tests/Domain/Result/Explanation/ExplanationSolr3TestCase.php index dc78d0a..a0730be 100644 --- a/Tests/Domain/Result/Explanation/ExplanationSolr3TestCase.php +++ b/Tests/Domain/Result/Explanation/ExplanationSolr3TestCase.php @@ -56,8 +56,8 @@ public function testFixture001GetImpact() // 0.5044475 * 73,582959599 = 37,118740012 / 2 => 18,559370006 // 0.8545628 * 73,582959599 = 62,881259988 / 2 => 31,440629994 - $this->assertEquals(18.559370006246,$explain->getRootNode()->getChild(0)->getChild(0)->getChild(0)->getChild(0)->getAbsoluteImpactPercentage()); - $this->assertEquals(31.440629993754,$explain->getRootNode()->getChild(0)->getChild(0)->getChild(0)->getChild(1)->getAbsoluteImpactPercentage()); + $this->assertEquals(18.55937000624646,$explain->getRootNode()->getChild(0)->getChild(0)->getChild(0)->getChild(0)->getAbsoluteImpactPercentage()); + $this->assertEquals(31.440629993753543,$explain->getRootNode()->getChild(0)->getChild(0)->getChild(0)->getChild(1)->getAbsoluteImpactPercentage()); $this->assertEquals(Explain::NODE_TYPE_MAX,$explain->getRootNode()->getChild(0)->getChild(0)->getNodeType()); } @@ -108,4 +108,4 @@ public function testFixture005() $this->assertEquals(5.8746934,$explain->getRootNode()->getScore()); $this->assertEquals(2, $explain->getChildren()->count()); } -} \ No newline at end of file +} diff --git a/Tests/Domain/Result/Explanation/Visitors/SummarizeFieldImpactsTestCase.php b/Tests/Domain/Result/Explanation/Visitors/SummarizeFieldImpactsTestCase.php index 7f2c9e0..c43a3f4 100644 --- a/Tests/Domain/Result/Explanation/Visitors/SummarizeFieldImpactsTestCase.php +++ b/Tests/Domain/Result/Explanation/Visitors/SummarizeFieldImpactsTestCase.php @@ -49,7 +49,7 @@ public function testCanSummarizeFieldImpactFixture003() $visitor = new SummarizeFieldImpacts(); $explain->getRootNode()->visitNodes($visitor); - $this->assertEquals(95.756597168764,$visitor->getFieldImpact('price')); + $this->assertEquals(95.75659716876356,$visitor->getFieldImpact('price')); $this->assertEquals(['name','manu','price'],$visitor->getRelevantFieldNames()); }