Fix 'hasExampleData'

This commit is contained in:
Tristan 2023-12-03 16:49:46 +01:00
parent 929b87e513
commit 7ded60ce9c
Signed by: trizz
SSH Key Fingerprint: SHA256:Xsd2dTN+ZC3OZWfvuKIDMQ/1lWicuINSEPgRQw/CJT8
2 changed files with 4 additions and 22 deletions

View File

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="vendor/autoload.php"
executionOrder="depends,defects" beStrictAboutOutputDuringTests="true" failOnRisky="false" failOnWarning="true"
cacheDirectory=".phpunit.cache" requireCoverageMetadata="false" beStrictAboutCoverageMetadata="false" colors="true">
<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage/>
<source>
<include>
<directory suffix=".php">src</directory>
</include>
</source>
<extensions>
<bootstrap class="RobinIngelbrecht\PHPUnitPrettyPrint\PhpUnitExtension">
</bootstrap>
</extensions>
</phpunit>

View File

@ -103,7 +103,10 @@ abstract class Solution
public function hasExampleData(): bool public function hasExampleData(): bool
{ {
return $this->exampleData['global'] !== []; return
($this->exampleData['global'] !== null && $this->exampleData['global'] !== [])
|| ($this->exampleData['part1'] !== null && $this->exampleData['part1'] !== [])
|| ($this->exampleData['part2'] !== null && $this->exampleData['part2'] !== []);
} }
/** /**