Verified Commit 574ba133 authored by Jess's avatar Jess
Browse files

Issue #3391788 by quietone, xjm: Fix spelling of function names in tests

(cherry picked from commit 3c1a449c)
parent 9ab82dfb
Loading
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@ alphadecimal
alternatif
amphibius
ampm
andif
annot
anonyme
anothermodule
@@ -220,7 +219,6 @@ cádiz
databasename
datas
datelist
dateonly
daterange
datestamp
datetimeiso
@@ -242,7 +240,6 @@ denormalizers
dependee
dependee's
dependees
depenencies
deprioritize
derivedfrom
desaturate
@@ -288,7 +285,6 @@ drupalelementstyle
drupalelementstylecommand
drupalelementstyleediting
drupalelementstyleui
drupalget
drupalhtmlbuilder
drupalimage
drupalin
@@ -394,8 +390,6 @@ funic
furchtbar
gabilondo
gethttpclient
getlist
getview
gids
gloop
gnumeric
@@ -410,7 +404,6 @@ guzzlehttp
gzipped
hande
harkonnen
hasdata
hasher
hashmarks
hateoas
@@ -492,7 +485,6 @@ lamoids
langcode
langcodes
languageswitcher
lazybuilder
libc
libmysqlclient
licious
@@ -504,7 +496,6 @@ linkability
linkback
linkgenerator
linkification
linksby
linkset
linktext
lisu
@@ -660,7 +651,6 @@ opendocument
openxmlformats
optgroups
optin
optionchecker
orgchart
ossp
otel
@@ -983,7 +973,6 @@ testfilename
testfilter
testfunc
testfunction
testget
testgroups
testid
testitem
@@ -994,7 +983,6 @@ testload
testlogger
testname
testproject
testservice
teststring
testsuite
testsuites
+14 −14
Original line number Diff line number Diff line
@@ -34,13 +34,13 @@ protected function getTestFieldType() {
  /**
   * Test default value functionality.
   */
  public function testDateonlyDefaultValue() {
  public function testDateOnlyDefaultValue() {
    // Create a test content type.
    $this->drupalCreateContentType(['type' => 'dateonly_content']);
    $this->drupalCreateContentType(['type' => 'date_only_content']);

    // Create a field storage with settings to validate.
    $field_storage = FieldStorageConfig::create([
      'field_name' => 'field_dateonly',
      'field_name' => 'field_date_only',
      'entity_type' => 'node',
      'type' => 'datetime',
      'settings' => ['datetime_type' => 'date'],
@@ -49,17 +49,17 @@ public function testDateonlyDefaultValue() {

    $field = FieldConfig::create([
      'field_storage' => $field_storage,
      'bundle' => 'dateonly_content',
      'bundle' => 'date_only_content',
    ]);
    $field->save();

    $edit = [
      'fields[field_dateonly][region]' => 'content',
      'fields[field_dateonly][type]' => 'datetime_default',
      'fields[field_date_only][region]' => 'content',
      'fields[field_date_only][type]' => 'datetime_default',
    ];
    $this->drupalGet('admin/structure/types/manage/dateonly_content/form-display');
    $this->drupalGet('admin/structure/types/manage/date_only_content/form-display');
    $this->submitForm($edit, 'Save');
    $this->drupalGet('admin/structure/types/manage/dateonly_content/display');
    $this->drupalGet('admin/structure/types/manage/date_only_content/display');
    $this->submitForm($edit, 'Save');

    // Set now as default_value.
@@ -67,11 +67,11 @@ public function testDateonlyDefaultValue() {
      'set_default_value' => '1',
      'default_value_input[default_date_type]' => 'now',
    ];
    $this->drupalGet('admin/structure/types/manage/dateonly_content/fields/node.dateonly_content.field_dateonly');
    $this->drupalGet('admin/structure/types/manage/date_only_content/fields/node.date_only_content.field_date_only');
    $this->submitForm($edit, 'Save settings');

    // Check that default value is selected in default value form.
    $this->drupalGet('admin/structure/types/manage/dateonly_content/fields/node.dateonly_content.field_dateonly');
    $this->drupalGet('admin/structure/types/manage/date_only_content/fields/node.date_only_content.field_date_only');
    $option_field = $this->assertSession()->optionExists('edit-default-value-input-default-date-type', 'now');
    $this->assertTrue($option_field->hasAttribute('selected'));
    $this->assertSession()->fieldValueEquals('default_value_input[default_date]', '');
@@ -85,20 +85,20 @@ public function testDateonlyDefaultValue() {
      // The time of the request is determined very early on in the request so
      // use the current time prior to making a request.
      $request_time = $this->container->get('datetime.time')->getCurrentTime();
      $this->drupalGet('node/add/dateonly_content');
      $this->drupalGet('node/add/date_only_content');

      $today = $this->dateFormatter->format($request_time, 'html_date', NULL, $timezone);
      $this->assertSession()->fieldValueEquals('field_dateonly[0][value][date]', $today);
      $this->assertSession()->fieldValueEquals('field_date_only[0][value][date]', $today);

      $edit = [
        'title[0][value]' => $timezone,
      ];
      $this->submitForm($edit, 'Save');
      $this->assertSession()->pageTextContains('dateonly_content ' . $timezone . ' has been created');
      $this->assertSession()->pageTextContains('date_only_content ' . $timezone . ' has been created');

      $node = $this->drupalGetNodeByTitle($timezone);
      $today_storage = $this->dateFormatter->format($request_time, 'html_date', NULL, $timezone);
      $this->assertEquals($today_storage, $node->field_dateonly->value);
      $this->assertEquals($today_storage, $node->field_date_only->value);
    }
  }

+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
 *
 * @group datetime
 */
class EntityTestDateonlyTest extends EntityTestResourceTestBase {
class EntityTestDateOnlyTest extends EntityTestResourceTestBase {

  use AnonResourceTestTrait;

@@ -37,7 +37,7 @@ class EntityTestDateonlyTest extends EntityTestResourceTestBase {
   *
   * @var string
   */
  protected static $fieldName = 'field_dateonly';
  protected static $fieldName = 'field_date_only';

  /**
   * {@inheritdoc}
+3 −3
Original line number Diff line number Diff line
@@ -316,9 +316,9 @@ public function datetimeValidationProvider() {
  /**
   * Tests the constraint validations for fields with date only.
   *
   * @dataProvider dateonlyValidationProvider
   * @dataProvider dateOnlyValidationProvider
   */
  public function testDateonlyValidation($value) {
  public function testDateOnlyValidation($value) {
    $this->expectException(AssertionFailedError::class);

    $this->fieldStorage->setSetting('datetime_type', DateTimeItem::DATETIME_TYPE_DATE);
@@ -332,7 +332,7 @@ public function testDateonlyValidation($value) {
  /**
   * Provider for testDatetimeValidation().
   */
  public function dateonlyValidationProvider() {
  public function dateOnlyValidationProvider() {
    return [
      // Valid date strings, but unsupported by DateTimeItem.
      ['Thu, 03 Nov 2014'],
+5 −5
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ public function testEntityCountAndHasData() {
      'bundle' => 'entity_test',
    ])->save();

    $this->assertFalse($field_storage->hasdata(), 'There are no entities with field data.');
    $this->assertFalse($field_storage->hasData(), 'There are no entities with field data.');
    $this->assertSame(0, $this->storage->countFieldData($field_storage), 'There are 0 entities with field data.');

    // Create 1 entity without the field.
@@ -71,7 +71,7 @@ public function testEntityCountAndHasData() {
    $entity->name->value = $this->randomMachineName();
    $entity->save();

    $this->assertFalse($field_storage->hasdata(), 'There are no entities with field data.');
    $this->assertFalse($field_storage->hasData(), 'There are no entities with field data.');
    $this->assertSame(0, $this->storage->countFieldData($field_storage), 'There are 0 entities with field data.');

    // Create 12 entities to ensure that the purging works as expected.
@@ -96,16 +96,16 @@ public function testEntityCountAndHasData() {
      $this->assertEquals(24, $result, 'The field table has 24 rows.');
    }

    $this->assertTrue($field_storage->hasdata(), 'There are entities with field data.');
    $this->assertTrue($field_storage->hasData(), 'There are entities with field data.');
    $this->assertEquals(12, $this->storage->countFieldData($field_storage), 'There are 12 entities with field data.');

    // Ensure the methods work on deleted fields.
    $field_storage->delete();
    $this->assertTrue($field_storage->hasdata(), 'There are entities with deleted field data.');
    $this->assertTrue($field_storage->hasData(), 'There are entities with deleted field data.');
    $this->assertEquals(12, $this->storage->countFieldData($field_storage), 'There are 12 entities with deleted field data.');

    field_purge_batch(6);
    $this->assertTrue($field_storage->hasdata(), 'There are entities with deleted field data.');
    $this->assertTrue($field_storage->hasData(), 'There are entities with deleted field data.');
    $this->assertEquals(6, $this->storage->countFieldData($field_storage), 'There are 6 entities with deleted field data.');

    $entity_type = 'entity_test_rev';
Loading