Skip to content
Snippets Groups Projects
Commit a07928c6 authored by Stephen Lucero's avatar Stephen Lucero
Browse files

Issue #3416288: Bump minimum requirements: PHP 8.1 and Drupal 10.1

parent adb1ac0a
No related branches found
No related tags found
1 merge request!98#3416288: Bump minimum PHP and Drupal core requirements.
...@@ -14,16 +14,14 @@ ...@@ -14,16 +14,14 @@
], ],
"license": "MIT", "license": "MIT",
"require": { "require": {
"php": ">=7.4.0", "php": ">=8.1",
"ext-json": "*", "ext-json": "*",
"marcj/topsort": "^2.0.0", "marcj/topsort": "^2.0.0",
"swaggest/json-schema": "^0.12", "swaggest/json-schema": "^0.12",
"symfony/finder": "^3.4 || ^4 || ^6", "symfony/finder": "^4 || ^5 || ^6",
"symfony/polyfill-php80": "^1", "symfony/serializer": "^4 || ^5 || ^6",
"symfony/polyfill-php81": "^1", "symfony/property-access": "^4 || ^5 || ^6",
"symfony/serializer": "^3.4 || ^4 || ^6", "symfony/yaml": "^4 || ^5 || ^6",
"symfony/property-access": "^3.4 || ^4 || ^6",
"symfony/yaml": "^3.4 || ^4 || ^6",
"webmozart/assert": "^1.0", "webmozart/assert": "^1.0",
"webmozart/path-util": "^2.1.0" "webmozart/path-util": "^2.1.0"
}, },
......
...@@ -2,6 +2,6 @@ name: Patternkit Example ...@@ -2,6 +2,6 @@ name: Patternkit Example
description: Adds Patternkit example patterns. description: Adds Patternkit example patterns.
type: module type: module
package: Presentation Framework package: Presentation Framework
core_version_requirement: ^9 || ^10 core_version_requirement: ^10
dependencies: dependencies:
- patternkit - patternkit
...@@ -2,7 +2,7 @@ name: Patternkit Media Library Support ...@@ -2,7 +2,7 @@ name: Patternkit Media Library Support
description: Adds Media Library Support to upload fields. description: Adds Media Library Support to upload fields.
type: module type: module
package: Presentation Framework package: Presentation Framework
core_version_requirement: ^9 || ^10 core_version_requirement: ^10
configure: patternkit.settings configure: patternkit.settings
dependencies: dependencies:
- drupal:media_library - drupal:media_library
......
...@@ -2,8 +2,7 @@ name: Patternkit Usage Tracking ...@@ -2,8 +2,7 @@ name: Patternkit Usage Tracking
description: Adds tracking for where patterns are in use. description: Adds tracking for where patterns are in use.
type: module type: module
package: Presentation Framework package: Presentation Framework
core_version_requirement: ^9 || ^10 core_version_requirement: ^10
dependencies: dependencies:
- patternkit:patternkit - patternkit:patternkit
php: 7.4
lifecycle: experimental lifecycle: experimental
...@@ -613,7 +613,7 @@ class UsageRevisionHelperTest extends UnitTestCase { ...@@ -613,7 +613,7 @@ class UsageRevisionHelperTest extends UnitTestCase {
'component_uuid' => $uuids[1], 'component_uuid' => $uuids[1],
'pattern_id' => $patterns['nested'], 'pattern_id' => $patterns['nested'],
'is_nested' => TRUE, 'is_nested' => TRUE,
'content_path' => $nested_path = "$patterns[1]=>${patterns['nested']}", 'content_path' => $nested_path = "$patterns[1]=>{$patterns['nested']}",
'layout_path' => "1.$uuids[1]:$nested_path", 'layout_path' => "1.$uuids[1]:$nested_path",
], ],
], ],
...@@ -696,7 +696,7 @@ class UsageRevisionHelperTest extends UnitTestCase { ...@@ -696,7 +696,7 @@ class UsageRevisionHelperTest extends UnitTestCase {
'register' => [ 'register' => [
[ [
$patterns['nested'], $patterns['nested'],
"1.$uuids[1]:" . ($nested_path = "$patterns[1]=>${patterns['nested']}"), "1.$uuids[1]:" . ($nested_path = "$patterns[1]=>{$patterns['nested']}"),
], ],
], ],
'update' => [ 'update' => [
...@@ -769,7 +769,7 @@ class UsageRevisionHelperTest extends UnitTestCase { ...@@ -769,7 +769,7 @@ class UsageRevisionHelperTest extends UnitTestCase {
'component_uuid' => $uuids[1], 'component_uuid' => $uuids[1],
'pattern_id' => $patterns['nested'], 'pattern_id' => $patterns['nested'],
'is_nested' => TRUE, 'is_nested' => TRUE,
'content_path' => $nested_path = "$patterns[1]=>${patterns['nested']}", 'content_path' => $nested_path = "$patterns[1]=>{$patterns['nested']}",
'layout_path' => "1.$uuids[1]:$nested_path", 'layout_path' => "1.$uuids[1]:$nested_path",
], ],
], ],
...@@ -848,7 +848,7 @@ class UsageRevisionHelperTest extends UnitTestCase { ...@@ -848,7 +848,7 @@ class UsageRevisionHelperTest extends UnitTestCase {
// Register the new nested pattern. // Register the new nested pattern.
[ [
$patterns['nested'], $patterns['nested'],
"1.$uuids[1]:" . ($nested_path = "$patterns[1]=>${patterns['nested']}"), "1.$uuids[1]:" . ($nested_path = "$patterns[1]=>{$patterns['nested']}"),
], ],
], ],
'update' => [ 'update' => [
...@@ -934,7 +934,7 @@ class UsageRevisionHelperTest extends UnitTestCase { ...@@ -934,7 +934,7 @@ class UsageRevisionHelperTest extends UnitTestCase {
// Register a new nested pattern within the updated component. // Register a new nested pattern within the updated component.
[ [
$patterns['nested'], $patterns['nested'],
"2.$uuids[1]:" . ($new_nested_path = "$patterns[1]=>${patterns['nested']}"), "2.$uuids[1]:" . ($new_nested_path = "$patterns[1]=>{$patterns['nested']}"),
], ],
], ],
'update' => [ 'update' => [
......
...@@ -2,8 +2,8 @@ name: Patternkit ...@@ -2,8 +2,8 @@ name: Patternkit
description: Adds Patternkit patterns as blocks. description: Adds Patternkit patterns as blocks.
type: module type: module
package: Presentation Framework package: Presentation Framework
core_version_requirement: ^9 || ^10 core_version_requirement: ^10
configure: patternkit.settings configure: patternkit.settings
dependencies: dependencies:
- drupal:block_content - drupal:block_content
php: 7.4 php: 8.1
...@@ -73,6 +73,20 @@ class Pattern extends ContentEntityBase implements PatternInterface { ...@@ -73,6 +73,20 @@ class Pattern extends ContentEntityBase implements PatternInterface {
*/ */
protected bool $bundled = FALSE; protected bool $bundled = FALSE;
/**
* An array of the current Pattern instance's configuration values.
*
* @var array
*/
public array $config = [];
/**
* An array of the current Pattern instance's contexts.
*
* @var array
*/
public array $context = [];
/** /**
* Constructs a new Pattern object, without permanently saving it. * Constructs a new Pattern object, without permanently saving it.
* *
......
...@@ -36,6 +36,13 @@ class JSONSchemaEditorTraitTest extends UnitTestCase { ...@@ -36,6 +36,13 @@ class JSONSchemaEditorTraitTest extends UnitTestCase {
*/ */
protected ObjectProphecy $fileUrlGenerator; protected ObjectProphecy $fileUrlGenerator;
/**
* A mocked editor plugin manager service.
*
* @var \Prophecy\Prophecy\ObjectProphecy<\Drupal\editor\Plugin\EditorManager>
*/
protected ObjectProphecy $editorPluginManager;
/** /**
* A mocked query string service. * A mocked query string service.
* *
......
...@@ -4,6 +4,7 @@ namespace Drupal\Tests\patternkit\Unit; ...@@ -4,6 +4,7 @@ namespace Drupal\Tests\patternkit\Unit;
use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\StringTranslation\TranslationInterface;
use Drupal\patternkit\Element\Pattern; use Drupal\patternkit\Element\Pattern;
use Drupal\patternkit\Entity\Pattern as EntityPattern;
use Drupal\patternkit\Entity\PatternInterface; use Drupal\patternkit\Entity\PatternInterface;
use Drupal\patternkit\Exception\SchemaValidationException; use Drupal\patternkit\Exception\SchemaValidationException;
use Drupal\patternkit\Exception\UnknownPatternException; use Drupal\patternkit\Exception\UnknownPatternException;
...@@ -173,7 +174,7 @@ class PatternElementTest extends RendererTestBase { ...@@ -173,7 +174,7 @@ class PatternElementTest extends RendererTestBase {
]; ];
$this->libraryPlugin->expects($this->once()) $this->libraryPlugin->expects($this->once())
->method('render') ->method('render')
->with($this->callback(function ($arg) use ($patternMock, $element) { ->with($this->callback(function ($arg) use ($patternMock): bool {
return $arg[0] == $patternMock; return $arg[0] == $patternMock;
})) }))
->willReturn($returnValue); ->willReturn($returnValue);
...@@ -283,7 +284,10 @@ class PatternElementTest extends RendererTestBase { ...@@ -283,7 +284,10 @@ class PatternElementTest extends RendererTestBase {
* A mocked pattern entity for testing. * A mocked pattern entity for testing.
*/ */
protected function getPatternMock(): PatternInterface { protected function getPatternMock(): PatternInterface {
$patternMock = $this->createMock(PatternInterface::class); // Mock the implementation class instead of the interface to sidestep
// assignment to dynamic property deprecation warnings for instance
// variables declared on the class.
$patternMock = $this->createMock(EntityPattern::class);
$patternMock->expects($this->once()) $patternMock->expects($this->once())
->method('getCacheTags') ->method('getCacheTags')
->willReturn([]); ->willReturn([]);
......
...@@ -176,7 +176,9 @@ JSON; ...@@ -176,7 +176,9 @@ JSON;
$randomTitle = $this->getRandomGenerator()->name(); $randomTitle = $this->getRandomGenerator()->name();
$expected = str_replace('[node:title]', $randomTitle, $value); $expected = str_replace('[node:title]', $randomTitle, $value);
$node = $this->createMock(NodeInterface::class); $node = $this->createMock(NodeInterface::class);
$node->title = $randomTitle; $node->method('get')
->with('title')
->willReturn($randomTitle);
// Ensure the replacePlain method is not invoked for html formatted strings. // Ensure the replacePlain method is not invoked for html formatted strings.
$this->token->expects($this->never()) $this->token->expects($this->never())
...@@ -212,7 +214,9 @@ JSON; ...@@ -212,7 +214,9 @@ JSON;
$randomTitle = $this->getRandomGenerator()->name(); $randomTitle = $this->getRandomGenerator()->name();
$expected = str_replace('[node:title]', $randomTitle, $value); $expected = str_replace('[node:title]', $randomTitle, $value);
$node = $this->createMock(NodeInterface::class); $node = $this->createMock(NodeInterface::class);
$node->title = $randomTitle; $node->method('get')
->with('title')
->willReturn($randomTitle);
// Ensure the replace method is not invoked for plain text strings. // Ensure the replace method is not invoked for plain text strings.
$this->token->expects($this->never()) $this->token->expects($this->never())
......
...@@ -13,6 +13,13 @@ use Drupal\Tests\UnitTestCase; ...@@ -13,6 +13,13 @@ use Drupal\Tests\UnitTestCase;
*/ */
class SchemaRefHandlerTest extends UnitTestCase { class SchemaRefHandlerTest extends UnitTestCase {
/**
* The schema ref handler instance being tested.
*
* @var \Drupal\patternkit\Schema\SchemaRefHandler
*/
protected SchemaRefHandler $schemaRefHandler;
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment