Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
225
Merge Requests
225
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
b4a88edd
Commit
b4a88edd
authored
Aug 21, 2013
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2052995
by dawehner: Add a route to the frontpage.
parent
193c7133
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
core/modules/system/lib/Drupal/system/Tests/Routing/RouterTest.php
...les/system/lib/Drupal/system/Tests/Routing/RouterTest.php
+19
-0
core/modules/system/system.routing.yml
core/modules/system/system.routing.yml
+5
-0
core/scripts/run-tests.sh
core/scripts/run-tests.sh
+1
-0
No files found.
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
Markdown
is supported
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