You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Commits
-------
039264d [Console] Fixed tests about message exception when command is not available
a4d2d31 [Console] Added tests for message exception when command is not available
Discussion
----------
[Console] Fixed message exception when command is not avaible
Bug fix: yes
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
License of the code: MIT
Fixed singular / plural
`Did you mean this?` VS `Did you mean one of these`
---------------------------------------------------------------------------
by travisbot at 2012-08-07T14:40:55Z
This pull request [fails](http://travis-ci.org/symfony/symfony/builds/2057647) (merged 039264d into b91a4a8).
---------------------------------------------------------------------------
by lyrixx at 2012-08-07T15:11:47Z
@travisbot You failed, not me !
$this->fail('->find() throws an \InvalidArgumentException if command does not exist, with one alternative');
227
+
} catch (\Exception$e) {
228
+
$this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist, with one alternative');
229
+
$this->assertRegExp('/Did you mean this/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with one alternative');
230
+
}
231
+
232
+
// Namespace + singular
233
+
try {
234
+
$application->find('foO:bar');
235
+
$this->fail('->find() throws an \InvalidArgumentException if command does not exist, with one alternative');
236
+
} catch (\Exception$e) {
237
+
$this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist, with one alternative');
238
+
$this->assertRegExp('/Did you mean this/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with one alternative');
239
+
}
240
+
241
+
242
+
$application->add(new \Foo1Command());
243
+
$application->add(new \Foo2Command());
244
+
245
+
// Command + plural
246
+
try {
247
+
$application->find('foo:baR');
248
+
$this->fail('->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
249
+
} catch (\Exception$e) {
250
+
$this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
251
+
$this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
252
+
}
253
+
254
+
// Namespace + plural
255
+
try {
256
+
$application->find('foo2:bar');
257
+
$this->fail('->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
258
+
} catch (\Exception$e) {
259
+
$this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
260
+
$this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
0 commit comments