Skip to content

Commit

Permalink
Change default value for shortenArraysForExportThreshold to 0 (theref…
Browse files Browse the repository at this point in the history
…ore disabling the limiting of array exports)
  • Loading branch information
sebastianbergmann committed Jun 18, 2024
1 parent d7869b4 commit 75c7cf5
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion phpunit.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
<xs:attribute name="displayDetailsOnTestsThatTriggerErrors" type="xs:boolean" default="false"/>
<xs:attribute name="displayDetailsOnTestsThatTriggerNotices" type="xs:boolean" default="false"/>
<xs:attribute name="displayDetailsOnTestsThatTriggerWarnings" type="xs:boolean" default="false"/>
<xs:attribute name="shortenArraysForExportThreshold" type="xs:integer" default="10"/>
<xs:attribute name="shortenArraysForExportThreshold" type="xs:integer" default="0"/>
</xs:attributeGroup>
<xs:group name="configGroup">
<xs:all>
Expand Down
6 changes: 3 additions & 3 deletions src/TextUI/Configuration/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
private bool $debug;

/**
* @psalm-var positive-int
* @psalm-var non-negative-int
*/
private int $shortenArraysForExportThreshold;

Expand All @@ -150,7 +150,7 @@
* @psalm-param ?non-empty-string $pharExtensionDirectory
* @psalm-param non-empty-list<non-empty-string> $testSuffixes
* @psalm-param list<array{className: class-string, parameters: array<string, string>}> $extensionBootstrappers
* @psalm-param positive-int $shortenArraysForExportThreshold
* @psalm-param non-negative-int $shortenArraysForExportThreshold
*/
public function __construct(array $cliArguments, ?string $configurationFile, ?string $bootstrap, bool $cacheResult, ?string $cacheDirectory, ?string $coverageCacheDirectory, Source $source, string $testResultCacheFile, ?string $coverageClover, ?string $coverageCobertura, ?string $coverageCrap4j, int $coverageCrap4jThreshold, ?string $coverageHtml, int $coverageHtmlLowUpperBound, int $coverageHtmlHighLowerBound, string $coverageHtmlColorSuccessLow, string $coverageHtmlColorSuccessMedium, string $coverageHtmlColorSuccessHigh, string $coverageHtmlColorWarning, string $coverageHtmlColorDanger, ?string $coverageHtmlCustomCssFile, ?string $coveragePhp, ?string $coverageText, bool $coverageTextShowUncoveredFiles, bool $coverageTextShowOnlySummary, ?string $coverageXml, bool $pathCoverage, bool $ignoreDeprecatedCodeUnitsFromCodeCoverage, bool $disableCodeCoverageIgnore, bool $failOnDeprecation, bool $failOnEmptyTestSuite, bool $failOnIncomplete, bool $failOnNotice, bool $failOnRisky, bool $failOnSkipped, bool $failOnWarning, bool $stopOnDefect, bool $stopOnDeprecation, bool $stopOnError, bool $stopOnFailure, bool $stopOnIncomplete, bool $stopOnNotice, bool $stopOnRisky, bool $stopOnSkipped, bool $stopOnWarning, bool $outputToStandardErrorStream, int|string $columns, bool $noExtensions, ?string $pharExtensionDirectory, array $extensionBootstrappers, bool $backupGlobals, bool $backupStaticProperties, bool $beStrictAboutChangesToGlobalState, bool $colors, bool $processIsolation, bool $enforceTimeLimit, int $defaultTimeLimit, int $timeoutForSmallTests, int $timeoutForMediumTests, int $timeoutForLargeTests, bool $reportUselessTests, bool $strictCoverage, bool $disallowTestOutput, bool $displayDetailsOnIncompleteTests, bool $displayDetailsOnSkippedTests, bool $displayDetailsOnTestsThatTriggerDeprecations, bool $displayDetailsOnTestsThatTriggerErrors, bool $displayDetailsOnTestsThatTriggerNotices, bool $displayDetailsOnTestsThatTriggerWarnings, bool $reverseDefectList, bool $requireCoverageMetadata, bool $noProgress, bool $noResults, bool $noOutput, int $executionOrder, int $executionOrderDefects, bool $resolveDependencies, ?string $logfileTeamcity, ?string $logfileJunit, ?string $logfileTestdoxHtml, ?string $logfileTestdoxText, ?string $logEventsText, ?string $logEventsVerboseText, bool $teamCityOutput, bool $testDoxOutput, ?array $testsCovering, ?array $testsUsing, ?string $filter, ?string $excludeFilter, ?array $groups, ?array $excludeGroups, int $randomOrderSeed, bool $includeUncoveredFiles, TestSuiteCollection $testSuite, string $includeTestSuite, string $excludeTestSuite, ?string $defaultTestSuite, array $testSuffixes, Php $php, bool $controlGarbageCollector, int $numberOfTestsBeforeGarbageCollection, ?string $generateBaseline, bool $debug, int $shortenArraysForExportThreshold)
{
Expand Down Expand Up @@ -1215,7 +1215,7 @@ public function debug(): bool
}

