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
304
Merge Requests
304
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
684f00dc
Commit
684f00dc
authored
Aug 11, 2012
by
Crell
Committed by
effulgentsia
Oct 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a functional test for the new router.
parent
7139f025
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
2 deletions
+54
-2
core/modules/system/lib/Drupal/system/Tests/Routing/RouterTest.php
...les/system/lib/Drupal/system/Tests/Routing/RouterTest.php
+33
-0
core/modules/system/tests/modules/router_test/lib/Drupal/router_test/TestControllers.php
...es/router_test/lib/Drupal/router_test/TestControllers.php
+17
-0
core/modules/system/tests/modules/router_test/router_test.module
...dules/system/tests/modules/router_test/router_test.module
+4
-2
No files found.
core/modules/system/lib/Drupal/system/Tests/Routing/RouterTest.php
0 → 100644
View file @
684f00dc
<?php
namespace
Drupal\system\Tests\Routing
;
use
Drupal\Core\Database\Database
;
use
Drupal\simpletest\WebTestBase
;
/**
* Functional class for the full integrated routing system.
*/
class
RouterTest
extends
WebTestBase
{
/**
* Modules to enable.
*
* @var array
*/
public
static
$modules
=
array
(
'block'
,
'router_test'
);
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Integrated Router tests'
,
'description'
=>
'Function Tests for the fully integrated routing system.'
,
'group'
=>
'Routing'
,
);
}
public
function
testCanRoute
()
{
$this
->
drupalGet
(
'router_test/test1'
);
$this
->
assertRaw
(
'test1'
,
'The correct string was returned because the route was successful.'
);
}
}
core/modules/system/tests/modules/router_test/lib/Drupal/router_test/TestControllers.php
0 → 100644
View file @
684f00dc
<?php
namespace
Drupal\router_test
;
use
Symfony\Component\HttpFoundation\Response
;
/**
* Description of TestControllers
*/
class
TestControllers
{
public
function
test1
()
{
return
new
Response
(
'test1'
);
}
}
core/modules/system/tests/modules/router_test/router_test.module
View file @
684f00dc
...
...
@@ -3,10 +3,12 @@
use
Symfony\Component\Routing\Route
;
use
Symfony\Component\Routing\RouteCollection
;
function
router_test_route
r
_info
()
{
function
router_test_route_info
()
{
$collection
=
new
RouteCollection
();
$route
=
new
Route
(
'router_test/test1'
);
$route
=
new
Route
(
'router_test/test1'
,
array
(
'_controller'
=>
'\Drupal\router_test\TestControllers::test1'
));
$collection
->
add
(
'router_test_1'
,
$route
);
return
$collection
;
...
...
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