Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MON#1,MON#3 doesn't validate #70

Closed
tqmz opened this issue Dec 26, 2014 · 0 comments
Closed

MON#1,MON#3 doesn't validate #70

tqmz opened this issue Dec 26, 2014 · 0 comments

Comments

@tqmz
Copy link

tqmz commented Dec 26, 2014

In v1.0.3 it was possible to assign multiple days of week to an DayOfWeekField expression with a week of month:

 $this->assertTrue($f->validate('MON#1,MON#3'));

In master, this doesn't validate anymore while it seems to be supported in terms of isDue().

PHP Fatal error:  Uncaught exception 'InvalidArgumentException' with message 'Invalid CRON field value MON#1,MON#3 as position 4' in /home/t/dev/fs/radiorecorder/vendor/mtdowling/cron-expression/src/Cron/CronExpression.php:123
Stack trace:
#0 /home/t/dev/fs/radiorecorder/vendor/mtdowling/cron-expression/src/Cron/CronExpression.php(105): Cron\CronExpression->setPart(4, 'MON#1,MON#3')
#1 /home/t/dev/fs/radiorecorder/vendor/mtdowling/cron-expression/src/Cron/CronExpression.php(84): Cron\CronExpression->setExpression('00 14 * * MON#1...')
#2 /home/t/dev/fs/radiorecorder/vendor/mtdowling/cron-expression/src/Cron/CronExpression.php(72): Cron\CronExpression->__construct('00 14 * * MON#1...', Object(Cron\FieldFactory))
#3 /home/t/dev/fs/radiorecorder/record.php(167): Cron\CronExpression::factory('00 14 * * MON#1...')
#4 /home/t/dev/fs/radiorecorder/record.php(45): Radiorecorder\Radiorecorder->parseBroadcasts('/home/t/dev/fs/...')
#5 /home/t/dev/fs/radiorecorder/record.php(382): Radiorecorder\Radiorecorder->__construct()
#6 {main}
  th in /home/t/dev/fs/radiorecorder/vendor/mtdowling/cron-expression/src/Cron/CronExpression.php on line 123

Is that just a matter of fixing the regex in DayOfWeekField::validate(), or for some reason an undesired expression?

peter279k pushed a commit to peter279k/cron-expression that referenced this issue Nov 25, 2020
Replace deprecated expectedException annotations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants