Unverified Commit 756520b8 authored by jibran's avatar jibran Committed by jibran

Issue #3001640 by jibran: Add drupalci.yml

parent 21b8871a
# This is the DrupalCI testbot build file for Dynamic Entity Reference.
# Learn to make one for your own drupal.org project:
# https://www.drupal.org/drupalorg/docs/drupal-ci/customizing-drupalci-testing
build:
assessment:
validate_codebase:
phplint:
# Re-run composer install to ensure the dependencies resolve for the
# containerized PHP version.
container_composer:
options: ' install --prefer-dist --no-suggest --no-progress --no-interaction'
halt-on-fail: true
phpcs:
# phpcs will use core's specified version of Coder.
sniff-all-files: true
halt-on-fail: true
testing:
# run_tests task is executed several times in order of performance speeds.
# halt-on-fail can be set on the run_tests tasks in order to fail fast.
# suppress-deprecations is false in order to be alerted to usages of
# deprecated code.
run_tests.phpunit:
types: 'PHPUnit-Unit'
testgroups: '--all'
suppress-deprecations: false
halt-on-fail: false
run_tests.kernel:
types: 'PHPUnit-Kernel'
testgroups: '--all'
suppress-deprecations: false
halt-on-fail: false
run_tests.functional:
types: 'PHPUnit-Functional'
testgroups: '--all'
suppress-deprecations: false
halt-on-fail: false
run_tests.javascript:
concurrency: 15
types: 'PHPUnit-FunctionalJavascript'
testgroups: '--all'
suppress-deprecations: false
halt-on-fail: false
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="dynamic_entity_reference">
<description>Default PHP CodeSniffer configuration for Dynamic Entity Reference.</description>
<file>.</file>
<arg name="extensions" value="inc,install,module,php,profile,test,theme,yml"/>
<!--Ignore README markdown-->
<exclude-pattern>README\.md</exclude-pattern>
<exclude-pattern>CHANGELOG\.md</exclude-pattern>
<rule ref="Drupal"/>
</ruleset>
This diff is collapsed.
......@@ -6,7 +6,6 @@ use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderBase;
use Drupal\dynamic_entity_reference\Normalizer\DynamicEntityReferenceItemNormalizer;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
/**
* Service Provider for Dynamic Entity Reference.
......@@ -31,7 +30,7 @@ class DynamicEntityReferenceServiceProvider extends ServiceProviderBase {
// The priority must be higher than that of
// serializer.normalizer.entity_reference_item.hal in
// hal.services.yml.
$service_definition->addTag('normalizer', array('priority' => $parent_definition->getTags()['normalizer'][0]['priority'] + 1));
$service_definition->addTag('normalizer', ['priority' => $parent_definition->getTags()['normalizer'][0]['priority'] + 1]);
$container->setDefinition('serializer.normalizer.entity.dynamic_entity_reference_item.hal', $service_definition);
}
......
......@@ -107,13 +107,10 @@ class DynamicEntityReferenceTest extends WebDriverTestBase {
$this->drupalGet('entity_test/structure/entity_test/fields/add-field');
$select = $assert_session->selectExists('new_storage_type');
$select->selectOption('dynamic_entity_reference');
// This is needed to execute machine name JS.
$label = $assert_session->fieldExists('label');
$label->focus();
$label->setValue('Foobar');
$label->blur();
$select->focus();
sleep(1);
// Wait for the machine name.
$assert_session->waitForElementVisible('css', '[name="label"] + * .machine-name-value');
$this->submitForm([], t('Save and continue'), 'field-ui-field-storage-add-form');
$page = $this->getSession()->getPage();
$entity_type_ids_select = $assert_session->selectExists('settings[entity_type_ids][]', $page);
......@@ -187,13 +184,10 @@ class DynamicEntityReferenceTest extends WebDriverTestBase {
$this->drupalGet('/admin/structure/types/manage/test_content/fields/add-field');
$select = $assert_session->selectExists('new_storage_type');
$select->selectOption('dynamic_entity_reference');
// This is needed to execute machine name JS.
$label = $assert_session->fieldExists('label');
$label->focus();
$label->setValue('Foobar');
$label->blur();
$select->focus();
sleep(1);
// Wait for the machine name.
$assert_session->waitForElementVisible('css', '[name="label"] + * .machine-name-value');
$this->submitForm([], t('Save and continue'), 'field-ui-field-storage-add-form');
$page = $this->getSession()->getPage();
$entity_type_ids_select = $assert_session->selectExists('settings[entity_type_ids][]', $page);
......
......@@ -82,7 +82,6 @@ class DynamicEntityReferenceFormatterTest extends EntityKernelTestBase {
->save();
// The label formatter rendering generates links, so build the router.
$this->installSchema('system', 'router');
$this->container->get('router.builder')->rebuild();
FieldStorageConfig::create([
......
......@@ -51,13 +51,6 @@ class EntityQueryRelationshipTest extends EntityKernelTestBase {
*/
protected $fieldName = 'field_test';
/**
* The entity field query factory.
*
* @var \Drupal\Core\Entity\Query\QueryFactory
*/
protected $factory;
/**
* The results returned by EntityQuery.
*
......@@ -101,7 +94,6 @@ class EntityQueryRelationshipTest extends EntityKernelTestBase {
'label' => 'Field test',
'settings' => [],
])->save();
$this->factory = \Drupal::service('entity.query');
}
/**
......@@ -131,7 +123,9 @@ class EntityQueryRelationshipTest extends EntityKernelTestBase {
$this->entities[] = $entity;
// This returns the 0th entity as that's only one pointing to the 0th
// account.
$this->queryResults = $this->factory->get('entity_test')
$this->queryResults = $this->container->get('entity_type.manager')
->getStorage('entity_test')
->getQuery()
->condition("field_test.0.entity:entity_test_rev.name", 'Foobar')
->condition("field_test.1.entity:entity_test_rev.name", 'Barfoo')
->execute();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment