Problem/Motivation
When updating the acquia_contenthub module, we found that running our test suite against 5.6.32 and below caused php fatal errors. Test output below.
The crux of the issue is use statements for traits contain the same name as the traits in WebTestBase namespace. Not sure why this doesn't fail in php7, but so far its only in php 5.6
$ php core/scripts/run-tests.sh --php /home/travis/.phpenv/shims/php --verbose --url http://localhost:8080 acquia_contenthub
Drupal test run
---------------
Tests to be run:
- Drupal\acquia_contenthub\Tests\FieldClearingNodeTest
- Drupal\acquia_contenthub\Tests\IntegrationTest
- Drupal\acquia_contenthub\Tests\NodeFormTest
- Drupal\acquia_contenthub\Tests\ParagraphsTest
- Drupal\acquia_contenthub\Tests\TaxonomyTermTest
- Drupal\Tests\acquia_contenthub\Unit\ContentHubEntitiesTrackingTest
- Drupal\Tests\acquia_contenthub\Unit\ContentHubEntityDependencyTest
- Drupal\Tests\acquia_contenthub\Unit\ContentHubEntityEmbedHandlerTest
- Drupal\Tests\acquia_contenthub\Unit\Controller\ContentHubExportQueueControllerTest
- Drupal\Tests\acquia_contenthub\Unit\Controller\ContentHubReindexTest
- Drupal\Tests\acquia_contenthub\Unit\Encoder\ContentHubCdfEncoderTest
- Drupal\Tests\acquia_contenthub\Unit\EntityManagerTest
- Drupal\Tests\acquia_contenthub\Unit\Form\NodeFormTest
- Drupal\Tests\acquia_contenthub\Unit\Form\NodeTypePreviewImageFormTest
- Drupal\Tests\acquia_contenthub\Unit\ImportEntityManagerTest
- Drupal\Tests\acquia_contenthub\Unit\Normalizer\ContentEntityNormalizerTest
- Drupal\Tests\acquia_contenthub\Unit\Normalizer\ContentEntityViewModesExtractorTest
- Drupal\Tests\acquia_contenthub\Unit\Plugin\QueueWorker\ContentHubImportQueueBaseTest
- Drupal\Tests\acquia_contenthub\Unit\QueueItem\ImportQueueItemTest
- Drupal\Tests\acquia_contenthub\Unit\Session\ContentHubUserSessionTest
Test run started:
Friday, March 2, 2018 - 06:09
Test summary
------------
Drupal\acquia_contenthub\Tests\FieldClearingNodeTest 45 passes 1 exceptions 9 messages
PHP Fatal error: Cannot use Drupal\Tests\node\Traits\ContentTypeCreationTrait as ContentTypeCreationTrait because the name is already in use in /home/travis/build/drupal/docroot/core/modules/simpletest/src/WebTestBase.php on line 22
Fatal error: Cannot use Drupal\Tests\node\Traits\ContentTypeCreationTrait as ContentTypeCreationTrait because the name is already in use in /home/travis/build/drupal/docroot/core/modules/simpletest/src/WebTestBase.php on line 22
Proposed resolution
Rename the remaining traits so they don't conflict.
Remaining tasks
User interface changes
None.
API changes
None.
Data model changes
None.