Drupal core update.

This commit is contained in:
Dan Chadwick 2024-09-07 14:04:34 -04:00
parent 025c63e1dd
commit 57da5fed63
8 changed files with 1796 additions and 174 deletions

View File

@ -2,5 +2,6 @@
"$schema": "/Users/danchadwick/.local/share/nvim/mason/packages/phpactor/phpactor.schema.json",
"language_server_phpstan.enabled": false,
"php_code_sniffer.enabled": false,
"prophecy.enabled": false
"prophecy.enabled": false,
"behat.enabled": true
}

View File

@ -25,6 +25,7 @@
"drupal/core-project-message": "^10.3",
"drupal/core-recommended": "^10.3",
"drupal/devel_entity_updates": "^4.1",
"drupal/entity_hierarchy": "^3.3",
"drupal/field_group": "^3.4",
"drupal/flexslider": "^3.0@alpha",
"drupal/gin": "^3.0@RC",
@ -124,6 +125,9 @@
}
},
"require-dev": {
"drupal/core-dev": "^10"
"behat/behat": "^3.14",
"dmore/behat-chrome-extension": "^1.4",
"drupal/core-dev": "^10",
"drupal/drupal-extension": "^5.0"
}
}

1835
composer.lock generated

File diff suppressed because it is too large Load Diff

5
features/base.feature Normal file
View File

@ -0,0 +1,5 @@
@api
Feature: Baseline Tests
Scenario: Ensure Site is Accessible
Given I am on "/user"
Then the response status code should be 200

View File

@ -0,0 +1,82 @@
<?php
use Behat\Gherkin\Node\PyStringNode;
use Drupal\DrupalExtension\Context\RawDrupalContext;
use PHPUnit\Framework\Assert;
use Drupal\user\Entity\Role;
use Behat\Gherkin\Node\TableNode;
use Drupal\node\Entity\NodeType;
use Drupal\media\Entity\MediaType;
use Drupal\block_content\Entity\BlockContentType;
/**
* Defines application features from the specific context.
*/
class FeatureContext extends RawDrupalContext
{
/**
* Initializes context.
*
* Every scenario gets its own context instance.
* You can also pass arbitrary arguments to the
* context constructor through behat.yml.
*/
public function __construct()
{
}
/**
* @Then the response status code should be :arg1
*/
public function theResponseStatusCodeShouldBe($arg1)
{
throw new PendingException();
}
/**
* @Given the :arg1 content type exists
*
* Examples:
* Given the "blog" content type exists
*
* @throws \Exception;
*/
public function contentTypeExists($string) {
$node_type = NodeType::load($string);
if (empty($node_type)) {
throw new \Exception('Content type ' . $string . ' does not exist.');
}
}
/**
* @Given I am logged in as a user with the :arg1 role
*/
public function iAmLoggedInAsAUserWithTheRole($arg1)
{
throw new PendingException();
}
/**
* @Given I am on :arg1
*/
public function iAmOn($arg1)
{
throw new PendingException();
}
/**
* @Then I should see the link :arg1 in the :arg2 region
*/
public function iShouldSeeTheLinkInTheRegion($arg1, $arg2)
{
throw new PendingException();
}
/**
* @Given I am not logged in
*/
public function iAmNotLoggedIn()
{
throw new PendingException();
}
}

View File

@ -0,0 +1,13 @@
@api
Feature: Ensure content types are available
Scenario: Make sure the Fighter content type is set up correctly.
Given I am logged in as a user with the "administrator" role
And I am on "/node/add/fighter"
Then I should see the link "My account" in the "header" region
And I should see the link "Log out" in the "header" region
Scenario: Make sure that anonymous users see the account menu
Given I am not logged in
And I am on "/"
Then I should see the link "Log in" in the "header" region

21
web/behat.yml Normal file
View File

@ -0,0 +1,21 @@
default:
suites:
default:
contexts:
- FeatureContext
- Drupal\DrupalExtension\Context\DrupalContext
- Drupal\DrupalExtension\Context\MinkContext
extensions:
DMore\ChromeExtension\Behat\ServiceContainer\ChromeExtension: ~
Behat\MinkExtension:
goutte: ~
base_url: https://dchadwick.ddev.site/
browser_name: chrome
javascript_session: default
browserkit_http: ~
files_path: "%paths.base%/media"
Drupal\DrupalExtension:
blackbox: ~
api_driver: drupal
drupal:
drupal_root: web/

View File

@ -5,7 +5,8 @@
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
/**
* Class EntityTypeSubscriber.
@ -38,7 +39,7 @@ public function onRequest(RequestEvent $event) {
$current_request = \Drupal::requestStack()->getCurrentRequest();
$path = \Drupal::request()->getRequestUri();
if (str_contains($path, '/node/')) {
return new NotFoundHttpException();
/* throw new AccessDeniedHttpException(); */
}
}
}