Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
41586439
Commit
41586439
authored
Aug 11, 2012
by
Crell
Committed by
effulgentsia
Oct 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove extraneous t() calls from assertion messages.
parent
66a24093
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
30 deletions
+30
-30
core/modules/system/lib/Drupal/system/Tests/Routing/HttpMethodMatcherTest.php
...lib/Drupal/system/Tests/Routing/HttpMethodMatcherTest.php
+8
-8
core/modules/system/lib/Drupal/system/Tests/Routing/MatcherDumperTest.php
...tem/lib/Drupal/system/Tests/Routing/MatcherDumperTest.php
+7
-7
core/modules/system/lib/Drupal/system/Tests/Routing/NestedMatcherTest.php
...tem/lib/Drupal/system/Tests/Routing/NestedMatcherTest.php
+1
-1
core/modules/system/lib/Drupal/system/Tests/Routing/PathMatcherTest.php
...ystem/lib/Drupal/system/Tests/Routing/PathMatcherTest.php
+11
-11
core/modules/system/lib/Drupal/system/Tests/Routing/RouteTest.php
...ules/system/lib/Drupal/system/Tests/Routing/RouteTest.php
+3
-3
No files found.
core/modules/system/lib/Drupal/system/Tests/Routing/HttpMethodMatcherTest.php
View file @
41586439
...
...
@@ -58,12 +58,12 @@ public function testFilterRoutes() {
$routes
=
$matcher
->
matchRequestPartial
(
Request
::
create
(
'path/one'
,
'GET'
));
$this
->
assertEqual
(
count
(
$routes
->
all
()),
4
,
t
(
'The correct number of routes was found.'
)
)
;
$this
->
assertNotNull
(
$routes
->
get
(
'route_a'
),
t
(
'The first matching route was found.'
)
)
;
$this
->
assertNull
(
$routes
->
get
(
'route_b'
),
t
(
'The non-matching route was not found.'
)
)
;
$this
->
assertNotNull
(
$routes
->
get
(
'route_c'
),
t
(
'The second matching route was found.'
)
)
;
$this
->
assertNotNull
(
$routes
->
get
(
'route_d'
),
t
(
'The all-matching route was found.'
)
)
;
$this
->
assertNotNull
(
$routes
->
get
(
'route_e'
),
t
(
'The multi-matching route was found.'
)
)
;
$this
->
assertEqual
(
count
(
$routes
->
all
()),
4
,
'The correct number of routes was found.'
);
$this
->
assertNotNull
(
$routes
->
get
(
'route_a'
),
'The first matching route was found.'
);
$this
->
assertNull
(
$routes
->
get
(
'route_b'
),
'The non-matching route was not found.'
);
$this
->
assertNotNull
(
$routes
->
get
(
'route_c'
),
'The second matching route was found.'
);
$this
->
assertNotNull
(
$routes
->
get
(
'route_d'
),
'The all-matching route was found.'
);
$this
->
assertNotNull
(
$routes
->
get
(
'route_e'
),
'The multi-matching route was found.'
);
}
/**
...
...
@@ -81,7 +81,7 @@ public function testNestedMatcher() {
$attributes
=
$matcher
->
matchRequest
(
$request
);
$this
->
assertEqual
(
$attributes
[
'_route'
],
'route_a'
,
t
(
'The correct matching route was found.'
)
)
;
$this
->
assertEqual
(
$attributes
[
'_route'
],
'route_a'
,
'The correct matching route was found.'
);
}
/**
...
...
@@ -101,7 +101,7 @@ public function testNoRouteFound() {
$this
->
fail
(
t
(
'No exception was thrown.'
));
}
catch
(
Exception
$e
)
{
$this
->
assertTrue
(
$e
instanceof
MethodNotAllowedException
,
t
(
'The correct exception was thrown.'
)
)
;
$this
->
assertTrue
(
$e
instanceof
MethodNotAllowedException
,
'The correct exception was thrown.'
);
}
}
...
...
core/modules/system/lib/Drupal/system/Tests/Routing/MatcherDumperTest.php
View file @
41586439
...
...
@@ -52,7 +52,7 @@ function testCreate() {
$dumper
=
new
MatcherDumper
(
$connection
);
$class_name
=
'Drupal\Core\Routing\MatcherDumper'
;
$this
->
assertTrue
(
$dumper
instanceof
$class_name
,
t
(
'Dumper created successfully'
)
)
;
$this
->
assertTrue
(
$dumper
instanceof
$class_name
,
'Dumper created successfully'
);
}
/**
...
...
@@ -72,7 +72,7 @@ function testAddRoutes() {
$collection_routes
=
$collection
->
all
();
foreach
(
$dumper_routes
as
$name
=>
$route
)
{
$this
->
assertEqual
(
$route
->
getPattern
(),
$collection_routes
[
$name
]
->
getPattern
(),
t
(
'Routes match'
)
)
;
$this
->
assertEqual
(
$route
->
getPattern
(),
$collection_routes
[
$name
]
->
getPattern
(),
'Routes match'
);
}
}
...
...
@@ -134,11 +134,11 @@ public function testDump() {
$loaded_route
=
unserialize
(
$record
->
route
);
$this
->
assertEqual
(
$record
->
name
,
'test_route'
,
t
(
'Dumped route has correct name.'
)
)
;
$this
->
assertEqual
(
$record
->
pattern
,
'/test/{my}/path'
,
t
(
'Dumped route has correct pattern.'
)
)
;
$this
->
assertEqual
(
$record
->
pattern_outline
,
'/test/%/path'
,
t
(
'Dumped route has correct pattern outline.'
)
)
;
$this
->
assertEqual
(
$record
->
fit
,
5
/* 101 in binary */
,
t
(
'Dumped route has correct fit.'
)
)
;
$this
->
assertTrue
(
$loaded_route
instanceof
Route
,
t
(
'Route object retrieved successfully.'
)
)
;
$this
->
assertEqual
(
$record
->
name
,
'test_route'
,
'Dumped route has correct name.'
);
$this
->
assertEqual
(
$record
->
pattern
,
'/test/{my}/path'
,
'Dumped route has correct pattern.'
);
$this
->
assertEqual
(
$record
->
pattern_outline
,
'/test/%/path'
,
'Dumped route has correct pattern outline.'
);
$this
->
assertEqual
(
$record
->
fit
,
5
/* 101 in binary */
,
'Dumped route has correct fit.'
);
$this
->
assertTrue
(
$loaded_route
instanceof
Route
,
'Route object retrieved successfully.'
);
}
}
core/modules/system/lib/Drupal/system/Tests/Routing/NestedMatcherTest.php
View file @
41586439
...
...
@@ -63,7 +63,7 @@ public function testNestedMatcher() {
$attributes
=
$matcher
->
matchRequest
(
$request
);
$this
->
assertEqual
(
$attributes
[
'_route'
],
'route_a'
,
t
(
'The correct matching route was found.'
)
)
;
$this
->
assertEqual
(
$attributes
[
'_route'
],
'route_a'
,
'The correct matching route was found.'
);
}
}
core/modules/system/lib/Drupal/system/Tests/Routing/PathMatcherTest.php
View file @
41586439
...
...
@@ -67,11 +67,11 @@ public function testCandidateOutlines() {
$candidates
=
array_flip
(
$candidates
);
$this
->
assertTrue
(
count
(
$candidates
)
==
4
,
t
(
'Correct number of candidates found'
)
)
;
$this
->
assertTrue
(
array_key_exists
(
'/node/5/edit'
,
$candidates
),
t
(
'First candidate found.'
)
)
;
$this
->
assertTrue
(
array_key_exists
(
'/node/5/%'
,
$candidates
),
t
(
'Second candidate found.'
)
)
;
$this
->
assertTrue
(
array_key_exists
(
'/node/%/edit'
,
$candidates
),
t
(
'Third candidate found.'
)
)
;
$this
->
assertTrue
(
array_key_exists
(
'/node/%/%'
,
$candidates
),
t
(
'Fourth candidate found.'
)
)
;
$this
->
assertTrue
(
count
(
$candidates
)
==
4
,
'Correct number of candidates found'
);
$this
->
assertTrue
(
array_key_exists
(
'/node/5/edit'
,
$candidates
),
'First candidate found.'
);
$this
->
assertTrue
(
array_key_exists
(
'/node/5/%'
,
$candidates
),
'Second candidate found.'
);
$this
->
assertTrue
(
array_key_exists
(
'/node/%/edit'
,
$candidates
),
'Third candidate found.'
);
$this
->
assertTrue
(
array_key_exists
(
'/node/%/%'
,
$candidates
),
'Fourth candidate found.'
);
}
/**
...
...
@@ -94,7 +94,7 @@ function testExactPathMatch() {
$routes
=
$matcher
->
matchRequestPartial
(
$request
);
foreach
(
$routes
as
$route
)
{
$this
->
assertEqual
(
$route
->
getPattern
(),
$path
,
t
(
'Found path has correct pattern'
)
)
;
$this
->
assertEqual
(
$route
->
getPattern
(),
$path
,
'Found path has correct pattern'
);
}
}
...
...
@@ -119,12 +119,12 @@ function testOutlinePathMatch() {
// All of the matching paths have the correct pattern.
foreach
(
$routes
as
$route
)
{
$this
->
assertEqual
(
$route
->
compile
()
->
getPatternOutline
(),
'/path/%/one'
,
t
(
'Found path has correct pattern'
)
)
;
$this
->
assertEqual
(
$route
->
compile
()
->
getPatternOutline
(),
'/path/%/one'
,
'Found path has correct pattern'
);
}
$this
->
assertEqual
(
count
(
$routes
->
all
()),
2
,
t
(
'The correct number of routes was found.'
)
)
;
$this
->
assertNotNull
(
$routes
->
get
(
'route_a'
),
t
(
'The first matching route was found.'
)
)
;
$this
->
assertNotNull
(
$routes
->
get
(
'route_b'
),
t
(
'The second matching route was not found.'
)
)
;
$this
->
assertEqual
(
count
(
$routes
->
all
()),
2
,
'The correct number of routes was found.'
);
$this
->
assertNotNull
(
$routes
->
get
(
'route_a'
),
'The first matching route was found.'
);
$this
->
assertNotNull
(
$routes
->
get
(
'route_b'
),
'The second matching route was not found.'
);
}
/**
...
...
@@ -149,7 +149,7 @@ function testOutlinePathNoMatch() {
$this
->
fail
(
t
(
'No exception was thrown.'
));
}
catch
(
Exception
$e
)
{
$this
->
assertTrue
(
$e
instanceof
ResourceNotFoundException
,
t
(
'The correct exception was thrown.'
)
)
;
$this
->
assertTrue
(
$e
instanceof
ResourceNotFoundException
,
'The correct exception was thrown.'
);
}
}
...
...
core/modules/system/lib/Drupal/system/Tests/Routing/RouteTest.php
View file @
41586439
...
...
@@ -33,9 +33,9 @@ public function testCompilation() {
$route
->
setOption
(
'compiler_class'
,
'Drupal\Core\Routing\RouteCompiler'
);
$compiled
=
$route
->
compile
();
$this
->
assertEqual
(
$route
,
$compiled
->
getRoute
(),
t
(
'Compiled route has the correct route object.'
)
)
;
$this
->
assertEqual
(
$compiled
->
getFit
(),
5
/* That's 101 binary*/
,
t
(
'The fit was correct.'
)
)
;
$this
->
assertEqual
(
$compiled
->
getPatternOutline
(),
'/test/%/more'
,
t
(
'The pattern outline was correct.'
)
)
;
$this
->
assertEqual
(
$route
,
$compiled
->
getRoute
(),
'Compiled route has the correct route object.'
);
$this
->
assertEqual
(
$compiled
->
getFit
(),
5
/* That's 101 binary*/
,
'The fit was correct.'
);
$this
->
assertEqual
(
$compiled
->
getPatternOutline
(),
'/test/%/more'
,
'The pattern outline was correct.'
);
}
}
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