Code review changes
This commit is contained in:
1 parent
197fb9987a
commit
11d91e1740
20 files changed
+105
-59
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user