/**
* @psalm-return positive-int
* @psalm-return non-negative-int
*/
public function shortenArraysForExportThreshold(): int
{
Expand Down
2 changes: 1 addition & 1 deletion src/TextUI/Configuration/Xml/DefaultConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public static function create(): self
false,
false,
100,
10,
0,
),
TestSuiteCollection::fromArray([]),
);
Expand Down
6 changes: 3 additions & 3 deletions src/TextUI/Configuration/Xml/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -809,10 +809,10 @@ private function phpunit(string $filename, DOMDocument $document): PHPUnit
$beStrictAboutCoverageMetadata = $this->getBooleanAttribute($document->documentElement, 'beStrictAboutCoverageMetadata', false);
}

$shortenArraysForExportThreshold = $this->getIntegerAttribute($document->documentElement, 'shortenArraysForExportThreshold', 10);
$shortenArraysForExportThreshold = $this->getIntegerAttribute($document->documentElement, 'shortenArraysForExportThreshold', 0);

if ($shortenArraysForExportThreshold < 1) {
$shortenArraysForExportThreshold = 10;
if ($shortenArraysForExportThreshold < 0) {
$shortenArraysForExportThreshold = 0;
}

return new PHPUnit(
Expand Down
6 changes: 3 additions & 3 deletions src/TextUI/Configuration/Xml/PHPUnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@
private int $numberOfTestsBeforeGarbageCollection;

/**
* @psalm-var positive-int
* @psalm-var non-negative-int
*/
private int $shortenArraysForExportThreshold;

/**
* @psalm-param ?non-empty-string $extensionsDirectory
* @psalm-param positive-int $shortenArraysForExportThreshold
* @psalm-param non-negative-int $shortenArraysForExportThreshold
*/
public function __construct(?string $cacheDirectory, bool $cacheResult, int|string $columns, string $colors, bool $stderr, bool $displayDetailsOnIncompleteTests, bool $displayDetailsOnSkippedTests, bool $displayDetailsOnTestsThatTriggerDeprecations, bool $displayDetailsOnTestsThatTriggerErrors, bool $displayDetailsOnTestsThatTriggerNotices, bool $displayDetailsOnTestsThatTriggerWarnings, bool $reverseDefectList, bool $requireCoverageMetadata, ?string $bootstrap, bool $processIsolation, bool $failOnDeprecation, bool $failOnEmptyTestSuite, bool $failOnIncomplete, bool $failOnNotice, bool $failOnRisky, bool $failOnSkipped, bool $failOnWarning, bool $stopOnDefect, bool $stopOnDeprecation, bool $stopOnError, bool $stopOnFailure, bool $stopOnIncomplete, bool $stopOnNotice, bool $stopOnRisky, bool $stopOnSkipped, bool $stopOnWarning, ?string $extensionsDirectory, bool $beStrictAboutChangesToGlobalState, bool $beStrictAboutOutputDuringTests, bool $beStrictAboutTestsThatDoNotTestAnything, bool $beStrictAboutCoverageMetadata, bool $enforceTimeLimit, int $defaultTimeLimit, int $timeoutForSmallTests, int $timeoutForMediumTests, int $timeoutForLargeTests, ?string $defaultTestSuite, int $executionOrder, bool $resolveDependencies, bool $defectsFirst, bool $backupGlobals, bool $backupStaticProperties, bool $testdoxPrinter, bool $controlGarbageCollector, int $numberOfTestsBeforeGarbageCollection, int $shortenArraysForExportThreshold)
{
Expand Down Expand Up @@ -448,7 +448,7 @@ public function numberOfTestsBeforeGarbageCollection(): int
}

/**
* @psalm-return positive-int
* @psalm-return non-negative-int
*/
public function shortenArraysForExportThreshold(): int
{
Expand Down
2 changes: 1 addition & 1 deletion tests/_files/configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
executionOrder="default"
controlGarbageCollector="true"
numberOfTestsBeforeGarbageCollection="1000"
shortenArraysForExportThreshold="100"
shortenArraysForExportThreshold="10"
>
<testsuites>
<testsuite name="My Test Suite">
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/TextUI/Configuration/Xml/LoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ public function testPHPUnitConfigurationIsReadCorrectly(): void
$this->assertTrue($phpunit->resolveDependencies());
$this->assertTrue($phpunit->controlGarbageCollector());
$this->assertSame(1000, $phpunit->numberOfTestsBeforeGarbageCollection());
$this->assertSame(100, $phpunit->shortenArraysForExportThreshold());
$this->assertSame(10, $phpunit->shortenArraysForExportThreshold());
}

public function test_TestDox_configuration_is_parsed_correctly(): void
Expand Down

0 comments on commit 75c7cf5

Please # to comment.