Skip to content
Snippets Groups Projects
Commit c09647d7 authored by Elliot Ward's avatar Elliot Ward
Browse files

#3092722: remove contradictory comment from testLabelAttributeSetting()....

#3092722:  remove contradictory comment from testLabelAttributeSetting(). Update testLabelAttributeSetting() to test two different label settings.
parent 7063158f
No related branches found
No related tags found
No related merge requests found
......@@ -90,13 +90,15 @@ class JsonApiReferenceFieldFormatterTest extends JsonApiReferenceFieldBase {
* Test the formatter setting 'label_attribute'.
*/
public function testLabelAttributeSetting() {
// By setting the 'label_attribute' setting to 'created', we can expect the
// time the content was created to be used as the label.
$this->setDisplaySettings('label', 'drupal_internal__nid');
$this->setDisplaySettings('label', 'title');
$this->drupalGet('node/' . $this->referenceContent->id());
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->responseContains("<div>{$this->referencedContent->getTitle()}</div>");
$this->setDisplaySettings('label', 'drupal_internal__nid');
$this->drupalGet('node/' . $this->referenceContent->id());
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->responseContains('<div>1</div>');
$this->assertSession()->responseContains("<div>{$this->referencedContent->id()}</div>");
$this->drupalLogout();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment