Comments

linclark’s picture

Status: Active » Needs review
StatusFileSize
new3.5 KB
linclark’s picture

Status: Needs review » Needs work

This should be refactored to make use of the FieldRdfaTestBase class.

linclark’s picture

Status: Needs work » Needs review
StatusFileSize
new4.53 KB
new2.56 KB
new5.37 KB

Made the test depend on the base class.

scor’s picture

jesse.d’s picture

Test passed locally.

Manual review looked good.

scor’s picture

Status: Needs review » Needs work
jesse.d’s picture

StatusFileSize
new2.56 KB

This is linclark's 2030929-03-text-formatter-test-do-not-test.patch, renamed for clarity. It does not include the base class, which was was committed in #2034977

jesse.d’s picture

Status: Needs work » Needs review

Setting to needs review

jesse.d’s picture

Issue summary: View changes

Added parent META issue.

scor’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +schema.org, +RDFa
  1. --- /dev/null
    +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/TextFieldRdfaTest.php
    

    should be in the Field directory inside Tests.

  2. +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/TextFieldRdfaTest.php
    @@ -0,0 +1,98 @@
    + * @file
    + * Contains \Drupal\rdf\Tests\TextFieldRdfaTest.
    + */
    +
    +namespace Drupal\rdf\Tests;
    

    same

  3. +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/TextFieldRdfaTest.php
    @@ -0,0 +1,98 @@
    + * Test the placement of RDFa in text field formatters.
    

    "Tests..."

  4. +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/TextFieldRdfaTest.php
    @@ -0,0 +1,98 @@
    +  /**
    +   * Modules to enable.
    +   *
    +   * @var array
    +   */
    +  public static $modules = array('text');
    

    should be:
    /**
    * {@inheritdoc}
    */

  5. +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/TextFieldRdfaTest.php
    @@ -0,0 +1,98 @@
    +      'name'  => 'Field formatter - text',
    

    Let's be consistent with taxonomy test which reads:
    'Field formatter: taxonomy term reference'

chrisfromredfin’s picture

Status: Needs work » Needs review
StatusFileSize
new2.56 KB

Patch with feedback from 9 above.

chrisfromredfin’s picture

StatusFileSize
new1.4 KB

interdiff provided

Status: Needs review » Needs work

The last submitted patch, 10: 2030929-rdf-text_formatter_test-10.patch, failed testing.

scor’s picture

Status: Needs work » Needs review
scor’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @cwells! This test is good to go.

webchick’s picture

Status: Reviewed & tested by the community » Needs review

Yay, tests!

One question. When there are separate testFoo methods, each one will re-bootstrap the environment. Do we actually need a clean rebuild between each test run? Or will one bootstrap suffice? If so, we might want to do all of those assertions under one testX() function to save a bit of testbot time.

This is just a question, if it's incorrect feel free to post back to RTBC. In case it needs a re-roll, there's a tiny indentation problem in the PHPDoc above public static $modules. Else I can fix it on commit.

scor’s picture

Status: Needs review » Reviewed & tested by the community

FieldRdfaTestBase which this test extends is actually a unit test (extends FieldUnitTestBase), and therefore it's ultra fast. There is no install going on here. Settings back to RTBC for re-evaluation.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Yeah, saw that, but it's actually a *Drupal*UnitTestCase which I thought did some (light) bootstrapping before each testX method. But if the performance gain isn't worth it, we can go with this.

Committed and pushed to 8.x. Thanks!

kay_v’s picture

Currently working on same for number formatter. Are concerns raised in comments #15-17 something to address before implementing the pattern in this patch?

scor’s picture

No, the number formatter should follow the same approach of using/extending FieldUnitTestBase.

Status: Fixed » Closed (fixed)

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