Skip to content

Commit

Permalink
Add test coverage for enforceTimeLimit and defaultTimeLimit
Browse files Browse the repository at this point in the history
  • Loading branch information
epdenouden authored and sebastianbergmann committed Sep 8, 2018
1 parent 586fe31 commit 094e67c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/unit/Util/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,22 @@ public function testShouldParseXmlConfigurationExecutionOrderCombined(): void
@\unlink($tmpFilename);
}

public function testShouldParseXmlConfigurationToEnforceTimeLimitAndDefaultTimeout(): void
{
$tmpFilename = \sys_get_temp_dir() . \DIRECTORY_SEPARATOR . 'phpunit.' . \uniqid() . '.xml';
$xml = "<phpunit enforceTimeLimit='true' defaultTimeLimit='432'></phpunit>" . \PHP_EOL;
\file_put_contents($tmpFilename, $xml);

$configurationInstance = Configuration::getInstance($tmpFilename);
$this->assertFalse($configurationInstance->hasValidationErrors(), 'option causes validation error');

$configurationValues = $configurationInstance->getPHPUnitConfiguration();
$this->assertSame(true, $configurationValues['enforceTimeLimit']);
$this->assertSame(432, $configurationValues['defaultTimeLimit']);

@\unlink($tmpFilename);
}

public function testFilterConfigurationIsReadCorrectly(): void
{
$this->assertEquals(
Expand Down

0 comments on commit 094e67c

Please sign in to comment.