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
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | fix_test_fails_in_php_7-2570237-2.patch | 3.19 KB | almaudoh |
Comments
Comment #2
almaudoh commentedPatch attached...
Comment #4
almaudoh commentedWill have to push this to 8.x-1.x for the branch to pass. Committed and pushed.
Comment #6
almaudoh commentedPatch didn't apply because it had already been committed.
Comment #9
almaudoh commented