Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
Rename patch, add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
phenaproxima committed Jul 31, 2024
1 parent d7442d8 commit fd36151
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
"#3464550: Create config action which can create an entity for every bundle of another entity type": "./patches/core/8975.patch",
"#3303127: Determine which core config entity methods should be config actions": "./patches/core/7940.patch",
"Allow arbitrary callables to provide input to recipes": "./patches/core/recipe-callable-input.patch",
"#3416357: Convert QueueFactory to use a service locator": "./patches/core/queue-factory-container-aware.diff"
"#3416357: Convert QueueFactory to use a service locator": "./patches/core/3416357-10.3.x-only.patch"
},
"drupal/automatic_updates": {
"#3463662: When it is installed, Package Manager should try to detect the paths of Composer and rsync": "./patches/automatic_updates/automatic_updates-1085.patch"
Expand Down
17 changes: 12 additions & 5 deletions tests/src/ExistingSite/MetaTagsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Drupal\Tests\starshot\ExistingSite;

use Drupal\Core\Config\ConfigFactoryInterface;
use Behat\Mink\Element\NodeElement;
use Drupal\Core\File\FileUrlGeneratorInterface;
use Drupal\file\Entity\File;
use Drupal\media\Entity\Media;
Expand All @@ -20,17 +20,24 @@ class MetaTagsTest extends ExistingSiteBase {
*/
public function testFrontPageMetaTags(): void
{
$expected_title = 'I say potato, you say potato';
// Create a random title expectation.
$expected_title = $this->getRandomGenerator()->name();

// Set the site name.
$this->container->get(ConfigFactoryInterface::class)
->getEditable('system.site')
$config_factory = $this->container->get('config.factory');
$config_factory->getEditable('system.site')
->set('name', $expected_title)
->save();

// Get the front page title.
$this->drupalGet('<front>');
$this->assertSession()->titleEquals($expected_title);
$title_tag = $this->getSession()
->getPage()
->find('xpath', '/head/title');
assert($title_tag instanceof NodeElement, 'Ensure that the "<title>" tag is found.');
$actual_title = $title_tag->getText();

$this->assertEquals($expected_title, $actual_title, 'Page title matches expected.');
}

/**
Expand Down

0 comments on commit fd36151

Please sign in to comment.