mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-25 15:08:19 +00:00
ec4098c8fd
While we might never be able to have 100% of our code strict, we can at the very least do it for all of our tests. This ensures that our tests are using our API with the types as intended by the test author, and not silently be cast to what our API requires.
26 lines
878 B
PHP
26 lines
878 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Reader\Slk;
|
|
|
|
use PhpOffice\PhpSpreadsheet\Reader\Slk;
|
|
|
|
class SlkCommentsTest extends \PHPUnit\Framework\TestCase
|
|
{
|
|
public function testComments(): void
|
|
{
|
|
$testbook = 'tests/data/Reader/Slk/issue.2276.slk';
|
|
$reader = new Slk();
|
|
$spreadsheet = $reader->load($testbook);
|
|
$sheet = $spreadsheet->getActiveSheet();
|
|
$comments = $sheet->getComments();
|
|
self::assertCount(2, $comments);
|
|
self::assertArrayHasKey('A1', $comments);
|
|
self::assertArrayHasKey('B2', $comments);
|
|
self::assertSame("Zeratul:\nEn Taro Adun!", $sheet->getComment('A1')->getText()->getPlainText());
|
|
self::assertSame("Arthas:\nFrostmourne Hungers.", $sheet->getComment('B2')->getText()->getPlainText());
|
|
$spreadsheet->disconnectWorksheets();
|
|
}
|
|
}
|