‪TYPO3CMS  ‪main
NormalizeCommandTest.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 ‪NormalizeCommandTest extends UnitTestCase
27 {
28  public static function ‪normalizeValidDataProvider(): array
29  {
30  return [
31  '@weekly' => ['@weekly', '0 0 * * 7'],
32  ' @weekly ' => [' @weekly ', '0 0 * * 7'],
33  '* * * * *' => ['* * * * *', '* * * * *'],
34  '30 4 1,15 * 5' => ['30 4 1,15 * 5', '30 4 1,15 * 5'],
35  '5 0 * * *' => ['5 0 * * *', '5 0 * * *'],
36  '15 14 1 * *' => ['15 14 1 * *', '15 14 1 * *'],
37  '0 22 * * 1-5' => ['0 22 * * 1-5', '0 22 * * 1,2,3,4,5'],
38  '23 0-23/2 * * *' => ['23 0-23/2 * * *', '23 0,2,4,6,8,10,12,14,16,18,20,22 * * *'],
39  '5 4 * * sun' => ['5 4 * * sun', '5 4 * * 7'],
40  '0-3/2,7 0,4 20-22, feb,mar-jun/2,7 1-3,sun' => [
41  '0-3/2,7 0,4 20-22 feb,mar-jun/2,7 1-3,sun',
42  '0,2,7 0,4 20,21,22 2,3,5,7 1,2,3,7',
43  ],
44  '0-20/10 * * * *' => ['0-20/10 * * * *', '0,10,20 * * * *'],
45  '* * 2 * *' => ['* * 2 * *', '* * 2 * *'],
46  '* * 2,7 * *' => ['* * 2,7 * *', '* * 2,7 * *'],
47  '* * 2-4,10 * *' => ['* * 2-4,10 * *', '* * 2,3,4,10 * *'],
48  '* * */14 * *' => ['* * */14 * *', '* * 1,15,29 * *'],
49  '* * 2,4-6/2,*/14 * *' => ['* * 2,4-6/2,*/14 * *', '* * 1,2,4,6,15,29 * *'],
50  '* * * * 1' => ['* * * * 1', '* * * * 1'],
51  '0 0 * * 0' => ['0 0 * * 0', '0 0 * * 7'],
52  '0 0 * * 7' => ['0 0 * * 7', '0 0 * * 7'],
53  '* * 1,2 * 1' => ['* * 1,2 * 1', '* * 1,2 * 1'],
54  '15 02 * * *' => ['15 02 * * *', '15 2 * * *'],
55  '08 02 * * *' => ['08 02 * * *', '8 2 * * *'],
56  '15 00 * * *' => ['15 00 * * *', '15 0 * * *'],
57  ];
58  }
59 
64  #[DataProvider('normalizeValidDataProvider')]
65  #[Test]
66  public function ‪normalizeConvertsCronCommand(string $expression, string $expected): void
67  {
68  $result = ‪NormalizeCommand::normalize($expression);
69  self::assertEquals($expected, $result);
70  }
71 
72  public static function ‪validSpecialKeywordsDataProvider(): array
73  {
74  return [
75  '@yearly' => ['@yearly', '0 0 1 1 *'],
76  '@annually' => ['@annually', '0 0 1 1 *'],
77  '@monthly' => ['@monthly', '0 0 1 * *'],
78  '@weekly' => ['@weekly', '0 0 * * 0'],
79  '@daily' => ['@daily', '0 0 * * *'],
80  '@midnight' => ['@midnight', '0 0 * * *'],
81  '@hourly' => ['@hourly', '0 * * * *'],
82  ];
83  }
84 
89  #[DataProvider('validSpecialKeywordsDataProvider')]
90  #[Test]
91  public function ‪convertKeywordsToCronCommandConvertsValidKeywords(string $keyword, string $expectedCronCommand): void
92  {
94  self::assertEquals($expectedCronCommand, $result);
95  }
96 
97  #[Test]
99  {
100  $invalidKeyword = 'foo';
102  self::assertEquals($invalidKeyword, $result);
103  }
104 
105  public static function ‪normalizeFieldsValidDataProvider(): array
106  {
107  return [
108  '1-2 * * * *' => ['1-2 * * * *', '1,2 * * * *'],
109  '* 1-2 * * *' => ['* 1-2 * * *', '* 1,2 * * *'],
110  '* * 1-2 * *' => ['* * 1-2 * *', '* * 1,2 * *'],
111  '* * * 1-2 *' => ['* * * 1-2 *', '* * * 1,2 *'],
112  '* * * * 1-2' => ['* * * * 1-2', '* * * * 1,2'],
113  ];
114  }
115 
120  #[DataProvider('normalizeFieldsValidDataProvider')]
121  #[Test]
122  public function ‪normalizeFieldsConvertsField(string $expression, string $expected): void
123  {
125  self::assertEquals($expected, $result);
126  }
127 
129  {
130  return [
131  '* monthField' => ['*', true, '*'],
132  'string 1 monthField' => ['1', true, '1'],
133  'jan' => ['jan', true, '1'],
134  'feb/2' => ['feb/2', true, '2'],
135  'jan-feb/2' => ['jan-feb/2', true, '1'],
136  '1-2 monthField' => ['1-2', true, '1,2'],
137  '1-3/2,feb,may,6' => ['1-3/2,feb,may,6', true, '1,2,3,5,6'],
138  '*/4' => ['*/4', true, '1,5,9'],
139  '* !monthField' => ['*', false, '*'],
140  'string 1, !monthField' => ['1', false, '1'],
141  'fri' => ['fri', false, '5'],
142  'sun' => ['sun', false, '7'],
143  'string 0 for sunday' => ['0', false, '7'],
144  '0,1' => ['0,1', false, '1,7'],
145  '*/3' => ['*/3', false, '1,4,7'],
146  'tue/2' => ['tue/2', false, '2'],
147  '1-2 !monthField' => ['1-2', false, '1,2'],
148  'tue-fri/2' => ['tue-fri/2', false, '2,4'],
149  '1-3/2,tue,fri,6' => ['1-3/2,tue,fri,6', false, '1,2,3,5,6'],
150  ];
151  }
152 
158  #[DataProvider('normalizeMonthAndWeekdayFieldValidDataProvider')]
159  #[Test]
161  string $expression,
162  bool $isMonthField,
163  string $expected
164  ): void {
165  $result = ‪NormalizeCommandAccessibleProxy::normalizeMonthAndWeekdayField($expression, $isMonthField);
166  self::assertSame($expected, $result);
167  }
168 
170  {
171  return [
172  'mon' => ['mon', true, 1291083486],
173  '1-2/mon' => ['1-2/mon', true, 1291414957],
174  '0,1' => ['0,1', true, 1291083486],
175  'feb' => ['feb', false, 1291163589],
176  '1-2/feb' => ['1-2/feb', false, 1291414957],
177  '0-fri/2,7' => ['0-fri/2,7', false, 1291237145],
178  ];
179  }
180 
186  #[DataProvider('normalizeMonthAndWeekdayFieldInvalidDataProvider')]
187  #[Test]
189  string $expression,
190  bool $isMonthField,
191  int $expectedExceptionCode
192  ): void {
193  $this->expectException(\InvalidArgumentException::class);
194  $this->expectExceptionCode($expectedExceptionCode);
196  }
197 
198  public static function ‪normalizeIntegerFieldValidDataProvider(): array
199  {
200  return [
201  '*' => ['*', '*'],
202  'string 2' => ['2', '2'],
203  'integer 3' => [3, '3'],
204  'list of values' => ['1,2,3', '1,2,3'],
205  'unsorted list of values' => ['3,1,5', '1,3,5'],
206  'duplicate values' => ['0-2/2,2', '0,2'],
207  'additional field between steps' => ['1-3/2,2', '1,2,3'],
208  '2-4' => ['2-4', '2,3,4'],
209  'simple step 4/4' => ['4/4', '4'],
210  'step 2-7/5' => ['2-7/5', '2,7'],
211  'steps 4-12/4' => ['4-12/4', '4,8,12'],
212  '0-59/20' => ['0-59/20', '0,20,40'],
213  '*/20' => ['*/20', '0,20,40'],
214  ];
215  }
216 
221  #[DataProvider('normalizeIntegerFieldValidDataProvider')]
222  #[Test]
223  public function ‪normalizeIntegerFieldReturnsNormalizedListForValidExpression($expression, string $expected): void
224  {
226  self::assertSame($expected, $result);
227  }
228 
229  public static function ‪normalizeIntegerFieldInvalidDataProvider(): array
230  {
231  return [
232  'string foo' => ['foo', 0, 59, 1291429389],
233  'empty string' => ['', 0, 59, 1291429389],
234  '4-3' => ['4-3', 0, 59, 1291237145],
235  '/2' => ['/2', 0, 59, 1291234985],
236  '/' => ['/', 0, 59, 1291234985],
237  'left bound too low' => ['2-4', 3, 4, 1291470084],
238  'right bound too high' => ['2-4', 2, 3, 1291470170],
239  'left and right bound' => ['2-5', 2, 4, 1291470170],
240  'element in list is lower than allowed' => ['2,1,4', 2, 4, 1291470084],
241  'element in list is higher than allowed' => ['2,5,4', 1, 4, 1291470170],
242  ];
243  }
244 
251  #[DataProvider('normalizeIntegerFieldInvalidDataProvider')]
252  #[Test]
254  string $expression,
255  int $lowerBound,
256  int $upperBound,
257  int $expectedExceptionCode
258  ): void {
259  $this->expectException(\InvalidArgumentException::class);
260  $this->expectExceptionCode($expectedExceptionCode);
261 
262  ‪NormalizeCommandAccessibleProxy::normalizeIntegerField($expression, $lowerBound, $upperBound);
263  }
264 
265  #[Test]
267  {
268  $result = ‪NormalizeCommandAccessibleProxy::splitFields('12,13 * 1-12/2,14 jan fri');
269  $expectedResult = [
270  0 => '12,13',
271  1 => '*',
272  2 => '1-12/2,14',
273  3 => 'jan',
274  4 => 'fri',
275  ];
276  self::assertSame($expectedResult, $result);
277  }
278 
279  public static function ‪invalidCronCommandFieldsDataProvider(): array
280  {
281  return [
282  'empty string' => [''],
283  'foo' => ['foo'],
284  'integer 4' => [4],
285  'four fields' => ['* * * *'],
286  'six fields' => ['* * * * * *'],
287  ];
288  }
289 
293  #[DataProvider('invalidCronCommandFieldsDataProvider')]
294  #[Test]
296  {
297  $this->expectException(\InvalidArgumentException::class);
298  $this->expectExceptionCode(1291227373);
300  }
301 
302  public static function ‪validRangeDataProvider(): array
303  {
304  return [
305  'single value' => ['3', '3'],
306  'integer 3' => [3, '3'],
307  '0-0' => ['0-0', '0'],
308  '4-4' => ['4-4', '4'],
309  '0-3' => ['0-3', '0,1,2,3'],
310  '4-5' => ['4-5', '4,5'],
311  ];
312  }
313 
318  #[DataProvider('validRangeDataProvider')]
319  #[Test]
320  public function ‪convertRangeToListOfValuesReturnsCorrectListForValidRanges($range, string $expected): void
321  {
323  self::assertSame($expected, $result);
324  }
325 
326  public static function ‪invalidRangeDataProvider(): array
327  {
328  return [
329  'empty string' => ['', 1291234985],
330  'string' => ['foo', 1291237668],
331  'single dash' => ['-', 1291237668],
332  'left part is string' => ['foo-5', 1291237668],
333  'right part is string' => ['5-foo', 1291237668],
334  'range of strings' => ['foo-bar', 1291237668],
335  'string five minus' => ['5-', 1291237668],
336  'string minus five' => ['-5', 1291237668],
337  'more than one dash' => ['2-3-4', 1291234986],
338  'left part bigger than right part' => ['6-3', 1291237145],
339  ];
340  }
341 
346  #[DataProvider('invalidRangeDataProvider')]
347  #[Test]
348  public function ‪convertRangeToListOfValuesThrowsExceptionForInvalidRanges(string $range, int $expectedExceptionCode): void
349  {
350  $this->expectException(\InvalidArgumentException::class);
351  $this->expectExceptionCode($expectedExceptionCode);
353  }
354 
355  public static function ‪validStepsDataProvider(): array
356  {
357  return [
358  '2/2' => ['2/2', '2'],
359  '2,3,4/2' => ['2,3,4/2', '2,4'],
360  '1,2,3,4,5,6,7/3' => ['1,2,3,4,5,6,7/3', '1,4,7'],
361  '0,1,2,3,4,5,6/3' => ['0,1,2,3,4,5,6/3', '0,3,6'],
362  ];
363  }
364 
369  #[DataProvider('validStepsDataProvider')]
370  #[Test]
371  public function ‪reduceListOfValuesByStepValueReturnsCorrectListOfValues(string $stepExpression, string $expected): void
372  {
374  self::assertSame($expected, $result);
375  }
376 
377  public static function ‪invalidStepsDataProvider(): array
378  {
379  return [
380  'empty string' => ['', 1291234987],
381  'slash only' => ['/', 1291414955],
382  'left part empty' => ['/2', 1291414955],
383  'right part empty' => ['2/', 1291414956],
384  'multiples slashes' => ['1/2/3', 1291242168],
385  '2-2' => ['2-2', 1291414956],
386  '2.3/2' => ['2.3/2', 1291414958],
387  '2,3,4/2.3' => ['2,3,4/2.3', 1291414957],
388  '2,3,4/2,3' => ['2,3,4/2,3', 1291414957],
389  ];
390  }
391 
396  #[DataProvider('invalidStepsDataProvider')]
397  #[Test]
399  string $stepExpression,
400  int $expectedExceptionCode
401  ): void {
402  $this->expectException(\InvalidArgumentException::class);
403  $this->expectExceptionCode($expectedExceptionCode);
404 
406  }
407 
408  #[Test]
410  {
412  self::assertSame('2', $result);
413  }
414 
415  #[Test]
417  {
419  self::assertSame('5', $result);
420  }
421 
422  #[Test]
424  {
426  self::assertSame('2', $result);
427  }
428 
429  public static function ‪validMonthNamesDataProvider(): array
430  {
431  return [
432  'jan' => ['jan', 1],
433  'feb' => ['feb', 2],
434  'MaR' => ['MaR', 3],
435  'aPr' => ['aPr', 4],
436  'MAY' => ['MAY', 5],
437  'jun' => ['jun', 6],
438  'jul' => ['jul', 7],
439  'aug' => ['aug', 8],
440  'sep' => ['sep', 9],
441  'oct' => ['oct', 10],
442  'nov' => ['nov', 11],
443  'dec' => ['dec', 12],
444  'string 7' => ['7', 7],
445  'integer 7' => [7, 7],
446  'string 07' => ['07', 7],
447  'integer 07' => [7, 7],
448  ];
449  }
450 
455  #[DataProvider('validMonthNamesDataProvider')]
456  #[Test]
457  public function ‪normalizeMonthConvertsName($monthName, int $expectedInteger): void
458  {
460  self::assertEquals($expectedInteger, $result);
461  }
462 
466  #[DataProvider('validMonthNamesDataProvider')]
467  #[Test]
468  public function ‪normalizeMonthReturnsInteger($monthName): void
469  {
471  self::assertIsInt($result);
472  }
473 
474  public static function ‪invalidMonthNamesDataProvider(): array
475  {
476  return [
477  'sep-' => ['sep-', 1291083486],
478  '-September-' => ['-September-', 1291083486],
479  ',sep' => [',sep', 1291083486],
480  ',September,' => [',September,', 1291083486],
481  'sep/' => ['sep/', 1291083486],
482  '/sep' => ['/sep', 1291083486],
483  '/September/' => ['/September/', 1291083486],
484  'foo' => ['foo', 1291083486],
485  'Tuesday' => ['Tuesday', 1291083486],
486  'Tue' => ['Tue', 1291083486],
487  'string 0' => ['0', 1291083486],
488  'integer 0' => [0, 1291083486],
489  'string seven' => ['seven', 1291083486],
490  'string 13' => ['13', 1291083486],
491  'integer 13' => [13, 1291083486],
492  'integer 99' => [99, 1291083486],
493  'integer 2010' => [2010, 1291083486],
494  'string minus 7' => ['-7', 1291083486],
495  'negative integer 7' => [-7, 1291083486],
496  ];
497  }
498 
503  #[DataProvider('invalidMonthNamesDataProvider')]
504  #[Test]
506  $invalidMonthName,
507  int $expectedExceptionCode
508  ): void {
509  $this->expectException(\InvalidArgumentException::class);
510  $this->expectExceptionCode($expectedExceptionCode);
511 
513  }
514 
515  public static function ‪validWeekdayDataProvider(): array
516  {
517  return [
518  'string 1' => ['1', 1],
519  'string 2' => ['2', 2],
520  'string 02' => ['02', 2],
521  'integer 02' => [2, 2],
522  'string 3' => ['3', 3],
523  'string 4' => ['4', 4],
524  'string 5' => ['5', 5],
525  'integer 5' => [5, 5],
526  'string 6' => ['6', 6],
527  'string 7' => ['7', 7],
528  'string 0' => ['0', 7],
529  'integer 0' => [0, 7],
530  'mon' => ['mon', 1],
531  'monday' => ['monday', 1],
532  'tue' => ['tue', 2],
533  'tuesday' => ['tuesday', 2],
534  'WED' => ['WED', 3],
535  'WEDnesday' => ['WEDnesday', 3],
536  'tHu' => ['tHu', 4],
537  'Thursday' => ['Thursday', 4],
538  'fri' => ['fri', 5],
539  'friday' => ['friday', 5],
540  'sat' => ['sat', 6],
541  'saturday' => ['saturday', 6],
542  'sun' => ['sun', 7],
543  'sunday' => ['sunday', 7],
544  ];
545  }
546 
551  #[DataProvider('validWeekdayDataProvider')]
552  #[Test]
553  public function ‪normalizeWeekdayConvertsName($weekday, int $expectedInteger): void
554  {
556  self::assertEquals($expectedInteger, $result);
557  }
558 
562  #[DataProvider('validWeekdayDataProvider')]
563  #[Test]
564  public function ‪normalizeWeekdayReturnsInteger($weekday): void
565  {
567  self::assertIsInt($result);
568  }
569 
570  public static function ‪invalidWeekdayDataProvider(): array
571  {
572  return [
573  '-fri' => ['-fri'],
574  'fri-' => ['fri-'],
575  '-friday-' => ['-friday-'],
576  '/fri' => ['/fri'],
577  'fri/' => ['fri/'],
578  '/friday/' => ['/friday/'],
579  ',fri' => [',fri'],
580  ',friday,' => [',friday,'],
581  'string minus 1' => ['-1'],
582  'integer -1' => [-1],
583  'string seven' => ['seven'],
584  'string 8' => ['8'],
585  'string 29' => ['29'],
586  'string 2010' => ['2010'],
587  'Jan' => ['Jan'],
588  'January' => ['January'],
589  'MARCH' => ['MARCH'],
590  ];
591  }
592 
596  #[DataProvider('invalidWeekdayDataProvider')]
597  #[Test]
599  {
600  $this->expectException(\InvalidArgumentException::class);
601  $this->expectExceptionCode(1291163589);
602 
604  }
605 }
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeMonthThrowsExceptionForInvalidMonthRepresentation
‪normalizeMonthThrowsExceptionForInvalidMonthRepresentation( $invalidMonthName, int $expectedExceptionCode)
Definition: NormalizeCommandTest.php:505
‪TYPO3\CMS\Scheduler\CronCommand\NormalizeCommand\normalize
‪static string normalize($cronCommand)
Definition: NormalizeCommand.php:40
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeIntegerFieldReturnsNormalizedListForValidExpression
‪normalizeIntegerFieldReturnsNormalizedListForValidExpression($expression, string $expected)
Definition: NormalizeCommandTest.php:223
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeWeekdayThrowsExceptionForInvalidWeekdayRepresentation
‪normalizeWeekdayThrowsExceptionForInvalidWeekdayRepresentation($weekday)
Definition: NormalizeCommandTest.php:598
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeMonthAndWeekdayFieldInvalidDataProvider
‪static normalizeMonthAndWeekdayFieldInvalidDataProvider()
Definition: NormalizeCommandTest.php:169
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy
Definition: NormalizeCommandAccessibleProxy.php:26
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeIntegerFieldThrowsExceptionForInvalidExpressions
‪normalizeIntegerFieldThrowsExceptionForInvalidExpressions(string $expression, int $lowerBound, int $upperBound, int $expectedExceptionCode)
Definition: NormalizeCommandTest.php:253
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeMonthAndWeekdayField
‪static normalizeMonthAndWeekdayField($expression, $isMonthField=true)
Definition: NormalizeCommandAccessibleProxy.php:37
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest
Definition: NormalizeCommandTest.php:27
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\validSpecialKeywordsDataProvider
‪static validSpecialKeywordsDataProvider()
Definition: NormalizeCommandTest.php:72
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeValidDataProvider
‪static normalizeValidDataProvider()
Definition: NormalizeCommandTest.php:28
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeFields
‪static normalizeFields($cronCommand)
Definition: NormalizeCommandAccessibleProxy.php:32
‪TYPO3\CMS\Scheduler\CronCommand\NormalizeCommand
Definition: NormalizeCommand.php:28
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\convertRangeToListOfValues
‪static convertRangeToListOfValues($range)
Definition: NormalizeCommandAccessibleProxy.php:52
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeWeekdayReturnsInteger
‪normalizeWeekdayReturnsInteger($weekday)
Definition: NormalizeCommandTest.php:564
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeIntegerFieldInvalidDataProvider
‪static normalizeIntegerFieldInvalidDataProvider()
Definition: NormalizeCommandTest.php:229
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\reduceListOfValuesByStepValue
‪static reduceListOfValuesByStepValue($stepExpression)
Definition: NormalizeCommandAccessibleProxy.php:57
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeMonthAndWeekdayNormalizesAWeekday
‪normalizeMonthAndWeekdayNormalizesAWeekday()
Definition: NormalizeCommandTest.php:416
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\validStepsDataProvider
‪static validStepsDataProvider()
Definition: NormalizeCommandTest.php:355
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\invalidStepsDataProvider
‪static invalidStepsDataProvider()
Definition: NormalizeCommandTest.php:377
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeMonthAndWeekdayNormalizesAMonth
‪normalizeMonthAndWeekdayNormalizesAMonth()
Definition: NormalizeCommandTest.php:409
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeMonthAndWeekdayFieldThrowsExceptionForInvalidExpression
‪normalizeMonthAndWeekdayFieldThrowsExceptionForInvalidExpression(string $expression, bool $isMonthField, int $expectedExceptionCode)
Definition: NormalizeCommandTest.php:188
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeIntegerField
‪static normalizeIntegerField($expression, $lowerBound=0, $upperBound=59)
Definition: NormalizeCommandAccessibleProxy.php:42
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\splitFieldsReturnsIntegerArrayWithFieldsSplitByWhitespace
‪splitFieldsReturnsIntegerArrayWithFieldsSplitByWhitespace()
Definition: NormalizeCommandTest.php:266
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\invalidCronCommandFieldsDataProvider
‪static invalidCronCommandFieldsDataProvider()
Definition: NormalizeCommandTest.php:279
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\validWeekdayDataProvider
‪static validWeekdayDataProvider()
Definition: NormalizeCommandTest.php:515
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\validRangeDataProvider
‪static validRangeDataProvider()
Definition: NormalizeCommandTest.php:302
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\invalidRangeDataProvider
‪static invalidRangeDataProvider()
Definition: NormalizeCommandTest.php:326
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeMonthAndWeekday
‪static normalizeMonthAndWeekday($expression, $isMonth=true)
Definition: NormalizeCommandAccessibleProxy.php:62
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\validMonthNamesDataProvider
‪static validMonthNamesDataProvider()
Definition: NormalizeCommandTest.php:429
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\invalidMonthNamesDataProvider
‪static invalidMonthNamesDataProvider()
Definition: NormalizeCommandTest.php:474
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeMonth
‪static normalizeMonth($month)
Definition: NormalizeCommandAccessibleProxy.php:67
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeConvertsCronCommand
‪normalizeConvertsCronCommand(string $expression, string $expected)
Definition: NormalizeCommandTest.php:66
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\convertRangeToListOfValuesReturnsCorrectListForValidRanges
‪convertRangeToListOfValuesReturnsCorrectListForValidRanges($range, string $expected)
Definition: NormalizeCommandTest.php:320
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\convertKeywordsToCronCommand
‪static convertKeywordsToCronCommand($cronCommand)
Definition: NormalizeCommandAccessibleProxy.php:27
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeMonthConvertsName
‪normalizeMonthConvertsName($monthName, int $expectedInteger)
Definition: NormalizeCommandTest.php:457
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\splitFieldsThrowsExceptionIfCronCommandDoesNotContainFiveFields
‪splitFieldsThrowsExceptionIfCronCommandDoesNotContainFiveFields($cronCommand)
Definition: NormalizeCommandTest.php:295
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\invalidWeekdayDataProvider
‪static invalidWeekdayDataProvider()
Definition: NormalizeCommandTest.php:570
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\convertRangeToListOfValuesThrowsExceptionForInvalidRanges
‪convertRangeToListOfValuesThrowsExceptionForInvalidRanges(string $range, int $expectedExceptionCode)
Definition: NormalizeCommandTest.php:348
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeIntegerFieldValidDataProvider
‪static normalizeIntegerFieldValidDataProvider()
Definition: NormalizeCommandTest.php:198
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\convertKeywordsToCronCommandConvertsValidKeywords
‪convertKeywordsToCronCommandConvertsValidKeywords(string $keyword, string $expectedCronCommand)
Definition: NormalizeCommandTest.php:91
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\reduceListOfValuesByStepValueReturnsCorrectListOfValues
‪reduceListOfValuesByStepValueReturnsCorrectListOfValues(string $stepExpression, string $expected)
Definition: NormalizeCommandTest.php:371
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeMonthAndWeekdayFieldReturnsNormalizedListForValidExpression
‪normalizeMonthAndWeekdayFieldReturnsNormalizedListForValidExpression(string $expression, bool $isMonthField, string $expected)
Definition: NormalizeCommandTest.php:160
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\splitFields
‪static splitFields($cronCommand)
Definition: NormalizeCommandAccessibleProxy.php:47
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\reduceListOfValuesByStepValueThrowsExceptionForInvalidStepExpressions
‪reduceListOfValuesByStepValueThrowsExceptionForInvalidStepExpressions(string $stepExpression, int $expectedExceptionCode)
Definition: NormalizeCommandTest.php:398
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeFieldsConvertsField
‪normalizeFieldsConvertsField(string $expression, string $expected)
Definition: NormalizeCommandTest.php:122
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\convertKeywordsToCronCommandReturnsUnchangedCommandIfKeywordWasNotFound
‪convertKeywordsToCronCommandReturnsUnchangedCommandIfKeywordWasNotFound()
Definition: NormalizeCommandTest.php:98
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeWeekdayConvertsName
‪normalizeWeekdayConvertsName($weekday, int $expectedInteger)
Definition: NormalizeCommandTest.php:553
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeMonthAndWeekdayFieldValidDataProvider
‪static normalizeMonthAndWeekdayFieldValidDataProvider()
Definition: NormalizeCommandTest.php:128
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeMonthReturnsInteger
‪normalizeMonthReturnsInteger($monthName)
Definition: NormalizeCommandTest.php:468
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeWeekday
‪static normalizeWeekday($weekday)
Definition: NormalizeCommandAccessibleProxy.php:72
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeMonthAndWeekdayLeavesValueUnchanged
‪normalizeMonthAndWeekdayLeavesValueUnchanged()
Definition: NormalizeCommandTest.php:423
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeFieldsValidDataProvider
‪static normalizeFieldsValidDataProvider()
Definition: NormalizeCommandTest.php:105