Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3011fa0

Browse files
committed
don't rely on internal sort implementation in test
PHP does not guarantuee how array elements with the same value will besorted when applying `asort()`. Since all namespaces used in the testproduce the same Levenshtein value, we should only check for presence ofthese namespaces instead of comparing the exact order.
1 parente610b41 commit3011fa0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎src/Symfony/Component/Console/Tests/ApplicationTest.php‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,10 @@ public function testFindAlternativeNamespace()
441441
$this->fail('->find() throws a CommandNotFoundException if namespace does not exist');
442442
}catch (\Exception$e) {
443443
$this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException',$e,'->find() throws a CommandNotFoundException if namespace does not exist');
444-
$this->assertSame(array('foo3','foo1','foo'),$e->getAlternatives());
444+
$this->assertCount(3,$e->getAlternatives());
445+
$this->assertContains('foo',$e->getAlternatives());
446+
$this->assertContains('foo1',$e->getAlternatives());
447+
$this->assertContains('foo3',$e->getAlternatives());
445448
$this->assertRegExp('/There are no commands defined in the "foo2" namespace./',$e->getMessage(),'->find() throws a CommandNotFoundException if namespace does not exist, with alternative');
446449
$this->assertRegExp('/foo/',$e->getMessage(),'->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo"');
447450
$this->assertRegExp('/foo1/',$e->getMessage(),'->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo1"');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp