ValueToTextTest.php 760 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\TextData;
  3. class ValueToTextTest extends AllSetupTeardown
  4. {
  5. /**
  6. * @dataProvider providerVALUE
  7. *
  8. * @param mixed $expectedResult
  9. * @param mixed $value
  10. * @param mixed $format
  11. */
  12. public function testVALUETOTEXT($expectedResult, $value, $format): void
  13. {
  14. $sheet = $this->getSheet();
  15. $this->setCell('A1', $value);
  16. $sheet->getCell('B1')->setValue("=VALUETOTEXT(A1, {$format})");
  17. $result = $sheet->getCell('B1')->getCalculatedValue();
  18. self::assertSame($expectedResult, $result);
  19. }
  20. public function providerVALUE(): array
  21. {
  22. return require 'tests/data/Calculation/TextData/VALUETOTEXT.php';
  23. }
  24. }