Problem/Motivation

Tests in PHP 7 are failing due to some tests and classes using the reserved "String" keyword. See below test summary.

12:55:54 Test summary
12:55:54 ------------
12:55:54 
12:55:57 
12:55:57 Fatal error: Cannot use Drupal\Component\Utility\String as String because 'String' is a special class name in /var/www/html/modules/smsframework/modules/sms_valid/sms_valid.install on line 11
12:55:57 FATAL Drupal\sms_valid\Tests\SmsValidWebTest: test runner returned a non-zero error code (255).
12:55:57 
12:55:57 Fatal error: Cannot use Drupal\Component\Utility\String as String because 'String' is a special class name in /var/www/html/modules/smsframework/src/Form/CarrierAdminForm.php on line 11
12:55:57 
12:55:57 Fatal error: Cannot use Drupal\Component\Utility\String as String because 'String' is a special class name in /var/www/html/modules/smsframework/src/Form/CarrierAdminForm.php on line 11
12:55:57 FATAL Drupal\sms_devel\Tests\SmsDevelWebTest: test runner returned a non-zero error code (255).
12:55:57 FATAL Drupal\sms\Tests\SmsFrameworkWebTest: test runner returned a non-zero error code (255).
12:55:57 
12:55:57 Fatal error: Cannot use Drupal\Component\Utility\String as String because 'String' is a special class name in /var/www/html/modules/smsframework/src/Form/CarrierAdminForm.php on line 11
12:55:57 FATAL Drupal\sms_track\Tests\SmsTrackArchiveTest: test runner returned a non-zero error code (255).
12:55:58 
12:55:58 Fatal error: Cannot use Drupal\Component\Utility\String as String because 'String' is a special class name in /var/www/html/modules/smsframework/src/Form/CarrierAdminForm.php on line 11
12:55:58 FATAL Drupal\sms_blast\Tests\SmsBlastWebTest: test runner returned a non-zero error code (255).
12:55:59 
12:55:59 Fatal error: Cannot use Drupal\Component\Utility\String as String because 'String' is a special class name in /var/www/html/modules/smsframework/src/Form/CarrierAdminForm.php on line 11
12:55:59 FATAL Drupal\sms_user\Tests\SmsUserWebTest: test runner returned a non-zero error code (255).
12:55:59 
12:55:59 Test run duration: 5 sec

Proposed resolution

Replace use of String class, which have been removed in D8. Add tests to catch fails in PHP 5

Remaining tasks

Patch
Reviews
Commit

User interface changes

None

API changes

None

Data model changes

Comments

almaudoh created an issue. See original summary.

almaudoh’s picture

Status: Active » Needs review
StatusFileSize
new3.19 KB

Patch attached...

  • almaudoh committed 4cc3892 on 8.x-1.x
    Issue #2570237: Fix Test fails in PHP 7 due to use of reserved keyword "...
almaudoh’s picture

Status: Needs review » Fixed

Will have to push this to 8.x-1.x for the branch to pass. Committed and pushed.

Status: Fixed » Needs work

The last submitted patch, 2: fix_test_fails_in_php_7-2570237-2.patch, failed testing.

almaudoh’s picture

Status: Needs work » Fixed

Patch didn't apply because it had already been committed.

Status: Fixed » Closed (fixed)

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

Status: Closed (fixed) » Needs work

The last submitted patch, 2: fix_test_fails_in_php_7-2570237-2.patch, failed testing.

almaudoh’s picture

Status: Needs work » Closed (fixed)