File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ public function __construct()
77
77
*/
78
78
public function setName ($ name )
79
79
{
80
- if (strpos ($ name , ' ' ) === false ) {
80
+ if (strpos ($ name , ' ' ) < 1 ) {
81
81
throw new InvalidArgumentException (
82
82
"The name ' {$ name }' is missing a space. Names should look like `cake routes` "
83
83
);
Original file line number Diff line number Diff line change @@ -77,6 +77,18 @@ public function testSetNameInvalid()
77
77
$ command ->setName ('routes_show ' );
78
78
}
79
79
80
+ /**
81
+ * Test invalid name
82
+ *
83
+ * @expectedException InvalidArgumentException
84
+ * @return void
85
+ */
86
+ public function testSetNameInvalidLeadingSpace ()
87
+ {
88
+ $ command = new Command ();
89
+ $ command ->setName (' routes_show ' );
90
+ }
91
+
80
92
/**
81
93
* Test option parser fetching
82
94
*
You can’t perform that action at this time.
0 commit comments