Skip to content
Snippets Groups Projects
Commit f8a2daf9 authored by Dave Long's avatar Dave Long Committed by Björn Brala
Browse files

Issue #3313046 by longwave, Wim Leers, bbrala: Refactor RDF tests to use core Drupal 10 themes

parent 8d889c47
Branches
Tags
1 merge request!8Issue #3313046: Refactor RDF tests to use core Drupal 10 themes
......@@ -167,14 +167,11 @@ class NodeDisplayConfigurableTest extends NodeTestBase {
public function provideThemes() {
return [
['claro', 'footer', TRUE],
// @todo Remove Classy from data provider in
// https://www.drupal.org/project/drupal/issues/3110137.
['classy', 'footer', TRUE],
// @todo Add coverage for olivero after fixing
// https://www.drupal.org/project/drupal/issues/3215220.
// ['olivero', 'footer', TRUE],
['stable', 'footer', FALSE],
['stable9', 'footer', FALSE],
['starterkit_theme', 'footer', TRUE],
];
}
......
......@@ -24,7 +24,7 @@ class StandardProfileTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'classy';
protected $defaultTheme = 'stark';
/**
* The profile used during tests.
......
......@@ -22,7 +22,7 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
$this->assertFormatterRdfa(['type' => 'number_integer'], 'http://schema.org/baseSalary', ['value' => $testValue]);
// Test that the content attribute is not created.
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__items") and @content]');
$result = $this->xpathContent($this->getRawContent(), '//div[@content]');
$this->assertEmpty($result);
}
......@@ -30,8 +30,6 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
* Tests the integer formatter with settings.
*/
public function testIntegerFormatterWithSettings() {
\Drupal::service('theme_installer')->install(['classy']);
$this->config('system.theme')->set('default', 'classy')->save();
$this->fieldType = 'integer';
$formatter = [
'type' => 'number_integer',
......@@ -50,7 +48,7 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
$this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', ['value' => $testValue]);
// Test that the content attribute is created.
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__item") and @content=:testValue]', [':testValue' => $testValue]);
$result = $this->xpathContent($this->getRawContent(), '//div[@content=:testValue]', [':testValue' => $testValue]);
$this->assertNotEmpty($result);
}
......@@ -65,7 +63,7 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
$this->assertFormatterRdfa(['type' => 'number_unformatted'], 'http://schema.org/baseSalary', ['value' => $testValue]);
// Test that the content attribute is not created.
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__items") and @content]');
$result = $this->xpathContent($this->getRawContent(), '//div[@content]');
$this->assertEmpty($result);
}
......@@ -73,8 +71,6 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
* Tests the float formatter with settings.
*/
public function testFloatFormatterWithSettings() {
\Drupal::service('theme_installer')->install(['classy']);
$this->config('system.theme')->set('default', 'classy')->save();
$this->fieldType = 'float';
$formatter = [
'type' => 'number_decimal',
......@@ -94,7 +90,7 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
$this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', ['value' => $testValue]);
// Test that the content attribute is created.
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__item") and @content=:testValue]', [':testValue' => $testValue]);
$result = $this->xpathContent($this->getRawContent(), '//div[@content=:testValue]', [':testValue' => $testValue]);
$this->assertNotEmpty($result);
}
......@@ -115,7 +111,7 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
$this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', ['value' => $testValue]);
// Test that the content attribute is not created.
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__items") and @content]');
$result = $this->xpathContent($this->getRawContent(), '//div[@content]');
$this->assertEmpty($result);
}
......@@ -123,8 +119,6 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
* Tests the float formatter with a scale. Scale is exercised.
*/
public function testFloatFormatterWithScaleExercised() {
\Drupal::service('theme_installer')->install(['classy']);
$this->config('system.theme')->set('default', 'classy')->save();
$this->fieldType = 'float';
$formatter = [
'type' => 'number_decimal',
......@@ -138,7 +132,7 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
$this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', ['value' => $testValue]);
// Test that the content attribute is created.
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__item") and @content=:testValue]', [':testValue' => $testValue]);
$result = $this->xpathContent($this->getRawContent(), '//div[@content=:testValue]', [':testValue' => $testValue]);
$this->assertNotEmpty($result);
}
......@@ -153,7 +147,7 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
$this->assertFormatterRdfa(['type' => 'number_decimal'], 'http://schema.org/baseSalary', ['value' => $testValue]);
// Test that the content attribute is not created.
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__items") and @content]');
$result = $this->xpathContent($this->getRawContent(), '//div[@content]');
$this->assertEmpty($result);
}
......@@ -161,8 +155,6 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
* Tests the decimal formatter with settings.
*/
public function testDecimalFormatterWithSettings() {
\Drupal::service('theme_installer')->install(['classy']);
$this->config('system.theme')->set('default', 'classy')->save();
$this->fieldType = 'decimal';
$formatter = [
'type' => 'number_decimal',
......@@ -182,7 +174,7 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
$this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', ['value' => $testValue]);
// Test that the content attribute is created.
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__item") and @content=:testValue]', [':testValue' => $testValue]);
$result = $this->xpathContent($this->getRawContent(), '//div[@content=:testValue]', [':testValue' => $testValue]);
$this->assertNotEmpty($result);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment