Comments

linclark’s picture

Status: Active » Needs review
StatusFileSize
new1.55 KB
new3.88 KB

This just tests the text_plain formatter, which is the default when text module is enabled. Still needs test for the formatter that email defines.

linclark’s picture

Status: Needs review » Needs work

This needs to be rerolled based on changes in the base class.

linclark’s picture

Status: Needs work » Needs review
StatusFileSize
new1.1 KB
new1.84 KB
new4.66 KB

Rerolled and added tests for the MailToFormatter. There's also a switch from the fake URI to a real one. THis isn't really necessary until the formatters patch, but doesn't do any harm.

jesse.d’s picture

scor’s picture

Status: Needs review » Needs work
kay_v’s picture

Status: Needs work » Needs review
StatusFileSize
new1.84 KB
kay_v’s picture

StatusFileSize
new1.84 KB

renaming and re-posting patch to prepend issue number

scor’s picture

Title: Test email formatter RDFa output » Support RDFa output in email formatter
Issue summary: View changes
Status: Needs review » Needs work

As far as I can tell, we don't need to alter the email field formatter to support RDFa, since the wrapping element will receive the property attribute (default behavior). The test might need to be added for that though.

scor’s picture

Issue tags: +schema.org, +RDFa

Minor fixes needed.

  1. +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/EmailFieldRdfaTest.php
    @@ -0,0 +1,64 @@
    +class EmailFieldRdfaTest extends FieldRdfaTestBase {
    

    The class needs to be documented, for example this is taken from the text field test:
    +/**
    + * Tests the placement of RDFa in text field formatters.
    + */
    +class TextFieldRdfaTest extends FieldRdfaTestBase {

  2. +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/EmailFieldRdfaTest.php
    @@ -0,0 +1,64 @@
    +      'name'  => 'Field formatter - email',
    

    The title needs to be consistent with other similar tests, for example:
    'name' => 'Field formatter: text',

kay_v’s picture

Status: Needs work » Needs review
StatusFileSize
new1.91 KB
new846 bytes

code style fixes described in #9

The last submitted patch, 10: 2034975-10-email-field-test.patch, failed testing.

kay_v’s picture

StatusFileSize
new1.91 KB
new847 bytes

fixed typo -was missing slash in comment tag (line 11)

scor’s picture

Status: Needs review » Needs work
+++ b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/EmailFieldRdfaTest.php
@@ -0,0 +1,67 @@
+/**
+* Tests the placement of RDFa in email field formatters.
+*/
+class EmailFieldRdfaTest extends FieldRdfaTestBase {

Indentation issues, should be:

/**
 * Tests the placement of RDFa in text field formatters.
 */
class ...

(note the leading space on the second and third lines)

kay_v’s picture

StatusFileSize
new849 bytes
new1.91 KB

spacing fix (thanks for catching!)

kay_v’s picture

Status: Needs work » Needs review
scor’s picture

Status: Needs review » Needs work
+++ b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/EmailFieldRdfaTest.php
@@ -0,0 +1,67 @@
+    $this->entity->save();
+    $uri_info = $this->entity->uri();
+    $this->uri = url($uri_info['path']);

These lines are not needed for the purpose of this test.

scor’s picture

Issue tags: +RDF code sprint
krlucas’s picture

StatusFileSize
new1.8 KB
new662 bytes

Remove the lines referenced in #16

krlucas’s picture

Status: Needs work » Needs review
scor’s picture

Status: Needs review » Reviewed & tested by the community

Thanks Kelly. Patch looks good now.

alexpott’s picture

Title: Support RDFa output in email formatter » Test RDFa output in email formatter
Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/EmailFieldRdfaTest.php
@@ -0,0 +1,64 @@
+  /**
+   * Tests the plain formatter.
+   */
+  public function testPlainFormatter() {
+    $this->assertFormatterRdfa('text_plain', 'http://schema.org/email', $this->testValue);
+  }
+
+  /**
+   * Tests the mailto formatter.
+   */
+  public function testMailToFormatter() {
+    $this->assertFormatterRdfa('email_mailto', 'http://schema.org/email', $this->testValue);
+  }

Having two tests here means that we have to run test setup twice. Which looks a bit unnecessary - how about a testFormatters method with two assertions?

kay_v’s picture

Status: Needs work » Needs review
StatusFileSize
new1.71 KB
new792 bytes

combined assertions into single method per #21

Status: Needs review » Needs work

The last submitted patch, 22: interdiff-2034975-18-22.patch, failed testing.

scor’s picture

+++ b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/EmailFieldRdfaTest.php
@@ -51,14 +51,8 @@ public function setUp() {
    * Tests the plain formatter.

Needs to be updated to say "Tests all the formatters.". Maybe also keep the comment for each assertion as well.

kay_v’s picture

StatusFileSize
new1.78 KB
new903 bytes

corrected general comment on method and added comment for each assertion per #24

kay_v’s picture

Status: Needs work » Needs review
scor’s picture

Status: Needs review » Reviewed & tested by the community

All tests have been merged into one per #21 recommendation in #21. back to RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 2020cb4 and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

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