Skip to content
Snippets Groups Projects
Commit 34d45c1b authored by Christian Foidl's avatar Christian Foidl
Browse files

Resolve #3500543 "File loader not found"

parent c823ad6d
No related branches found
No related tags found
1 merge request!7Resolve #3500543 "File loader not found"
Pipeline #400666 passed
......@@ -35,5 +35,5 @@ lint-test:
nix develop ".#$DEVSHELL" -c composer unit
parallel:
matrix:
- DEVSHELL: [php81_drupal10, php82_drupal10, php83_drupal10, php83_drupal11]
- DEVSHELL: [php81_drupal103, php83_drupal103, php83_drupal104, php84_drupal104, php83_drupal11, php84_drupal11]
......@@ -9,6 +9,7 @@
"drupal/verification": "^2.0@beta"
},
"require-dev": {
"drupal/consumers": "1.x-dev#c6d64f1b",
"drupal/flood_control": "^3"
},
"license": "GPL-2.0-or-later"
......
......@@ -8,11 +8,11 @@
"utils": "utils"
},
"locked": {
"lastModified": 1733991946,
"narHash": "sha256-S0e/pO0DbP0RMTlaeqwOK7oTPuHmvqs5K328U8skn10=",
"lastModified": 1737108739,
"narHash": "sha256-LfT5z/+StKoV0jboTPIyOgmEePazP8OY/h3JYdfKP0M=",
"ref": "1.x",
"rev": "0a1e4fcae40e3dd50495d72e02e8006ff9ede0cf",
"revCount": 18,
"rev": "702736e4fc1902af9bdf2eb97d5ed3a82699dd0f",
"revCount": 19,
"type": "git",
"url": "https://git.drupalcode.org/project/module_devenv.git"
},
......@@ -24,11 +24,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1733808091,
"narHash": "sha256-KWwINTQelKOoQgrXftxoqxmKFZb9pLVfnRvK270nkVk=",
"lastModified": 1737299813,
"narHash": "sha256-Qw2PwmkXDK8sPQ5YQ/y/icbQ+TYgbxfjhgnkNJyT1X8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a0f3e10d94359665dba45b71b4227b0aeb851f8e",
"rev": "107d5ef05c0b1119749e381451389eded30fb0d5",
"type": "github"
},
"original": {
......
......@@ -19,12 +19,12 @@
pkgs = import nixpkgs {
inherit system;
};
mkDrupalModuleDevShell = devenv.lib.${system}.mkDrupalModuleDevShell;
mkDrupalModuleDevShell = devenv.lib.${system}.mkDrupalModuleDevShell ;
in {
devShells = rec {
# PHP 8.1 / Drupal 10
php81_drupal10 = mkDrupalModuleDevShell {
drupalVersionConstraint = "^10";
# PHP 8.1 / Drupal 10.3
php81_drupal103 = mkDrupalModuleDevShell {
drupalVersionConstraint = "^10.3 <10.4";
buildInputs = with pkgs; [
php81
......@@ -32,19 +32,19 @@
];
};
# PHP 8.2 / Drupal 10
php82_drupal10 = mkDrupalModuleDevShell {
drupalVersionConstraint = "^10";
# PHP 8.3 / Drupal 10.3
php83_drupal103 = mkDrupalModuleDevShell {
drupalVersionConstraint = "^10.3 <10.4";
buildInputs = with pkgs; [
php82
php82Packages.composer
php83
php83Packages.composer
];
};
# PHP 8.3 / Drupal 10
php83_drupal10 = mkDrupalModuleDevShell {
drupalVersionConstraint = "^10";
# PHP 8.3 / Drupal 10.4
php83_drupal104 = mkDrupalModuleDevShell {
drupalVersionConstraint = "^10.4";
buildInputs = with pkgs; [
php83
......@@ -52,6 +52,16 @@
];
};
# PHP 8.4 / Drupal 10.4
php84_drupal104 = mkDrupalModuleDevShell {
drupalVersionConstraint = "^10.4";
buildInputs = with pkgs; [
php84
php84Packages.composer
];
};
# PHP 8.3 / Drupal 11
php83_drupal11 = mkDrupalModuleDevShell {
drupalVersionConstraint = "^11";
......@@ -62,12 +72,20 @@
];
};
default = php81_drupal10;
# PHP 8.4 / Drupal 11
php84_drupal11 = mkDrupalModuleDevShell {
drupalVersionConstraint = "^11";
buildInputs = with pkgs; [
php84
php84Packages.composer
];
};
default = php81_drupal103;
};
formatter = pkgs.alejandra;
}
);
}
}
\ No newline at end of file
......@@ -14,7 +14,9 @@ services:
Drupal\magic_code\MagicCodeCollector: ~
magic_code.collector: '@Drupal\magic_code\MagicCodeCollector'
Drupal\magic_code\VerificationProvider\MagicCodeVerificationProvider: ~
Drupal\magic_code\VerificationProvider\MagicCodeVerificationProvider:
tags:
- { name: verification_provider }
Drupal\magic_code\Flood\MagicCodeFloodControl: ~
Drupal\magic_code\Flood\MagicCodeFloodControlInterface: '@Drupal\magic_code\Flood\MagicCodeFloodControl'
......
......@@ -12,14 +12,12 @@ use Drupal\magic_code\MagicCodeResult;
use Drupal\verification\Provider\VerificationProviderInterface;
use Drupal\verification\Result\VerificationResult;
use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\HttpFoundation\Request;
/**
* Magic code verification provider plugin.
*/
#[AutoconfigureTag('verification_provider')]
class MagicCodeVerificationProvider implements VerificationProviderInterface {
const HEADER_MAGIC_CODE = 'X-Verification-Magic-Code';
......
......@@ -129,13 +129,13 @@ class MagicCodeCommandsTest extends BrowserTestBase {
);
$output = $this->getOutput();
$code = strlen($output) > 7 ? substr($this->getOutput(), 5, 7) : $output;
$code = $this->extractMagicCode($output);
$result = $this->magicCodeStorage->loadByProperties(['value' => $code]);
/** @var \Drupal\magic_code\Entity\MagicCodeInterface $codeEntity */
$codeEntity = reset($result);
$this->assertNotNull($codeEntity);
$this->assertNotEquals(FALSE, $codeEntity);
$this->assertEquals($this->client->id(), $codeEntity->get('client')->entity->id());
// With dedicated consumer.
......@@ -155,7 +155,7 @@ class MagicCodeCommandsTest extends BrowserTestBase {
);
$output = $this->getOutput();
$code = strlen($output) > 7 ? substr($this->getOutput(), 5, 7) : $output;
$code = $this->extractMagicCode($output);
$result = $this->magicCodeStorage->loadByProperties(['value' => $code]);
/** @var \Drupal\magic_code\Entity\MagicCodeInterface $codeEntity */
......@@ -165,4 +165,14 @@ class MagicCodeCommandsTest extends BrowserTestBase {
$this->assertEquals($consumer->id(), $codeEntity->get('client')->entity->id());
}
/**
* Extract magic code from drush command output.
*/
protected function extractMagicCode(string $output): string {
if (preg_match('/[A-Z0-9]{3}-[A-Z0-9]{3}/', $output, $matches)) {
return $matches[0];
}
return $output;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment