File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -193,15 +193,14 @@ public function is()
193
193
}
194
194
195
195
/**
196
- * Check if route name matches string.
196
+ * Check if the route name matches the given string.
197
197
*
198
198
* @param string $name
199
- *
200
199
* @return bool
201
200
*/
202
- public function isRouteName ($ name )
201
+ public function routeIs ($ name )
203
202
{
204
- return $ this ->route ()->getName () === $ name ;
203
+ return $ this ->route () && $ this -> route () ->getName () === $ name ;
205
204
}
206
205
207
206
/**
Original file line number Diff line number Diff line change @@ -168,8 +168,8 @@ public function testIsRouteNameMethod()
168
168
return $ route ;
169
169
});
170
170
171
- $ this ->assertTrue ($ request ->isRouteName ('foo.bar ' ));
172
- $ this ->assertFalse ($ request ->isRouteName ('foo.foo ' ));
171
+ $ this ->assertTrue ($ request ->routeIs ('foo.bar ' ));
172
+ $ this ->assertFalse ($ request ->routeIs ('foo.foo ' ));
173
173
}
174
174
175
175
public function testAjaxMethod ()
You can’t perform that action at this time.
0 commit comments