Problem/Motivation

/admin/config/development/testing returns a 500 Internal Server Error due to scheduler.test:
PHP Parse error: syntax error, unexpected '[', expecting ')' in sites/all/modules/contrib/scheduler/scheduler.test

Proposed resolution

Change

// Create a published node without scheduling.
    $published_node = $this->drupalCreateNode(['type' => 'page', 'status' => 1]);

to work in PHP 5.3

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Novitsh created an issue. See original summary.

Novitsh’s picture

jonathan1055’s picture

Hi Novitsh,
Thank you for raising this. Yes that new test was added in #2651344: Change unavailable_after meta tag to HTTP Header X-Robots-Tag which was initially at 8.x then the test was back-ported to 7.x

I am going to change the continual testing on 7.x to also run PHP5.3 in addition to 5.4 so that this error will be detected before committing.

Jonathan

jonathan1055’s picture

The main 'issue and commit' test is now chnaged to php5.3 and sure enough on https://dispatcher.drupalci.org/job/default/129181/console we get:

12:23:59 cd /var/www/html && sudo -u www-data php /var/www/html/scripts/run-tests.sh --list --php /opt/phpenv/shims/php > /var/www/html/artifacts/testgroups.txt
12:23:59 Command created as exec id caf4b974
12:24:00 PHP Parse error:  syntax error, unexpected '[', expecting ')' in /var/www/html/sites/all/modules/scheduler/scheduler.test on line 664
12:24:00 PHP Stack trace:
12:24:00 PHP   1. {main}() /var/www/html/scripts/run-tests.sh:0
12:24:00 PHP   2. simpletest_test_get_all() /var/www/html/scripts/run-tests.sh:50
12:24:00 PHP   3. class_exists() /var/www/html/modules/simpletest/simpletest.module:371
12:24:00 PHP   4. drupal_autoload_class() /var/www/html/modules/simpletest/simpletest.module:371
12:24:00 PHP   5. _registry_check_code() /var/www/html/includes/bootstrap.inc:3120
12:24:00 
12:24:00 Error
12:24:00 Received a non-zero return code from the last command executed on the container.  (Return status: 255)
12:24:00 Execution Error

I have just added a retest of your patch at php5.3

  • jonathan1055 committed a1c4c0d on 7.x-1.x authored by Novitsh
    Issue #2722355 by Novitsh: PHP 5.3 issue on scheduler.test array...
jonathan1055’s picture

Status: Needs review » Fixed

The re-test at php5.3 shows that your patch fixed the problem and that there were no other errors at 5.3. The continuous testing will now trap anything not valid at 5.3

Patch to commit in 29 minutes :-)
Thanks very much.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.