Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Drupal Development Environment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Composer
plugin
Drupal Development Environment
Merge requests
!20
Merging develop into main
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Merging develop into main
develop
into
main
Overview
0
Commits
5
Pipelines
1
Changes
9
Merged
GitLab CI
requested to merge
develop
into
main
9 months ago
Overview
0
Commits
5
Pipelines
1
Changes
9
Expand
Remove lakedrops/behat4drupal
Fix allowed plugins configuration
Remove deprecated testsuite classes and replace them in default config with testsuites from Drupal core
#19 (closed)
Rename ahoy test stylelintprepare into preparecorefordev
Fix cspell
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
fb8b8a2b
5 commits,
9 months ago
9 files
+
13
−
211
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
9
Search (e.g. *.vue) (Ctrl+P)
src/TestSuite/Base.php deleted
100644 → 0
+
0
−
62
Options
<?php
namespace
LakeDrops\DrupalDevelopmentEnvironment\TestSuite
;
require_once
'web/core/tests/TestSuites/TestSuiteBase.php'
;
use
Drupal\Core\Test\TestDiscovery
;
use
Drupal\Tests\TestSuites\TestSuiteBase
;
/**
* Base class for Drupal test suites.
*/
abstract
class
Base
extends
TestSuiteBase
{
/**
* Unused variable to allow for otherwise useless __construct overrides.
*
* @var string
*/
protected
string
$internalTestType
;
/**
* Finds extensions in a Drupal installation.
*
* An extension is defined as a directory with an *.info.yml file in it.
*
* @param string $root
* Path to the root of the Drupal installation.
*
* @return string[]
* Associative array of extension paths, with extension name as keys.
*/
protected
function
findExtensionDirectories
(
$root
):
array
{
$paths
=
[
$root
.
'/modules/custom'
,
$root
.
'/profiles/custom'
,
$root
.
'/themes/custom'
,
];
$extension_roots
=
array_filter
(
$paths
,
'file_exists'
);
$extension_directories
=
array_map
(
'drupal_phpunit_find_extension_directories'
,
$extension_roots
);
return
array_reduce
(
$extension_directories
,
'array_merge'
,
[]);
}
/**
* Find and add tests to the suite for core and any extensions.
*
* @param string $root
* Path to the root of the Drupal installation.
* @param string $suite_namespace
* SubNamespace used to separate test suite. Examples: Unit, Functional.
*/
protected
function
addTestsBySuiteNamespace
(
$root
,
$suite_namespace
):
void
{
foreach
(
$this
->
findExtensionDirectories
(
$root
)
as
$extension_name
=>
$dir
)
{
$test_path
=
"
$dir
/tests/src/
$suite_namespace
"
;
if
(
is_dir
(
$test_path
))
{
$this
->
addTestFiles
(
TestDiscovery
::
scanDirectory
(
"Drupal
\\
Tests
\\
$extension_name
\\
$suite_namespace
\\
"
,
$test_path
));
}
}
}
}
Loading