‪TYPO3CMS  ‪main
StringUtilityTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use PHPUnit\Framework\Attributes\DataProvider;
21 use PHPUnit\Framework\Attributes\Test;
24 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
25 
26 final class ‪StringUtilityTest extends UnitTestCase
27 {
31  public static function stringCastableValuesDataProvider(): \Generator
32  {
33  ‪yield 'empty string' => [''];
34  ‪yield 'string' => ['value'];
35  ‪yield 'int' => [1];
36  ‪yield 'float' => [1.2345];
37  ‪yield 'bool' => [true];
38  }
39 
40  #[DataProvider('stringCastableValuesDataProvider')]
41  #[Test]
42  public function ‪castWithStringCastableReturnsValueCastToString(mixed $value): void
43  {
44  $expected = (string)$value;
45 
46  self::assertSame($expected, ‪StringUtility::cast($value, 'default'));
47  }
48 
52  public static function nonStringCastableValuesDataProvider(): \Generator
53  {
54  ‪yield 'array' => [['1']];
55  ‪yield 'null' => [null];
56  ‪yield 'object' => [new \stdClass()];
57  ‪yield 'string backed enum' => [ApplicationType::BACKEND];
58  ‪yield 'closure' => [static fn(): string => 'fn'];
59  // PHP interprets it as `lim(x→0) log(x) = -∞`
60  ‪yield 'infinite' => [log(0)];
61  // acos only supports values in range [-1; +1]
62  ‪yield 'NaN' => [acos(2)];
63  }
64 
65  #[DataProvider('nonStringCastableValuesDataProvider')]
66  #[Test]
67  public function ‪castWithWithNonStringCastableReturnsDefault(mixed $value): void
68  {
69  $default = 'default';
70 
71  self::assertSame($default, ‪StringUtility::cast($value, $default));
72  }
73 
74  #[DataProvider('nonStringCastableValuesDataProvider')]
75  #[Test]
77  {
78  self::assertNull(‪StringUtility::cast($value));
79  }
80 
84  public static function nonStringValueToFilterDataProvider(): \Generator
85  {
86  ‪yield 'int' => [1];
87  ‪yield 'float' => [1.2345];
88  ‪yield 'bool' => [true];
89  ‪yield 'array' => [['1']];
90  ‪yield 'null' => [null];
91  ‪yield 'object' => [new \stdClass()];
92  ‪yield 'string backed enum' => [ApplicationType::BACKEND];
93  ‪yield 'closure' => [static fn(): string => 'fn'];
94  // PHP interprets it as `lim(x→0) log(x) = -∞`
95  ‪yield 'infinite' => [log(0)];
96  // acos only supports values in range [-1; +1]
97  ‪yield 'NaN' => [acos(2)];
98  }
99 
100  #[DataProvider('nonStringValueToFilterDataProvider')]
101  #[Test]
103  {
104  $default = 'default';
105 
106  self::assertSame($default, ‪StringUtility::filter($value, $default));
107  }
108 
109  #[DataProvider('nonStringValueToFilterDataProvider')]
110  #[Test]
112  {
113  self::assertNull(‪StringUtility::filter($value));
114  }
115 
119  public static function stringValueToFilterDataProvider(): \Generator
120  {
121  ‪yield 'empty string' => [''];
122  ‪yield 'non-empty string' => ['value'];
123  }
124  #[DataProvider('stringValueToFilterDataProvider')]
125  #[Test]
126  public function ‪filterForStringValuesReturnsProvidedValue(string $value): void
127  {
128  self::assertSame($value, ‪StringUtility::filter($value, 'some default'));
129  }
130 
131  #[Test]
132  public function ‪getUniqueIdReturnsIdWithPrefix(): void
133  {
134  $id = ‪StringUtility::getUniqueId('NEW');
135  self::assertEquals('NEW', substr($id, 0, 3));
136  }
137 
138  #[Test]
139  public function ‪getUniqueIdReturnsIdWithoutDot(): void
140  {
141  self::assertStringNotContainsString('.', ‪StringUtility::getUniqueId());
142  }
143 
144  #[DataProvider('escapeCssSelectorDataProvider')]
145  #[Test]
146  public function ‪escapeCssSelector(string $selector, string $expectedValue): void
147  {
148  self::assertEquals($expectedValue, ‪StringUtility::escapeCssSelector($selector));
149  }
150 
151  public static function ‪escapeCssSelectorDataProvider(): array
152  {
153  return [
154  ['data.field', 'data\\.field'],
155  ['#theId', '\\#theId'],
156  ['.theId:hover', '\\.theId\\:hover'],
157  ['.theId:hover', '\\.theId\\:hover'],
158  ['input[name=foo]', 'input\\[name\\=foo\\]'],
159  ];
160  }
161 
162  #[DataProvider('removeByteOrderMarkDataProvider')]
163  #[Test]
164  public function ‪removeByteOrderMark(string $input, string $expectedValue): void
165  {
166  // assertContains is necessary as one test contains non-string characters
167  self::assertSame($expectedValue, ‪StringUtility::removeByteOrderMark(hex2bin($input)));
168  }
169 
170  public static function ‪removeByteOrderMarkDataProvider(): array
171  {
172  return [
173  'BOM gets removed' => [
174  'efbbbf424f4d2061742074686520626567696e6e696e6720676574732072656d6f766564',
175  'BOM at the beginning gets removed',
176  ],
177  'No BOM available' => [
178  '4e6f20424f4d20617661696c61626c65',
179  'No BOM available',
180  ],
181  ];
182  }
183 
184  #[DataProvider('searchStringWildcardDataProvider')]
185  #[Test]
186  public function ‪searchStringWildcard(string $haystack, string $needle, bool $result): void
187  {
188  self::assertSame($result, ‪StringUtility::searchStringWildcard($haystack, $needle));
189  }
190 
191  public static function ‪searchStringWildcardDataProvider(): array
192  {
193  return [
194  'Simple wildcard single character with *' => [
195  'TYPO3',
196  'TY*O3',
197  true,
198  ],
199  'Simple wildcard multiple character with *' => [
200  'TYPO3',
201  'T*P*3',
202  true,
203  ],
204  'Simple wildcard multiple character for one placeholder with *' => [
205  'TYPO3',
206  'T*3',
207  true,
208  ],
209  'Simple wildcard single character with ?' => [
210  'TYPO3',
211  'TY?O3',
212  true,
213  ],
214  'Simple wildcard multiple character with ?' => [
215  'TYPO3',
216  'T?P?3',
217  true,
218  ],
219  'Simple wildcard multiple character for one placeholder with ?' => [
220  'TYPO3',
221  'T?3',
222  false,
223  ],
224  'RegExp' => [
225  'TYPO3',
226  '/^TYPO(\d)$/',
227  true,
228  ],
229  ];
230  }
231 
235  public static function ‪uniqueListUnifiesCommaSeparatedListDataProvider(): \Generator
236  {
237  ‪yield 'List without duplicates' => ['one,two,three', 'one,two,three'];
238  ‪yield 'List with two consecutive duplicates' => ['one,two,two,three,three', 'one,two,three'];
239  ‪yield 'List with non-consecutive duplicates' => ['one,two,three,two,three', 'one,two,three'];
240  ‪yield 'One item list' => ['one', 'one'];
241  ‪yield 'Empty list' => ['', ''];
242  ‪yield 'No list, just a comma' => [',', ''];
243  ‪yield 'List with leading comma' => [',one,two', 'one,two'];
244  ‪yield 'List with trailing comma' => ['one,two,', 'one,two'];
245  ‪yield 'List with multiple consecutive commas' => ['one,,two', 'one,two'];
246  }
247 
248  #[DataProvider('uniqueListUnifiesCommaSeparatedListDataProvider')]
249  #[Test]
250  public function ‪uniqueListUnifiesCommaSeparatedList(string $initialList, string $unifiedList): void
251  {
252  self::assertSame($unifiedList, ‪StringUtility::uniqueList($initialList));
253  }
254 
259  {
260  ‪yield 'Pad right to 10 with string with uneven length' => ['ABC', 10, ' ', STR_PAD_RIGHT];
261  ‪yield 'Pad left to 10 with string with uneven length' => ['ABC', 10, ' ', STR_PAD_LEFT];
262  ‪yield 'Pad both to 10 with string with uneven length' => ['ABC', 10, ' ', STR_PAD_BOTH];
263  ‪yield 'Pad right to 10 with string with uneven length and 2 character padding' => ['ABC', 10, '12', STR_PAD_RIGHT];
264  ‪yield 'Pad left to 10 with string with uneven length and 2 character padding' => ['ABC', 10, '12', STR_PAD_LEFT];
265  ‪yield 'Pad both to 10 with string with uneven length and 2 character padding' => ['ABC', 10, '12', STR_PAD_BOTH];
266 
267  ‪yield 'Pad right to 10 with string with even length' => ['AB', 10, ' ', STR_PAD_RIGHT];
268  ‪yield 'Pad left to 10 with string with even length' => ['AB', 10, ' ', STR_PAD_LEFT];
269  ‪yield 'Pad both to 10 with string with even length' => ['AB', 10, ' ', STR_PAD_BOTH];
270  ‪yield 'Pad right to 10 with string with even length and 2 character padding' => ['AB', 10, '12', STR_PAD_RIGHT];
271  ‪yield 'Pad left to 10 with string with even length and 2 character padding' => ['AB', 10, '12', STR_PAD_LEFT];
272  ‪yield 'Pad both to 10 with string with even length and 2 character padding' => ['AB', 10, '12', STR_PAD_BOTH];
273  }
274 
279  #[DataProvider('multibyteStringPadReturnsSameValueAsStrPadForAsciiStringsDataProvider')]
280  #[Test]
281  public function ‪multibyteStringPadReturnsSameValueAsStrPadForAsciiStrings(string $string, int $length, string $pad_string, int $pad_type): void
282  {
283  self::assertEquals(
284  str_pad($string, $length, $pad_string, $pad_type),
285  ‪StringUtility::multibyteStringPad($string, $length, $pad_string, $pad_type)
286  );
287  }
288 
290  {
291  ‪yield 'Pad right to 8 with string with uneven length' => ['häh ', 'häh', 8, ' ', STR_PAD_RIGHT];
292  ‪yield 'Pad left to 8 with string with uneven length' => [' häh', 'häh', 8, ' ', STR_PAD_LEFT];
293  ‪yield 'Pad both to 8 with string with uneven length' => [' häh ', 'häh', 8, ' ', STR_PAD_BOTH];
294  ‪yield 'Pad right to 8 with string with uneven length and 2 character padding' => ['hühäöäöä', 'hüh', 8, 'äö', STR_PAD_RIGHT];
295  ‪yield 'Pad left to 8 with string with uneven length and 2 character padding' => ['äöäöähüh', 'hüh', 8, 'äö', STR_PAD_LEFT];
296  ‪yield 'Pad both to 8 with string with uneven length and 2 character padding' => ['äöhühäöä', 'hüh', 8, 'äö', STR_PAD_BOTH];
297 
298  ‪yield 'Pad right to 8 with string with even length' => ['hä ', 'hä', 8, ' ', STR_PAD_RIGHT];
299  ‪yield 'Pad left to 8 with string with even length' => [' hä', 'hä', 8, ' ', STR_PAD_LEFT];
300  ‪yield 'Pad both to 8 with string with even length' => [' hä ', 'hä', 8, ' ', STR_PAD_BOTH];
301  ‪yield 'Pad right to 8 with string with even length and 2 character padding with MB char' => ['hüäöäöäö', 'hü', 8, 'äö', STR_PAD_RIGHT];
302  ‪yield 'Pad left to 8 with string with even length and 2 character padding with MB char' => ['äöäöäöhü', 'hü', 8, 'äö', STR_PAD_LEFT];
303  ‪yield 'Pad both to 8 with string with even length and 2 character padding with MB char' => ['äöähüäöä', 'hü', 8, 'äö', STR_PAD_BOTH];
304  }
305 
306  #[DataProvider('multibyteStringPadReturnsCorrectResultsMultibyteDataProvider')]
307  #[Test]
308  public function ‪multibyteStringPadReturnsCorrectResultsMultibyte(string $expectedResult, string $string, int $length, string $pad_string, int $pad_type): void
309  {
310  self::assertEquals(
311  $expectedResult,
312  ‪StringUtility::multibyteStringPad($string, $length, $pad_string, $pad_type)
313  );
314  }
315 
316  public static function ‪base64urlRoundTripWorksDataProvider(): \Generator
317  {
318  ‪yield ['a'];
319  ‪yield ['aa'];
320  ‪yield ['aaa'];
321  ‪yield ['aaaa'];
322  ‪yield [random_bytes(31)];
323  ‪yield [random_bytes(32)];
324  ‪yield [random_bytes(33)];
325  }
326 
327  #[DataProvider('base64urlRoundTripWorksDataProvider')]
328  #[Test]
329  public function ‪base64urlRoundTripWorks(string $rawValue): void
330  {
331  $encoded = ‪StringUtility::base64urlEncode($rawValue);
332  $decoded = ‪StringUtility::base64urlDecode($encoded);
333  self::assertSame($rawValue, $decoded);
334  }
335 
336  public static function ‪base64urlDataProvider(): \Generator
337  {
338  ‪yield ['', ''];
339  ‪yield ['a', 'YQ'];
340  ‪yield ['aa', 'YWE'];
341  ‪yield ['aa>', 'YWE-'];
342  ‪yield ['aa?', 'YWE_'];
343  ‪yield ['aaa', 'YWFh'];
344  ‪yield ['aaaa', 'YWFhYQ'];
345  }
346 
347  #[DataProvider('base64urlDataProvider')]
348  #[Test]
349  public function ‪base64urlEncodeWorks(string $rawValue, string $encodedValue): void
350  {
351  self::assertSame($encodedValue, ‪StringUtility::base64urlEncode($rawValue));
352  }
353 
354  #[DataProvider('base64urlDataProvider')]
355  #[Test]
356  public function ‪base64urlDecodeWorks(string $rawValue, string $encodedValue): void
357  {
358  self::assertSame($rawValue, ‪StringUtility::base64urlDecode($encodedValue));
359  }
360 
361  public static function ‪base64urlStrictDataProvider(): \Generator
362  {
363  ‪yield ['', ''];
364  ‪yield ['YQ', 'a'];
365  ‪yield ['YWE', 'aa'];
366  ‪yield ['YWE-', 'aa>'];
367  ‪yield ['YWE_', 'aa?'];
368  ‪yield ['YWFh', 'aaa'];
369  ‪yield ['YWFhYQ', 'aaaa'];
370  ‪yield ['YWFhYQ!', false];
371  ‪yield ['Y!W!E', false];
372  // `Y W E` is interesting - plain `base64_decode` strips inner spaces
373  ‪yield ['Y W E', 'aa'];
374  ‪yield ["Y\nW\nE", 'aa'];
375  ‪yield ["Y\tW\tE", 'aa'];
376  }
377 
378  #[DataProvider('base64urlStrictDataProvider')]
379  #[Test]
380  public function ‪base64urlStrictDecodeWorks(string $encodedValue, string|bool $expectation): void
381  {
382  self::assertSame($expectation, ‪StringUtility::base64urlDecode($encodedValue, true));
383  }
384 
385  public static function ‪explodeEscapedDataProvider(): array
386  {
387  return [
388  'no escape' => [
389  'test.test',
390  [
391  'test',
392  'test',
393  ],
394  ],
395  'escaped once' => [
396  'test\.test.abc',
397  [
398  'test.test',
399  'abc',
400  ],
401  ],
402  'escaped twice' => [
403  'test\.test.abc\.another',
404  [
405  'test.test',
406  'abc.another',
407  ],
408  ],
409  'escaped three times at the begining of the key' => [
410  'test\.test.\.abc\.another',
411  [
412  'test.test',
413  '.abc.another',
414  ],
415  ],
416  'escape the escape char' => [
417  'test\\\.test.abc',
418  [
419  'test\.test',
420  'abc',
421  ],
422  ],
423  ];
424  }
425 
426  #[DataProvider('explodeEscapedDataProvider')]
427  #[Test]
428  public function ‪explodeEscapedWorks(string $escaped, array $unescapedExploded): void
429  {
430  self::assertSame($unescapedExploded, ‪StringUtility::explodeEscaped('.', $escaped));
431  }
432 }
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\base64urlStrictDecodeWorks
‪base64urlStrictDecodeWorks(string $encodedValue, string|bool $expectation)
Definition: StringUtilityTest.php:380
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\base64urlRoundTripWorks
‪base64urlRoundTripWorks(string $rawValue)
Definition: StringUtilityTest.php:329
‪TYPO3\CMS\Core\Utility\StringUtility\base64urlEncode
‪static string base64urlEncode(string $value)
Definition: StringUtility.php:176
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\castWithWithNonStringCastableReturnsDefault
‪castWithWithNonStringCastableReturnsDefault(mixed $value)
Definition: StringUtilityTest.php:67
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\escapeCssSelector
‪escapeCssSelector(string $selector, string $expectedValue)
Definition: StringUtilityTest.php:146
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\searchStringWildcard
‪searchStringWildcard(string $haystack, string $needle, bool $result)
Definition: StringUtilityTest.php:186
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\escapeCssSelectorDataProvider
‪static escapeCssSelectorDataProvider()
Definition: StringUtilityTest.php:151
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\removeByteOrderMarkDataProvider
‪static removeByteOrderMarkDataProvider()
Definition: StringUtilityTest.php:170
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\yield
‪yield
Definition: StringUtilityTest.php:34
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\multibyteStringPadReturnsCorrectResultsMultibyteDataProvider
‪static multibyteStringPadReturnsCorrectResultsMultibyteDataProvider()
Definition: StringUtilityTest.php:289
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\getUniqueIdReturnsIdWithPrefix
‪getUniqueIdReturnsIdWithPrefix()
Definition: StringUtilityTest.php:132
‪TYPO3\CMS\Core\Tests\Unit\Utility
‪TYPO3\CMS\Core\Utility\StringUtility\searchStringWildcard
‪static bool searchStringWildcard(string $haystack, string $needle)
Definition: StringUtility.php:95
‪TYPO3\CMS\Core\Utility\StringUtility\uniqueList
‪static string uniqueList(string $list)
Definition: StringUtility.php:122
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\removeByteOrderMark
‪removeByteOrderMark(string $input, string $expectedValue)
Definition: StringUtilityTest.php:164
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\filterForNonStringValueAndNoDefaultProvidedReturnsNull
‪filterForNonStringValueAndNoDefaultProvidedReturnsNull(mixed $value)
Definition: StringUtilityTest.php:111
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\explodeEscapedWorks
‪explodeEscapedWorks(string $escaped, array $unescapedExploded)
Definition: StringUtilityTest.php:428
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\searchStringWildcardDataProvider
‪static searchStringWildcardDataProvider()
Definition: StringUtilityTest.php:191
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\castWithWithNonStringCastableAndNoDefaultProvidedReturnsNull
‪castWithWithNonStringCastableAndNoDefaultProvidedReturnsNull(mixed $value)
Definition: StringUtilityTest.php:76
‪TYPO3\CMS\Core\Utility\StringUtility\removeByteOrderMark
‪static removeByteOrderMark(string $input)
Definition: StringUtility.php:79
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\base64urlRoundTripWorksDataProvider
‪static base64urlRoundTripWorksDataProvider()
Definition: StringUtilityTest.php:316
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\filterForStringValuesReturnsProvidedValue
‪filterForStringValuesReturnsProvidedValue(string $value)
Definition: StringUtilityTest.php:126
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest
Definition: StringUtilityTest.php:27
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\filterForNonStringValueAndDefaultProvidedReturnsDefault
‪filterForNonStringValueAndDefaultProvidedReturnsDefault(mixed $value)
Definition: StringUtilityTest.php:102
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\multibyteStringPadReturnsCorrectResultsMultibyte
‪multibyteStringPadReturnsCorrectResultsMultibyte(string $expectedResult, string $string, int $length, string $pad_string, int $pad_type)
Definition: StringUtilityTest.php:308
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\castWithStringCastableReturnsValueCastToString
‪castWithStringCastableReturnsValueCastToString(mixed $value)
Definition: StringUtilityTest.php:42
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\base64urlStrictDataProvider
‪static base64urlStrictDataProvider()
Definition: StringUtilityTest.php:361
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\uniqueListUnifiesCommaSeparatedListDataProvider
‪static uniqueListUnifiesCommaSeparatedListDataProvider()
Definition: StringUtilityTest.php:235
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\base64urlEncodeWorks
‪base64urlEncodeWorks(string $rawValue, string $encodedValue)
Definition: StringUtilityTest.php:349
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\explodeEscapedDataProvider
‪static explodeEscapedDataProvider()
Definition: StringUtilityTest.php:385
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\getUniqueIdReturnsIdWithoutDot
‪getUniqueIdReturnsIdWithoutDot()
Definition: StringUtilityTest.php:139
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\multibyteStringPadReturnsSameValueAsStrPadForAsciiStrings
‪multibyteStringPadReturnsSameValueAsStrPadForAsciiStrings(string $string, int $length, string $pad_string, int $pad_type)
Definition: StringUtilityTest.php:281
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\uniqueListUnifiesCommaSeparatedList
‪uniqueListUnifiesCommaSeparatedList(string $initialList, string $unifiedList)
Definition: StringUtilityTest.php:250
‪TYPO3\CMS\Core\Utility\StringUtility\escapeCssSelector
‪static escapeCssSelector(string $selector)
Definition: StringUtility.php:69
‪TYPO3\CMS\Core\Utility\StringUtility\cast
‪static cast(mixed $value, ?string $default=null)
Definition: StringUtility.php:30
‪TYPO3\CMS\Core\Utility\StringUtility\multibyteStringPad
‪static multibyteStringPad(string $string, int $length, string $pad_string=' ', int $pad_type=STR_PAD_RIGHT, string $encoding='UTF-8')
Definition: StringUtility.php:131
‪TYPO3\CMS\Core\Utility\StringUtility\explodeEscaped
‪static explodeEscaped(string $delimiter, string $subject, string $escapeCharacter='\\')
Definition: StringUtility.php:209
‪TYPO3\CMS\Core\Utility\StringUtility
Definition: StringUtility.php:24
‪TYPO3\CMS\Core\Utility\StringUtility\filter
‪static filter(mixed $value, ?string $default=null)
Definition: StringUtility.php:48
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\multibyteStringPadReturnsSameValueAsStrPadForAsciiStringsDataProvider
‪static multibyteStringPadReturnsSameValueAsStrPadForAsciiStringsDataProvider()
Definition: StringUtilityTest.php:258
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\base64urlDecodeWorks
‪base64urlDecodeWorks(string $rawValue, string $encodedValue)
Definition: StringUtilityTest.php:356
‪TYPO3\CMS\Core\Utility\StringUtility\base64urlDecode
‪static string false base64urlDecode(string $value, bool $strict=false)
Definition: StringUtility.php:195
‪TYPO3\CMS\Core\Utility\StringUtility\getUniqueId
‪static getUniqueId(string $prefix='')
Definition: StringUtility.php:57
‪TYPO3\CMS\Core\Http\ApplicationType
‪ApplicationType
Definition: ApplicationType.php:55
‪TYPO3\CMS\Core\Tests\Unit\Utility\StringUtilityTest\base64urlDataProvider
‪static base64urlDataProvider()
Definition: StringUtilityTest.php:336