MovedFunctionsTest.php 1.2 KB

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\LookupRef;
  3. use PhpOffice\PhpSpreadsheet\Calculation\Functions;
  4. use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
  5. use PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
  6. use PHPUnit\Framework\TestCase;
  7. /**
  8. * Sanity tests for functions which have been moved out of LookupRef
  9. * to their own classes. A deprecated version remains in LookupRef;
  10. * this class contains cursory tests to ensure that those work properly.
  11. * Only 6 of the 15 functions are covered below at the moment.
  12. *
  13. * @covers \PhpOffice\PhpSpreadsheet\Calculation\LookupRef
  14. */
  15. class MovedFunctionsTest extends TestCase
  16. {
  17. public function testMovedFunctions(): void
  18. {
  19. self::assertSame(3, LookupRef::COLUMN('C5'));
  20. self::assertSame(ExcelError::REF(), LookupRef::FORMULATEXT('A1'));
  21. self::assertSame(ExcelError::REF(), LookupRef::HYPERLINK('https://phpspreadsheet.readthedocs.io/en/latest/', 'Read the Docs'));
  22. self::assertSame('#VALUE!', LookupRef::OFFSET(null));
  23. self::assertSame(5, LookupRef::ROW('C5'));
  24. self::assertSame([[1, 2], [3, 4]], LookupRef::TRANSPOSE([[1, 3], [2, 4]]));
  25. }
  26. }