PhpSpreadsheet/tests/data/Calculation/TextData/SUBSTITUTE.php

117 lines
2.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
return [
[
'QWDFGYUIOP',
'QWERTYUIOP',
'ERT',
'DFG',
],
[
'Mxrk Bxker',
'Mark Baker',
'a',
'x',
],
[
'Mxrk Baker',
'Mark Baker',
'a',
'x',
1,
],
[
'Mark Bxker',
'Mark Baker',
'a',
'x',
2,
],
[
'Mark Bakker',
'Mark Baker',
'k',
'kk',
2,
],
[
'Mark Baker',
'Mark Baker',
'x',
'a',
1,
],
[
'Ενα δύο αρία αέσσερα πέναε',
'Ενα δύο τρία τέσσερα πέντε',
'τ',
'α',
],
[
'Ενα δύο τρία αέσσερα πέντε',
'Ενα δύο τρία τέσσερα πέντε',
'τ',
'α',
2,
],
[
'Ενα δύο τρία ατέσσερα πέντε',
'Ενα δύο τρία τέσσερα πέντε',
'τ',
'ατ',
2,
],
'Unicode equivalence is not supported' => [
"\u{0061}\u{030A}",
"\u{0061}\u{030A}",
"\u{00E5}",
'x',
],
'Multibytes are supported' => [
'x',
"\u{00E5}",
"\u{00E5}",
'x',
],
'no arguments' => ['exception'],
'one argument' => ['exception', 'a'],
'two arguments' => ['exception', 'a', 'b'],
'negative instance' => ['#VALUE!', 'abcdefg', 'def', 123, -1],
'non-numeric instance' => ['#VALUE!', 'abcdefg', 'def', 123, 'xyz'],
'null instance' => ['abc123g', 'abcdefg', 'def', 123],
'0 instance' => ['#VALUE!', 'abcdefg', 'def', 123, 0],
'1 instance' => ['abc123g', 'abcdefg', 'def', 123, 1],
'past last instance' => ['abcdefg', 'abcdefg', 'def', 123, 2],
'bool false instance' => ['#VALUE!', 'abcdefg', 'def', '123', false],
'bool true instance' => ['#VALUE!', 'abcdefg', 'def', '123', true],
'bool text' => ['FA-SE', false, 'L', '-'],
'propagate REF' => ['#REF!', '=sheet99!A1', 'A', 'x'],
'propagate DIV0' => ['#DIV/0!', 'hello', '=1/0', 1, 'x'],
'string which just sneaks in' => [
str_repeat('A', 32766) . 'C',
str_repeat('A', 32766) . 'B',
'B',
'C',
],
'string which overflows' => [
'#VALUE!',
str_repeat('A', 32766) . 'B',
'B',
'CC',
],
'okay long string instance' => [
'AAAAB' . str_repeat('A', 32762),
str_repeat('A', 32767),
'A',
'B',
5,
],
'overflow long string instance' => [
'#VALUE!',
str_repeat('A', 32767),
'A',
'BB',
5,
],
];