Skip to content
Snippets Groups Projects
12 unresolved threads

#3328489 Fixing phpcs issues.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
28 28 * Process callback.
29 29 */
30 30 public static function process(&$element, FormStateInterface $form_state, &$complete_form) {
31 $value = !empty($element['#default_value']) ? $element['#default_value'] : ['interval' => NULL, 'period' => NULL];
31 $value = !empty($element['#default_value']) ? $element['#default_value'] : [
32 'interval' => NULL,
33 'period' => NULL,
34 ];
  • 143 143 /**
    144 144 * {@inheritdoc}
    145 145 */
    146 public function buildPHPString() {
    146 public function buildPhpString() {
    • Comment on lines -146 to +146

      this is an API break, we can't rename the function without adding a BC layer. So that will require triggering a deprecation error and calling the new method

    • Please register or sign in to reply
  • 14 15 */
    15 16 class IntervalTest extends BrowserTestBase {
    16 17
    18 use StringTranslationTrait;
  • 74 81 'field_name' => 'foobar',
    75 82 'new_storage_type' => 'interval',
    76 83 ];
    77 $this->submitForm($edit, t('Save and continue'));
    84 $this->submitForm($edit, $this->t('Save and continue'));
  • 75 82 'new_storage_type' => 'interval',
    76 83 ];
    77 $this->submitForm($edit, t('Save and continue'));
    84 $this->submitForm($edit, $this->t('Save and continue'));
    78 85 $this->submitForm([
    79 86 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
    80 ], t('Save field settings'));
    87 ], $this->t('Save field settings'));
    81 88
    82 $this->submitForm([], t('Save settings'));
    83 $this->assertSession()->responseContains(t('Saved %name configuration', ['%name' => 'Foobar']));
    89 $this->submitForm([], $this->t('Save settings'));
    90 $this->assertSession()->responseContains($this->t('Saved %name configuration', ['%name' => 'Foobar']));
    84 91
    85 92 // Setup widget and formatters.
    86 93 EntityFormDisplay::load('entity_test.entity_test.default')
  • 119 126 'user_id[0][target_id]' => 'foo (' . $this->adminUser->id() . ')',
    120 127 ];
    121 128
    122 $this->submitForm($edit, t('Save'));
    129 $this->submitForm($edit, $this->t('Save'));
  • 164 171 // Remove one child.
    165 172 'field_foobar[2][interval]' => '',
    166 173 ];
    167 $this->submitForm($edit, t('Save'));
    174 $this->submitForm($edit, $this->t('Save'));
  • 18 18 * A field storage to use in this test class.
    19 19 *
    20 20 * @var \Drupal\field\Entity\FieldStorageConfig
    21 * The configuration field storage.
  • 25 26 * The field used in this test class.
    26 27 *
    27 28 * @var \Drupal\field\Entity\FieldConfig
    29 * The FieldConfig.
  • 36 38 protected static $modules = ['interval'];
    37 39
    38 40 /**
    39 * @inheritDoc
    41 * Sets the default field storage backend for fields created during tests.
    42 *
    43 * {@inheritdoc}
  • 63 67 */
    64 68 public function testValueChange() {
    65 69
    66 // Verify entity creation.
    70 // Verify the entity creation.
    67 71 $entity = EntityTest::create();
    68 72 $value = ['interval' => 30, 'period' => 'minute'];
    69 73 $entity->field_interval = $value;
    70 74 $entity->name->value = $this->randomMachineName();
    71 75 $this->entityValidateAndSave($entity);
    72 76
    73 // Verify initial field value
    77 // Verify the initial field value.
    74 78 $this->assertEquals($entity->field_interval->interval, $value['interval']);
  • 5 5 * Defines an interval field.
    6 6 * @copyright Copyright(c) 2011 Rowlands Group
    7 7 * @license GPL v2+ http://www.fsf.org/licensing/licenses/gpl.html
    8 * @author Lee Rowlands leerowlands at rowlandsgroup dot com
  • Left some comments. We shouldn't use t() in tests, so those can just be removed rather than changed to $this->t()

  • added 1 commit

    Compare with previous version

  • Shashank S added 1 commit

    added 1 commit

    Compare with previous version

  • Please register or sign in to reply
    Loading