‪TYPO3CMS  11.5
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 
22 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
23 
27 class ‪NormalizeCommandTest extends UnitTestCase
28 {
32  public static function ‪normalizeValidDataProvider(): array
33  {
34  return [
35  '@weekly' => ['@weekly', '0 0 * * 7'],
36  ' @weekly ' => [' @weekly ', '0 0 * * 7'],
37  '* * * * *' => ['* * * * *', '* * * * *'],
38  '30 4 1,15 * 5' => ['30 4 1,15 * 5', '30 4 1,15 * 5'],
39  '5 0 * * *' => ['5 0 * * *', '5 0 * * *'],
40  '15 14 1 * *' => ['15 14 1 * *', '15 14 1 * *'],
41  '0 22 * * 1-5' => ['0 22 * * 1-5', '0 22 * * 1,2,3,4,5'],
42  '23 0-23/2 * * *' => ['23 0-23/2 * * *', '23 0,2,4,6,8,10,12,14,16,18,20,22 * * *'],
43  '5 4 * * sun' => ['5 4 * * sun', '5 4 * * 7'],
44  '0-3/2,7 0,4 20-22, feb,mar-jun/2,7 1-3,sun' => [
45  '0-3/2,7 0,4 20-22 feb,mar-jun/2,7 1-3,sun',
46  '0,2,7 0,4 20,21,22 2,3,5,7 1,2,3,7',
47  ],
48  '0-20/10 * * * *' => ['0-20/10 * * * *', '0,10,20 * * * *'],
49  '* * 2 * *' => ['* * 2 * *', '* * 2 * *'],
50  '* * 2,7 * *' => ['* * 2,7 * *', '* * 2,7 * *'],
51  '* * 2-4,10 * *' => ['* * 2-4,10 * *', '* * 2,3,4,10 * *'],
52  '* * */14 * *' => ['* * */14 * *', '* * 1,15,29 * *'],
53  '* * 2,4-6/2,*/14 * *' => ['* * 2,4-6/2,*/14 * *', '* * 1,2,4,6,15,29 * *'],
54  '* * * * 1' => ['* * * * 1', '* * * * 1'],
55  '0 0 * * 0' => ['0 0 * * 0', '0 0 * * 7'],
56  '0 0 * * 7' => ['0 0 * * 7', '0 0 * * 7'],
57  '* * 1,2 * 1' => ['* * 1,2 * 1', '* * 1,2 * 1'],
58  '15 02 * * *' => ['15 02 * * *', '15 2 * * *'],
59  '08 02 * * *' => ['08 02 * * *', '8 2 * * *'],
60  '15 00 * * *' => ['15 00 * * *', '15 0 * * *'],
61  ];
62  }
63 
70  public function ‪normalizeConvertsCronCommand(string $expression, string $expected): void
71  {
72  $result = ‪NormalizeCommand::normalize($expression);
73  self::assertEquals($expected, $result);
74  }
75 
79  public static function ‪validSpecialKeywordsDataProvider(): array
80  {
81  return [
82  '@yearly' => ['@yearly', '0 0 1 1 *'],
83  '@annually' => ['@annually', '0 0 1 1 *'],
84  '@monthly' => ['@monthly', '0 0 1 * *'],
85  '@weekly' => ['@weekly', '0 0 * * 0'],
86  '@daily' => ['@daily', '0 0 * * *'],
87  '@midnight' => ['@midnight', '0 0 * * *'],
88  '@hourly' => ['@hourly', '0 * * * *'],
89  ];
90  }
91 
98  public function ‪convertKeywordsToCronCommandConvertsValidKeywords(string $keyword, string $expectedCronCommand): void
99  {
101  self::assertEquals($expectedCronCommand, $result);
102  }
103 
108  {
109  $invalidKeyword = 'foo';
111  self::assertEquals($invalidKeyword, $result);
112  }
113 
117  public function ‪normalizeFieldsValidDataProvider(): array
118  {
119  return [
120  '1-2 * * * *' => ['1-2 * * * *', '1,2 * * * *'],
121  '* 1-2 * * *' => ['* 1-2 * * *', '* 1,2 * * *'],
122  '* * 1-2 * *' => ['* * 1-2 * *', '* * 1,2 * *'],
123  '* * * 1-2 *' => ['* * * 1-2 *', '* * * 1,2 *'],
124  '* * * * 1-2' => ['* * * * 1-2', '* * * * 1,2'],
125  ];
126  }
127 
134  public function ‪normalizeFieldsConvertsField(string $expression, string $expected): void
135  {
137  self::assertEquals($expected, $result);
138  }
139 
144  {
145  return [
146  '* monthField' => ['*', true, '*'],
147  'string 1 monthField' => ['1', true, '1'],
148  'jan' => ['jan', true, '1'],
149  'feb/2' => ['feb/2', true, '2'],
150  'jan-feb/2' => ['jan-feb/2', true, '1'],
151  '1-2 monthField' => ['1-2', true, '1,2'],
152  '1-3/2,feb,may,6' => ['1-3/2,feb,may,6', true, '1,2,3,5,6'],
153  '*/4' => ['*/4', true, '1,5,9'],
154  '* !monthField' => ['*', false, '*'],
155  'string 1, !monthField' => ['1', false, '1'],
156  'fri' => ['fri', false, '5'],
157  'sun' => ['sun', false, '7'],
158  'string 0 for sunday' => ['0', false, '7'],
159  '0,1' => ['0,1', false, '1,7'],
160  '*/3' => ['*/3', false, '1,4,7'],
161  'tue/2' => ['tue/2', false, '2'],
162  '1-2 !monthField' => ['1-2', false, '1,2'],
163  'tue-fri/2' => ['tue-fri/2', false, '2,4'],
164  '1-3/2,tue,fri,6' => ['1-3/2,tue,fri,6', false, '1,2,3,5,6'],
165  ];
166  }
167 
176  string $expression,
177  bool $isMonthField,
178  string $expected
179  ): void {
180  $result = ‪NormalizeCommandAccessibleProxy::normalizeMonthAndWeekdayField($expression, $isMonthField);
181  self::assertSame($expected, $result);
182  }
183 
188  {
189  return [
190  'mon' => ['mon', true, 1291083486],
191  '1-2/mon' => ['1-2/mon', true, 1291414957],
192  '0,1' => ['0,1', true, 1291083486],
193  'feb' => ['feb', false, 1291163589],
194  '1-2/feb' => ['1-2/feb', false, 1291414957],
195  '0-fri/2,7' => ['0-fri/2,7', false, 1291237145],
196  ];
197  }
198 
207  string $expression,
208  bool $isMonthField,
209  int $expectedExceptionCode
210  ): void {
211  $this->expectException(\InvalidArgumentException::class);
212  $this->expectExceptionCode($expectedExceptionCode);
214  }
215 
219  public static function ‪normalizeIntegerFieldValidDataProvider(): array
220  {
221  return [
222  '*' => ['*', '*'],
223  'string 2' => ['2', '2'],
224  'integer 3' => [3, '3'],
225  'list of values' => ['1,2,3', '1,2,3'],
226  'unsorted list of values' => ['3,1,5', '1,3,5'],
227  'duplicate values' => ['0-2/2,2', '0,2'],
228  'additional field between steps' => ['1-3/2,2', '1,2,3'],
229  '2-4' => ['2-4', '2,3,4'],
230  'simple step 4/4' => ['4/4', '4'],
231  'step 2-7/5' => ['2-7/5', '2,7'],
232  'steps 4-12/4' => ['4-12/4', '4,8,12'],
233  '0-59/20' => ['0-59/20', '0,20,40'],
234  '*/20' => ['*/20', '0,20,40'],
235  ];
236  }
237 
244  public function ‪normalizeIntegerFieldReturnsNormalizedListForValidExpression($expression, string $expected): void
245  {
247  self::assertSame($expected, $result);
248  }
249 
253  public static function ‪normalizeIntegerFieldInvalidDataProvider(): array
254  {
255  return [
256  'string foo' => ['foo', 0, 59, 1291429389],
257  'empty string' => ['', 0, 59, 1291429389],
258  '4-3' => ['4-3', 0, 59, 1291237145],
259  '/2' => ['/2', 0, 59, 1291234985],
260  '/' => ['/', 0, 59, 1291234985],
261  'left bound too low' => ['2-4', 3, 4, 1291470084],
262  'right bound too high' => ['2-4', 2, 3, 1291470170],
263  'left and right bound' => ['2-5', 2, 4, 1291470170],
264  'element in list is lower than allowed' => ['2,1,4', 2, 4, 1291470084],
265  'element in list is higher than allowed' => ['2,5,4', 1, 4, 1291470170],
266  ];
267  }
268 
278  string $expression,
279  int $lowerBound,
280  int $upperBound,
281  int $expectedExceptionCode
282  ): void {
283  $this->expectException(\InvalidArgumentException::class);
284  $this->expectExceptionCode($expectedExceptionCode);
285 
286  ‪NormalizeCommandAccessibleProxy::normalizeIntegerField($expression, $lowerBound, $upperBound);
287  }
288 
293  {
294  $result = ‪NormalizeCommandAccessibleProxy::splitFields('12,13 * 1-12/2,14 jan fri');
295  $expectedResult = [
296  0 => '12,13',
297  1 => '*',
298  2 => '1-12/2,14',
299  3 => 'jan',
300  4 => 'fri',
301  ];
302  self::assertSame($expectedResult, $result);
303  }
304 
308  public static function ‪invalidCronCommandFieldsDataProvider(): array
309  {
310  return [
311  'empty string' => [''],
312  'foo' => ['foo'],
313  'integer 4' => [4],
314  'four fields' => ['* * * *'],
315  'six fields' => ['* * * * * *'],
316  ];
317  }
318 
325  {
326  $this->expectException(\InvalidArgumentException::class);
327  $this->expectExceptionCode(1291227373);
329  }
330 
334  public static function ‪validRangeDataProvider(): array
335  {
336  return [
337  'single value' => ['3', '3'],
338  'integer 3' => [3, '3'],
339  '0-0' => ['0-0', '0'],
340  '4-4' => ['4-4', '4'],
341  '0-3' => ['0-3', '0,1,2,3'],
342  '4-5' => ['4-5', '4,5'],
343  ];
344  }
345 
352  public function ‪convertRangeToListOfValuesReturnsCorrectListForValidRanges($range, string $expected): void
353  {
355  self::assertSame($expected, $result);
356  }
357 
361  public static function ‪invalidRangeDataProvider(): array
362  {
363  return [
364  'empty string' => ['', 1291234985],
365  'string' => ['foo', 1291237668],
366  'single dash' => ['-', 1291237668],
367  'left part is string' => ['foo-5', 1291237668],
368  'right part is string' => ['5-foo', 1291237668],
369  'range of strings' => ['foo-bar', 1291237668],
370  'string five minus' => ['5-', 1291237668],
371  'string minus five' => ['-5', 1291237668],
372  'more than one dash' => ['2-3-4', 1291234986],
373  'left part bigger than right part' => ['6-3', 1291237145],
374  ];
375  }
376 
383  public function ‪convertRangeToListOfValuesThrowsExceptionForInvalidRanges(string $range, int $expectedExceptionCode): void
384  {
385  $this->expectException(\InvalidArgumentException::class);
386  $this->expectExceptionCode($expectedExceptionCode);
388  }
389 
393  public static function ‪validStepsDataProvider(): array
394  {
395  return [
396  '2/2' => ['2/2', '2'],
397  '2,3,4/2' => ['2,3,4/2', '2,4'],
398  '1,2,3,4,5,6,7/3' => ['1,2,3,4,5,6,7/3', '1,4,7'],
399  '0,1,2,3,4,5,6/3' => ['0,1,2,3,4,5,6/3', '0,3,6'],
400  ];
401  }
402 
409  public function ‪reduceListOfValuesByStepValueReturnsCorrectListOfValues(string $stepExpression, string $expected): void
410  {
412  self::assertSame($expected, $result);
413  }
414 
418  public static function ‪invalidStepsDataProvider(): array
419  {
420  return [
421  'empty string' => ['', 1291234987],
422  'slash only' => ['/', 1291414955],
423  'left part empty' => ['/2', 1291414955],
424  'right part empty' => ['2/', 1291414956],
425  'multiples slashes' => ['1/2/3', 1291242168],
426  '2-2' => ['2-2', 1291414956],
427  '2.3/2' => ['2.3/2', 1291414958],
428  '2,3,4/2.3' => ['2,3,4/2.3', 1291414957],
429  '2,3,4/2,3' => ['2,3,4/2,3', 1291414957],
430  ];
431  }
432 
440  string $stepExpression,
441  int $expectedExceptionCode
442  ): void {
443  $this->expectException(\InvalidArgumentException::class);
444  $this->expectExceptionCode($expectedExceptionCode);
445 
447  }
448 
453  {
455  self::assertSame('2', $result);
456  }
457 
462  {
464  self::assertSame('5', $result);
465  }
466 
471  {
473  self::assertSame('2', $result);
474  }
475 
479  public static function ‪validMonthNamesDataProvider(): array
480  {
481  return [
482  'jan' => ['jan', 1],
483  'feb' => ['feb', 2],
484  'MaR' => ['MaR', 3],
485  'aPr' => ['aPr', 4],
486  'MAY' => ['MAY', 5],
487  'jun' => ['jun', 6],
488  'jul' => ['jul', 7],
489  'aug' => ['aug', 8],
490  'sep' => ['sep', 9],
491  'oct' => ['oct', 10],
492  'nov' => ['nov', 11],
493  'dec' => ['dec', 12],
494  'string 7' => ['7', 7],
495  'integer 7' => [7, 7],
496  'string 07' => ['07', 7],
497  'integer 07' => [7, 7],
498  ];
499  }
500 
507  public function ‪normalizeMonthConvertsName($monthName, int $expectedInteger): void
508  {
510  self::assertEquals($expectedInteger, $result);
511  }
512 
518  public function ‪normalizeMonthReturnsInteger($monthName): void
519  {
521  self::assertIsInt($result);
522  }
523 
527  public static function ‪invalidMonthNamesDataProvider(): array
528  {
529  return [
530  'sep-' => ['sep-', 1291083486],
531  '-September-' => ['-September-', 1291083486],
532  ',sep' => [',sep', 1291083486],
533  ',September,' => [',September,', 1291083486],
534  'sep/' => ['sep/', 1291083486],
535  '/sep' => ['/sep', 1291083486],
536  '/September/' => ['/September/', 1291083486],
537  'foo' => ['foo', 1291083486],
538  'Tuesday' => ['Tuesday', 1291083486],
539  'Tue' => ['Tue', 1291083486],
540  'string 0' => ['0', 1291083486],
541  'integer 0' => [0, 1291083486],
542  'string seven' => ['seven', 1291083486],
543  'string 13' => ['13', 1291083486],
544  'integer 13' => [13, 1291083486],
545  'integer 99' => [99, 1291083486],
546  'integer 2010' => [2010, 1291083486],
547  'string minus 7' => ['-7', 1291083486],
548  'negative integer 7' => [-7, 1291083486],
549  ];
550  }
551 
559  $invalidMonthName,
560  int $expectedExceptionCode
561  ): void {
562  $this->expectException(\InvalidArgumentException::class);
563  $this->expectExceptionCode($expectedExceptionCode);
564 
566  }
567 
571  public static function ‪validWeekdayDataProvider(): array
572  {
573  return [
574  'string 1' => ['1', 1],
575  'string 2' => ['2', 2],
576  'string 02' => ['02', 2],
577  'integer 02' => [2, 2],
578  'string 3' => ['3', 3],
579  'string 4' => ['4', 4],
580  'string 5' => ['5', 5],
581  'integer 5' => [5, 5],
582  'string 6' => ['6', 6],
583  'string 7' => ['7', 7],
584  'string 0' => ['0', 7],
585  'integer 0' => [0, 7],
586  'mon' => ['mon', 1],
587  'monday' => ['monday', 1],
588  'tue' => ['tue', 2],
589  'tuesday' => ['tuesday', 2],
590  'WED' => ['WED', 3],
591  'WEDnesday' => ['WEDnesday', 3],
592  'tHu' => ['tHu', 4],
593  'Thursday' => ['Thursday', 4],
594  'fri' => ['fri', 5],
595  'friday' => ['friday', 5],
596  'sat' => ['sat', 6],
597  'saturday' => ['saturday', 6],
598  'sun' => ['sun', 7],
599  'sunday' => ['sunday', 7],
600  ];
601  }
602 
609  public function ‪normalizeWeekdayConvertsName($weekday, int $expectedInteger): void
610  {
612  self::assertEquals($expectedInteger, $result);
613  }
614 
620  public function ‪normalizeWeekdayReturnsInteger($weekday): void
621  {
623  self::assertIsInt($result);
624  }
625 
629  public static function ‪invalidWeekdayDataProvider(): array
630  {
631  return [
632  '-fri' => ['-fri'],
633  'fri-' => ['fri-'],
634  '-friday-' => ['-friday-'],
635  '/fri' => ['/fri'],
636  'fri/' => ['fri/'],
637  '/friday/' => ['/friday/'],
638  ',fri' => [',fri'],
639  ',friday,' => [',friday,'],
640  'string minus 1' => ['-1'],
641  'integer -1' => [-1],
642  'string seven' => ['seven'],
643  'string 8' => ['8'],
644  'string 29' => ['29'],
645  'string 2010' => ['2010'],
646  'Jan' => ['Jan'],
647  'January' => ['January'],
648  'MARCH' => ['MARCH'],
649  ];
650  }
651 
658  {
659  $this->expectException(\InvalidArgumentException::class);
660  $this->expectExceptionCode(1291163589);
661 
663  }
664 }
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeMonthThrowsExceptionForInvalidMonthRepresentation
‪normalizeMonthThrowsExceptionForInvalidMonthRepresentation( $invalidMonthName, int $expectedExceptionCode)
Definition: NormalizeCommandTest.php:558
‪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:244
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\validStepsDataProvider
‪static array validStepsDataProvider()
Definition: NormalizeCommandTest.php:393
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeWeekdayThrowsExceptionForInvalidWeekdayRepresentation
‪normalizeWeekdayThrowsExceptionForInvalidWeekdayRepresentation($weekday)
Definition: NormalizeCommandTest.php:657
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\validRangeDataProvider
‪static array validRangeDataProvider()
Definition: NormalizeCommandTest.php:334
‪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:277
‪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:28
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeFields
‪static normalizeFields($cronCommand)
Definition: NormalizeCommandAccessibleProxy.php:32
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\invalidStepsDataProvider
‪static array invalidStepsDataProvider()
Definition: NormalizeCommandTest.php:418
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeValidDataProvider
‪static array normalizeValidDataProvider()
Definition: NormalizeCommandTest.php:32
‪TYPO3\CMS\Scheduler\CronCommand\NormalizeCommand
Definition: NormalizeCommand.php:28
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeMonthAndWeekdayFieldInvalidDataProvider
‪static array normalizeMonthAndWeekdayFieldInvalidDataProvider()
Definition: NormalizeCommandTest.php:187
‪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:620
‪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:461
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\validMonthNamesDataProvider
‪static array validMonthNamesDataProvider()
Definition: NormalizeCommandTest.php:479
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeIntegerFieldValidDataProvider
‪static array normalizeIntegerFieldValidDataProvider()
Definition: NormalizeCommandTest.php:219
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeIntegerFieldInvalidDataProvider
‪static array normalizeIntegerFieldInvalidDataProvider()
Definition: NormalizeCommandTest.php:253
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\invalidMonthNamesDataProvider
‪static array invalidMonthNamesDataProvider()
Definition: NormalizeCommandTest.php:527
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeMonthAndWeekdayNormalizesAMonth
‪normalizeMonthAndWeekdayNormalizesAMonth()
Definition: NormalizeCommandTest.php:452
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeMonthAndWeekdayFieldThrowsExceptionForInvalidExpression
‪normalizeMonthAndWeekdayFieldThrowsExceptionForInvalidExpression(string $expression, bool $isMonthField, int $expectedExceptionCode)
Definition: NormalizeCommandTest.php:206
‪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:292
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\invalidRangeDataProvider
‪static array invalidRangeDataProvider()
Definition: NormalizeCommandTest.php:361
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeMonthAndWeekdayFieldValidDataProvider
‪static array normalizeMonthAndWeekdayFieldValidDataProvider()
Definition: NormalizeCommandTest.php:143
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeFieldsValidDataProvider
‪array normalizeFieldsValidDataProvider()
Definition: NormalizeCommandTest.php:117
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\invalidWeekdayDataProvider
‪static array invalidWeekdayDataProvider()
Definition: NormalizeCommandTest.php:629
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\validWeekdayDataProvider
‪static array validWeekdayDataProvider()
Definition: NormalizeCommandTest.php:571
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\AccessibleProxies\NormalizeCommandAccessibleProxy\normalizeMonthAndWeekday
‪static normalizeMonthAndWeekday($expression, $isMonth=true)
Definition: NormalizeCommandAccessibleProxy.php:62
‪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:70
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\convertRangeToListOfValuesReturnsCorrectListForValidRanges
‪convertRangeToListOfValuesReturnsCorrectListForValidRanges($range, string $expected)
Definition: NormalizeCommandTest.php:352
‪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:507
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\splitFieldsThrowsExceptionIfCronCommandDoesNotContainFiveFields
‪splitFieldsThrowsExceptionIfCronCommandDoesNotContainFiveFields($cronCommand)
Definition: NormalizeCommandTest.php:324
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\validSpecialKeywordsDataProvider
‪static array validSpecialKeywordsDataProvider()
Definition: NormalizeCommandTest.php:79
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\convertRangeToListOfValuesThrowsExceptionForInvalidRanges
‪convertRangeToListOfValuesThrowsExceptionForInvalidRanges(string $range, int $expectedExceptionCode)
Definition: NormalizeCommandTest.php:383
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\convertKeywordsToCronCommandConvertsValidKeywords
‪convertKeywordsToCronCommandConvertsValidKeywords(string $keyword, string $expectedCronCommand)
Definition: NormalizeCommandTest.php:98
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\reduceListOfValuesByStepValueReturnsCorrectListOfValues
‪reduceListOfValuesByStepValueReturnsCorrectListOfValues(string $stepExpression, string $expected)
Definition: NormalizeCommandTest.php:409
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeMonthAndWeekdayFieldReturnsNormalizedListForValidExpression
‪normalizeMonthAndWeekdayFieldReturnsNormalizedListForValidExpression(string $expression, bool $isMonthField, string $expected)
Definition: NormalizeCommandTest.php:175
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\invalidCronCommandFieldsDataProvider
‪static array invalidCronCommandFieldsDataProvider()
Definition: NormalizeCommandTest.php:308
‪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:439
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeFieldsConvertsField
‪normalizeFieldsConvertsField(string $expression, string $expected)
Definition: NormalizeCommandTest.php:134
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\convertKeywordsToCronCommandReturnsUnchangedCommandIfKeywordWasNotFound
‪convertKeywordsToCronCommandReturnsUnchangedCommandIfKeywordWasNotFound()
Definition: NormalizeCommandTest.php:107
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeWeekdayConvertsName
‪normalizeWeekdayConvertsName($weekday, int $expectedInteger)
Definition: NormalizeCommandTest.php:609
‪TYPO3\CMS\Scheduler\Tests\Unit\CronCommand\NormalizeCommandTest\normalizeMonthReturnsInteger
‪normalizeMonthReturnsInteger($monthName)
Definition: NormalizeCommandTest.php:518
‪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:470