Code review changes

This commit is contained in:
Antoine Lamirault authored and Adrien Loison committed 2021-03-30 19:42:21 +02:00
1 parent 197fb9987a
commit 11d91e1740
20 files changed
+105 -59

No files matched your search

@@ -14,7 +14,7 @@ class OptionsManagerTest extends TestCase
*/
protected $optionsManager;
protected function setUp(): void
protected function setUp() : void
{
$this->optionsManager = new class() extends OptionsManagerAbstract {
protected function getSupportedOptions()
@@ -25,7 +25,7 @@ class SharedStringsManagerTest extends TestCase
/**
* @return void
*/
public function setUp(): void
public function setUp() : void
{
$this->sharedStringsManager = null;
}
@@ -33,7 +33,7 @@ class SharedStringsManagerTest extends TestCase
/**
* @return void
*/
public function tearDown(): void
public function tearDown() : void
{
if ($this->sharedStringsManager !== null) {
$this->sharedStringsManager->cleanup();
+1 -1
View File
@@ -61,7 +61,7 @@ class WriterPerfTest extends TestCase
*/
private function getNumWrittenRows($resourcePath)
{
$lineCountResult = `wc -l $resourcePath`;
$lineCountResult = shell_exec("wc -l $resourcePath");
return (int) $lineCountResult;
}
@@ -18,7 +18,7 @@ class SheetTest extends TestCase
/**
* @return void
*/
public function setUp(): void
public function setUp() : void
{
$this->sheetManager = new SheetManager(new StringHelper());
}
@@ -28,10 +28,10 @@ class StyleManagerTest extends TestCase
$this->assertFalse($style->shouldWrapText());
$styleManager = $this->getStyleManager();
$updatedStyle = $styleManager->applyExtraStylesIfNeeded(new Cell("multi\nlines", $style));
$managedStyle = $styleManager->applyExtraStylesIfNeeded(new Cell("multi\nlines", $style));
$this->assertNotNull($updatedStyle);
$this->assertTrue($updatedStyle->shouldWrapText());
$this->assertTrue($managedStyle->isUpdated());
$this->assertTrue($managedStyle->getStyle()->shouldWrapText());
}
public function testApplyExtraStylesIfNeededShouldReturnNullIfWrapTextNotNeeded() : void
@@ -40,9 +40,9 @@ class StyleManagerTest extends TestCase
$this->assertFalse($style->shouldWrapText());
$styleManager = $this->getStyleManager();
$updatedStyle = $styleManager->applyExtraStylesIfNeeded(new Cell('oneline', $style));
$managedStyle = $styleManager->applyExtraStylesIfNeeded(new Cell('oneline', $style));
$this->assertNull($updatedStyle);
$this->assertFalse($managedStyle->isUpdated());
}
public function testApplyExtraStylesIfNeededShouldReturnNullIfWrapTextAlreadyApplied() : void
@@ -51,8 +51,8 @@ class StyleManagerTest extends TestCase
$this->assertTrue($style->shouldWrapText());
$styleManager = $this->getStyleManager();
$updatedStyle = $styleManager->applyExtraStylesIfNeeded(new Cell("multi\nlines", $style));
$managedStyle = $styleManager->applyExtraStylesIfNeeded(new Cell("multi\nlines", $style));
$this->assertNull($updatedStyle);
$this->assertFalse($managedStyle->isUpdated());
}
}
@@ -18,7 +18,7 @@ class StyleMergerTest extends TestCase
/**
* @return void
*/
public function setUp(): void
public function setUp() : void
{
$this->styleMerger = new StyleMerger();
}
@@ -20,7 +20,7 @@ class StyleRegistryTest extends TestCase
/**
* @return void
*/
public function setUp(): void
public function setUp() : void
{
$this->defaultStyle = (new StyleBuilder())->build();
$this->styleRegistry = new StyleRegistry($this->defaultStyle);
+1 -1
View File
@@ -88,7 +88,7 @@ class WriterPerfTest extends TestCase
copy($pathToContentXmlFile, $tmpFile);
// Get the last 200 characters
$lastCharacters = `tail -c 200 $tmpFile`;
$lastCharacters = shell_exec("tail -c 200 $tmpFile");
// remove the temporary file
unlink($tmpFile);
@@ -30,7 +30,7 @@ class WriterWithStyleTest extends TestCase
/**
* @return void
*/
public function setUp(): void
public function setUp() : void
{
$this->defaultStyle = (new StyleBuilder())->build();
}
+1 -1
View File
@@ -135,7 +135,7 @@ class WriterPerfTest extends TestCase
copy($filePath, $tmpFile);
// Get the last 200 characters
$lastCharacters = `tail -c $numCharacters $tmpFile`;
$lastCharacters = shell_exec("tail -c $numCharacters $tmpFile");
// remove the temporary file
unlink($tmpFile);
@@ -32,7 +32,7 @@ class WriterWithStyleTest extends TestCase
/**
* @return void
*/
public function setUp(): void
public function setUp() : void
{
$this->defaultStyle = (new StyleBuilder())->build();
}