Comments

neclimdul created an issue. See original summary.

neclimdul’s picture

StatusFileSize
new3.25 KB
new2.76 KB

Interdiff from the last patch in parent issue.

neclimdul’s picture

Title: Skip the row when we don't recognize the the field type » Test coverage for FieldTypeDefaults process plugin
phenaproxima’s picture

Status: Active » Needs work

Looks good but I have nits, as I often do...

  1. +++ b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldTypeDefaultsTest.php
    @@ -0,0 +1,48 @@
    +   * Test that various default cases.
    +   *
    

    "Test that various default cases"? :)

  2. +++ b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldTypeDefaultsTest.php
    @@ -0,0 +1,48 @@
    +    $this->assertNull($plugin->transform(NULL, $this->migrateExecutable, $this->row, 'property'));
    +    $this->assertEquals('string', $plugin->transform('string', $this->migrateExecutable, $this->row, 'property'));
    +    $this->assertEquals(1234, $plugin->transform(1234, $this->migrateExecutable, $this->row, 'property'));
    +    $this->assertEquals('datetime_default', $plugin->transform([], $this->migrateExecutable, $this->row, 'property'));
    

    I'd like to see a few comments here explaining the input and why the expected output is expected.

  3. +++ b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldTypeDefaultsTest.php
    @@ -0,0 +1,48 @@
    +  /**
    +   * @covers ::transform
    +   */
    +  public function testDefaultsException() {
    

    There's no explanatory line in the doc comment...

  4. +++ b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldTypeDefaultsTest.php
    @@ -0,0 +1,48 @@
    +    $plugin = new FieldTypeDefaults([], 'field_type_defaults', []);
    

    This is repeated in testDefaults(); can it go in setUp()?

neclimdul’s picture

StatusFileSize
new3.08 KB
new2.59 KB
neclimdul’s picture

Status: Needs work » Needs review

thanks, some patches.... and a distracted posting.

quietone’s picture

From a recent learning experience with jhodgdon I've learned that function summary lines start with a third person singular present tense verb. Let's see if I got it right.

+++ b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldTypeDefaultsTest.php
@@ -0,0 +1,59 @@
+   * Test various default cases.

s/Test/Tests

+++ b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldTypeDefaultsTest.php
@@ -0,0 +1,59 @@
+   * When given an array that is not a date field we throw an exception.

Change to something like "Tests that an exception is thrown when the input is not a date field."

quietone’s picture

From IRC discussion with heddn, I've made a new patch to address items in #7.

quietone’s picture

Status: Needs review » Reviewed & tested by the community

And further from that discussion, IIRC, it was suggested that I could RTBC this after making the small change above.

neclimdul’s picture

Agreed. Thanks.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed e145d63 and pushed to 8.0.x and 8.1.x. Thanks!

  • alexpott committed cf0d367 on 8.1.x
    Issue #2628418 by neclimdul, quietone: Test coverage for...

  • alexpott committed e145d63 on
    Issue #2628418 by neclimdul, quietone: Test coverage for...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.