Add full support for PHP 8.0

Unfortunately due to PHPUnit 8.5 dependency
this also drops support for PHP 7.1
This commit is contained in:
Petr Skoda authored and Adrien Loison committed 2021-02-08 14:31:55 +01:00
1 parent ab973cab34
commit 816596183f
23 files changed
+46 -33

No files matched your search

+2 -2
View File
@@ -101,7 +101,7 @@ class WriterTest extends TestCase
]);
$writtenContent = $this->writeToCsvFileAndReturnWrittenContent($allRows, 'csv_with_utf8_bom.csv');
$this->assertContains(EncodingHelper::BOM_UTF8, $writtenContent, 'The CSV file should contain a UTF-8 BOM');
$this->assertStringStartsWith(EncodingHelper::BOM_UTF8, $writtenContent, 'The CSV file should contain a UTF-8 BOM');
}
/**
@@ -114,7 +114,7 @@ class WriterTest extends TestCase
]);
$writtenContent = $this->writeToCsvFileAndReturnWrittenContent($allRows, 'csv_no_bom.csv', ',', '"', false);
$this->assertNotContains(EncodingHelper::BOM_UTF8, $writtenContent, 'The CSV file should not contain a UTF-8 BOM');
$this->assertStringNotContainsString(EncodingHelper::BOM_UTF8, $writtenContent, 'The CSV file should not contain a UTF-8 BOM');
}
/**
@@ -18,7 +18,7 @@ class SheetTest extends TestCase
/**
* @return void
*/
public function setUp()
public function setUp(): void
{
$this->sheetManager = new SheetManager(new StringHelper());
}
@@ -18,7 +18,7 @@ class StyleMergerTest extends TestCase
/**
* @return void
*/
public function setUp()
public function setUp(): void
{
$this->styleMerger = new StyleMerger();
}
@@ -20,7 +20,7 @@ class StyleRegistryTest extends TestCase
/**
* @return void
*/
public function setUp()
public function setUp(): void
{
$this->defaultStyle = (new StyleBuilder())->build();
$this->styleRegistry = new StyleRegistry($this->defaultStyle);
+2 -2
View File
@@ -89,7 +89,7 @@ class SheetTest extends TestCase
$pathToContentFile = $resourcePath . '#content.xml';
$xmlContents = file_get_contents('zip://' . $pathToContentFile);
$this->assertContains(' table:display="false"', $xmlContents, 'The sheet visibility should have been changed to "hidden"');
$this->assertStringContainsString(' table:display="false"', $xmlContents, 'The sheet visibility should have been changed to "hidden"');
}
/**
@@ -164,6 +164,6 @@ class SheetTest extends TestCase
$pathToWorkbookFile = $resourcePath . '#content.xml';
$xmlContents = file_get_contents('zip://' . $pathToWorkbookFile);
$this->assertContains("table:name=\"$expectedName\"", $xmlContents, $message);
$this->assertStringContainsString("table:name=\"$expectedName\"", $xmlContents, $message);
}
}
+3 -3
View File
@@ -547,7 +547,7 @@ class WriterTest extends TestCase
$pathToContentFile = $resourcePath . '#content.xml';
$xmlContents = file_get_contents('zip://' . $pathToContentFile);
$this->assertContains($value, $xmlContents, $message);
$this->assertStringContainsString($value, $xmlContents, $message);
}
/**
@@ -562,7 +562,7 @@ class WriterTest extends TestCase
$sheetXmlAsString = $this->getSheetXmlNodeAsString($fileName, $sheetIndex);
$valueAsXmlString = "<text:p>$value</text:p>";
$this->assertContains($valueAsXmlString, $sheetXmlAsString, $message);
$this->assertStringContainsString($valueAsXmlString, $sheetXmlAsString, $message);
}
/**
@@ -577,7 +577,7 @@ class WriterTest extends TestCase
$sheetXmlAsString = $this->getSheetXmlNodeAsString($fileName, $sheetIndex);
$valueAsXmlString = "<text:p>$value</text:p>";
$this->assertNotContains($valueAsXmlString, $sheetXmlAsString, $message);
$this->assertStringNotContainsString($valueAsXmlString, $sheetXmlAsString, $message);
}
/**
@@ -30,7 +30,7 @@ class WriterWithStyleTest extends TestCase
/**
* @return void
*/
public function setUp()
public function setUp(): void
{
$this->defaultStyle = (new StyleBuilder())->build();
}
+2 -2
View File
@@ -89,7 +89,7 @@ class SheetTest extends TestCase
$pathToWorkbookFile = $resourcePath . '#xl/workbook.xml';
$xmlContents = file_get_contents('zip://' . $pathToWorkbookFile);
$this->assertContains(' state="hidden"', $xmlContents, 'The sheet visibility should have been changed to "hidden"');
$this->assertStringContainsString(' state="hidden"', $xmlContents, 'The sheet visibility should have been changed to "hidden"');
}
/**
@@ -166,6 +166,6 @@ class SheetTest extends TestCase
$pathToWorkbookFile = $resourcePath . '#xl/workbook.xml';
$xmlContents = file_get_contents('zip://' . $pathToWorkbookFile);
$this->assertContains("<sheet name=\"$expectedName\"", $xmlContents, $message);
$this->assertStringContainsString("<sheet name=\"$expectedName\"", $xmlContents, $message);
}
}
+3 -3
View File
@@ -608,7 +608,7 @@ class WriterTest extends TestCase
$pathToSheetFile = $resourcePath . '#xl/worksheets/sheet' . $sheetIndex . '.xml';
$xmlContents = file_get_contents('zip://' . $pathToSheetFile);
$this->assertContains((string) $inlineData, $xmlContents, $message);
$this->assertStringContainsString((string) $inlineData, $xmlContents, $message);
}
/**
@@ -624,7 +624,7 @@ class WriterTest extends TestCase
$pathToSheetFile = $resourcePath . '#xl/worksheets/sheet' . $sheetIndex . '.xml';
$xmlContents = file_get_contents('zip://' . $pathToSheetFile);
$this->assertNotContains((string) $inlineData, $xmlContents, $message);
$this->assertStringNotContainsString((string) $inlineData, $xmlContents, $message);
}
/**
@@ -639,6 +639,6 @@ class WriterTest extends TestCase
$pathToSharedStringsFile = $resourcePath . '#xl/sharedStrings.xml';
$xmlContents = file_get_contents('zip://' . $pathToSharedStringsFile);
$this->assertContains($sharedString, $xmlContents, $message);
$this->assertStringContainsString($sharedString, $xmlContents, $message);
}
}
@@ -32,7 +32,7 @@ class WriterWithStyleTest extends TestCase
/**
* @return void
*/
public function setUp()
public function setUp(): void
{
$this->defaultStyle = (new StyleBuilder())->build();
}