If I run any the aggregation tests, it causes PHP strict notices due to the use of strtotime without setting the default timezone. However, that message is not displayed because an exception happens on inserting that exception into {simpletest}:

INSERT INTO {simpletest} (test_id, test_class, status, message, message_group, function, line, file) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7) - Array ( [:db_insert_placeholder_0] => 36 [:db_insert_placeholder_1] => CategorizeFeedItemTestCase [:db_insert_placeholder_2] => exception [:db_insert_placeholder_3] => strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CST/-6.0/no DST' instead [:db_insert_placeholder_4] => Strict warning [:db_insert_placeholder_5] => a [:db_insert_placeholder_6] => a [:db_insert_placeholder_7] => a ) SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'a' for column 'line' at row 1 Uncaught exception database.inc 494 DatabaseConnection->query()

The related code is in drupalWebTestCase->_assert():

    // Creation assertion array that can be displayed while tests are running.
    $this->_assertions[] = $assertion = array(
      'test_id' => $this->test_id,
      'test_class' => get_class($this),
      'status' => $status,
      'message' => $message,
      'message_group' => $group,
      'function' => $caller['function'],
      'line' => $caller['line'],
      'file' => $caller['file'],
    );

    // Store assertion for display after the test has completed.
    db_insert('simpletest')->fields($assertion)->execute();

So the value 'a' is being passed into $caller['line']. If I change 'line' => (int) $caller['line'] then I can see the actual exception message, but the filename, line, and function all have the value 'a'. And that just seems plain wrong.

strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CST/-6.0/no DST' instead Strict warning a 0 a

This has been driving me crazy and I'm not sure how this can be fixed.

Comments

damien tournoud’s picture

Status: Active » Closed (duplicate)

Probably a duplicate of the follow-up to #328781: Fix horrible things in the error reporting.

dave reid’s picture

That was the ticket! Thanks for the point in the right direction.