Skip to content

Commit

Permalink
Update master to output generated at e2b4528
Browse files Browse the repository at this point in the history
  • Loading branch information
abenevaut committed Apr 5, 2022
1 parent 4013e42 commit 30f83d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions app/Services/PHPUnitConfigurationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function setConfigurationFile(string $configurationFile): self
*/
public function generateTestsSuites(string $testsDirectory, int $numberTestsSuites = 4)
{
throw_if(!$this->isInitialized(), new \Exception('Configuration file is not set.'));
$this->isInitialized();

$phpunit = $this
->configurationFile
Expand All @@ -58,7 +58,9 @@ public function generateTestsSuites(string $testsDirectory, int $numberTestsSuit
})
->split($numberTestsSuites)
->each(function ($filesList, $index) use ($testSuites) {
$testSuite = $this->configurationFile->createElement('testsuite');
$testSuite = $this
->configurationFile
->createElement('testsuite');
$testSuite->setAttribute('name', "sliced-testsuite-{$index}");

collect($filesList)
Expand All @@ -82,16 +84,19 @@ public function generateTestsSuites(string $testsDirectory, int $numberTestsSuit
*/
public function saveTo(string $destination)
{
throw_if(!$this->isInitialized(), new \Exception('Configuration file is not set.'));
$this->isInitialized();

return $this->configurationFile->save($destination);
}

/**
* @return bool
* @return void
* @throws \Throwable
*/
private function isInitialized(): bool
private function isInitialized(): void
{
return $this->configurationFile instanceof \DOMDocument;
$isInitialized = $this->configurationFile instanceof \DOMDocument;

throw_if(!$isInitialized, new \Exception('Configuration file is not set.'));
}
}
Binary file modified builds/phpunit-slicer
Binary file not shown.

0 comments on commit 30f83d2

Please sign in to comment.