Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
b4a88edd
Commit
b4a88edd
authored
Aug 21, 2013
by
Nathaniel Catchpole
Browse files
Issue
#2052995
by dawehner: Add a route to the frontpage.
parent
193c7133
Changes
3
Hide whitespace changes
Inline
Side-by-side
core/modules/system/lib/Drupal/system/Tests/Routing/RouterTest.php
View file @
b4a88edd
...
...
@@ -8,6 +8,7 @@
namespace
Drupal\system\Tests\Routing
;
use
Drupal\simpletest\WebTestBase
;
use
Symfony\Component\Routing\RequestContext
;
/**
* Functional class for the full integrated routing system.
...
...
@@ -142,6 +143,24 @@ public function testControllerResolutionPage() {
$this
->
assertNoPattern
(
'#</body>.*</body>#s'
,
'There was no double-page effect from a misrendered subrequest.'
);
}
/**
* Checks the generate method on the url generator using the front router.
*/
public
function
testUrlGeneratorFront
()
{
// Setup the request context of the URL generator. Note: Just calling the
// code without a proper request, does not setup the request context
// automatically.
$context
=
new
RequestContext
();
$context
->
fromRequest
(
$this
->
container
->
get
(
'request'
));
$this
->
container
->
get
(
'url_generator'
)
->
setRequest
(
$this
->
container
->
get
(
'request'
));
$this
->
container
->
get
(
'url_generator'
)
->
setContext
(
$context
);
global
$base_path
;
$this
->
assertEqual
(
$this
->
container
->
get
(
'url_generator'
)
->
generate
(
'<front>'
),
$base_path
);
$this
->
assertEqual
(
$this
->
container
->
get
(
'url_generator'
)
->
generateFromPath
(
'<front>'
),
$base_path
);
}
/**
* Checks that an ajax request gets rendered as an Ajax response, by mime.
*
...
...
core/modules/system/system.routing.yml
View file @
b4a88edd
...
...
@@ -202,6 +202,11 @@ system_theme_settings_global:
requirements
:
_permission
:
'
administer
themes'
'
<front>'
:
pattern
:
'
/'
requirements
:
_access
:
'
TRUE'
system_modules_uninstall
:
pattern
:
'
admin/modules/uninstall'
defaults
:
...
...
core/scripts/run-tests.sh
View file @
b4a88edd
...
...
@@ -304,6 +304,7 @@ function simpletest_script_init($server_software) {
$_SERVER
[
'REQUEST_URI'
]
=
$path
.
'/'
;
$_SERVER
[
'REQUEST_METHOD'
]
=
'GET'
;
$_SERVER
[
'SCRIPT_NAME'
]
=
$path
.
'/index.php'
;
$_SERVER
[
'SCRIPT_FILENAME'
]
=
$path
.
'/index.php'
;
$_SERVER
[
'PHP_SELF'
]
=
$path
.
'/index.php'
;
$_SERVER
[
'HTTP_USER_AGENT'
]
=
'Drupal command line'
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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