List of steps to reproduce:
- Run the docker: docker-compose up -d
- Run the script: docker-compose exec mediawiki php maintenance/resetPageRandom.php --from 20210901000000 --to 20211018000000
Expected outcome
Since --from's date value is smaller than --to's date value. So script should run with any error.
Actual outcome
"--from has to be smaller than --to" error message.
Cause
I digged into this. $this->getOption( 'from' ) and $this->getOption( 'to' ) always returning int(1) into wfTimestampOrNull function. This cause wfTimestampOrNull function to return string(14) "19700101000001" for both dates.
The main culprit is $this->addOption() as it does not take argument from CLI.