Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
3e26a249
Commit
3e26a249
authored
Mar 15, 2014
by
catch
Browse files
Issue
#2217781
by alexpott: Can only run tests from the installed profile.
parent
53ef54c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/modules/simpletest/lib/Drupal/simpletest/Tests/OtherInstallationProfile
Module
TestsTest.php
→
core/modules/simpletest/lib/Drupal/simpletest/Tests/OtherInstallationProfileTestsTest.php
View file @
3e26a249
...
...
@@ -2,7 +2,7 @@
/**
* @file
*
Definition of
\Drupal\simpletest\Tests\OtherInstallationProfile
Module
TestsTest.
*
Contains
\Drupal\simpletest\Tests\OtherInstallationProfileTestsTest.
*/
namespace
Drupal\simpletest\Tests
;
...
...
@@ -10,11 +10,11 @@
use
Drupal\simpletest\WebTestBase
;
/**
* Verifies that tests in other installation profiles are
not
found.
* Verifies that tests in other installation profiles are found.
*
* @see SimpleTestInstallationProfileModuleTestsTestCase
*/
class
OtherInstallationProfile
Module
TestsTest
extends
WebTestBase
{
class
OtherInstallationProfileTestsTest
extends
WebTestBase
{
/**
* Modules to enable.
...
...
@@ -27,9 +27,12 @@ class OtherInstallationProfileModuleTestsTest extends WebTestBase {
* Use the Minimal profile.
*
* The Testing profile contains drupal_system_listing_compatible_test.test,
* which should
not
be found.
* which should be found.
*
* @see SimpleTestInstallationProfileModuleTestsTestCase
* The Standard profile contains \Drupal\standard\Tests\StandardTest, which
* should be found.
*
* @see \Drupal\simpletest\Tests\InstallationProfileModuleTestsTest
* @see \Drupal\drupal_system_listing_compatible_test\Tests\SystemListingCompatibleTest
*/
protected
$profile
=
'minimal'
;
...
...
@@ -37,7 +40,7 @@ class OtherInstallationProfileModuleTestsTest extends WebTestBase {
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Other Installation profiles'
,
'description'
=>
'Verifies that tests in other installation profiles are
not
found.'
,
'description'
=>
'Verifies that tests in
modules contained in
other installation profiles are found.'
,
'group'
=>
'SimpleTest'
,
);
}
...
...
@@ -50,10 +53,18 @@ function setUp() {
}
/**
* Tests that tests located in another installation profile
do not
appear.
* Tests that tests located in another installation profile appear.
*/
function
testOtherInstallationProfile
()
{
// Assert the existence of a test in a different installation profile than
// the current.
$this
->
drupalGet
(
'admin/config/development/testing'
);
$this
->
assertText
(
'Tests Standard installation profile expectations.'
);
// Assert the existence of a test for a module in a different installation
// profile than the current.
$this
->
drupalGet
(
'admin/config/development/testing'
);
$this
->
assert
No
Text
(
'Installation profile module tests helper'
);
$this
->
assertText
(
'Installation profile module tests helper'
);
}
}
core/modules/simpletest/simpletest.module
View file @
3e26a249
...
...
@@ -448,6 +448,8 @@ function simpletest_test_get_all($module = NULL) {
else
{
// Select all PSR-0 classes in the Tests namespace of all modules.
$listing
=
new
ExtensionDiscovery
();
// Ensure that tests in all profiles are discovered.
$listing
->
setProfileDirectories
(
array
());
$all_data
=
$listing
->
scan
(
'module'
,
TRUE
);
// If module is set then we keep only that one module.
if
(
isset
(
$module
))
{
...
...
@@ -549,6 +551,8 @@ function simpletest_classloader_register() {
}
else
{
$listing
=
new
ExtensionDiscovery
();
// Ensure that tests in all profiles are discovered.
$listing
->
setProfileDirectories
(
array
());
$extensions
=
array
();
foreach
(
$types
as
$type
)
{
foreach
(
$listing
->
scan
(
$type
,
TRUE
)
as
$name
=>
$file
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment