-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] [Routing] Added --sort to debug:router #36579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
f663aa0
afba921
ced94da
49029ae
6f743c1
4a034ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ public function testSortingByPriority() | |
$result = $tester->execute(['--sort' => 'priority'], ['decorated' => false]); | ||
$this->assertSame(0, $result, 'Returns 0 in case of success'); | ||
$this->assertRegExp('/(charlie).*\n\W*(alfa).*\n\W*(delta).*\n\W*(bravo)/m', $tester->getDisplay(true)); | ||
$this->assertStringNotContainsString('! [CAUTION] The routes list is not sorted in the parsing order.', $tester->getDisplay(true)); | ||
} | ||
|
||
public function testSortingByName() | ||
|
@@ -29,6 +30,7 @@ public function testSortingByName() | |
$result = $tester->execute(['--sort' => 'name'], ['decorated' => false]); | ||
$this->assertSame(0, $result, 'Returns 0 in case of success'); | ||
$this->assertRegExp('/(alfa).*\n\W*(bravo).*\n\W*(charlie).*\n\W*(delta)/m', $tester->getDisplay(true)); | ||
$this->assertStringContainsString('! [CAUTION] The routes list is not sorted in the parsing order.', $tester->getDisplay(true)); | ||
} | ||
|
||
public function testSortingByPath() | ||
|
@@ -37,6 +39,7 @@ public function testSortingByPath() | |
$result = $tester->execute(['--sort' => 'path'], ['decorated' => false]); | ||
$this->assertSame(0, $result, 'Returns 0 in case of success'); | ||
$this->assertRegExp('/(\/romeo).*\n.*(\/sierra).*\n.*(\/tango).*\n.*(\/uniform)/m', $tester->getDisplay(true)); | ||
$this->assertStringContainsString('! [CAUTION] The routes list is not sorted in the parsing order.', $tester->getDisplay(true)); | ||
} | ||
|
||
public function testThrowsExceptionWithInvalidParameter() | ||
|
@@ -59,6 +62,7 @@ public function testSortingByPriorityWithDuplicatePath() | |
$result = $tester->execute(['--sort' => 'priority'], ['decorated' => false]); | ||
$this->assertSame(0, $result, 'Returns 0 in case of success'); | ||
$this->assertRegExp('/(charlie).*\n\W*(alfa).*\n\W*(delta).*\n\W*(bravo).*\n\W*(echo)/m', $tester->getDisplay(true)); | ||
$this->assertStringNotContainsString('! [CAUTION] The routes list is not sorted in the parsing order.', $tester->getDisplay(true)); | ||
} | ||
|
||
public function testSortingByNameWithDuplicatePath() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think this test is useless as it doesn't cover anything new |
||
|
@@ -67,6 +71,7 @@ public function testSortingByNameWithDuplicatePath() | |
$result = $tester->execute(['--sort' => 'name'], ['decorated' => false]); | ||
$this->assertSame(0, $result, 'Returns 0 in case of success'); | ||
$this->assertRegExp('/(alfa).*\n\W*(bravo).*\n\W*(charlie).*\n\W*(delta).*\n\W*(echo)/m', $tester->getDisplay(true)); | ||
$this->assertStringContainsString('! [CAUTION] The routes list is not sorted in the parsing order.', $tester->getDisplay(true)); | ||
} | ||
|
||
public function testSortingByPathWithDuplicatePath() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this test should actually also make sure the routes with the same path stay in the correct order as before (check routes names) as I mention in the stable sorting comment |
||
|
@@ -75,6 +80,7 @@ public function testSortingByPathWithDuplicatePath() | |
$result = $tester->execute(['--sort' => 'path'], ['decorated' => false]); | ||
$this->assertSame(0, $result, 'Returns 0 in case of success'); | ||
$this->assertRegExp('/(\/romeo).*\n.*(\/sierra).*\n.*(\/tango).*\n.*(\/uniform).*\n.*(\/uniform)/m', $tester->getDisplay(true)); | ||
$this->assertStringContainsString('! [CAUTION] The routes list is not sorted in the parsing order.', $tester->getDisplay(true)); | ||
} | ||
|
||
public function testWithoutCallingSortOptionExplicitly() | ||
|
@@ -83,6 +89,7 @@ public function testWithoutCallingSortOptionExplicitly() | |
$result = $tester->execute([], ['decorated' => false]); | ||
$this->assertSame(0, $result, 'Returns 0 in case of success'); | ||
$this->assertRegExp('/(charlie).*\n\W*(alfa).*\n\W*(delta).*\n\W*(bravo)/m', $tester->getDisplay(true)); | ||
$this->assertStringNotContainsString('! [CAUTION] The routes list is not sorted in the parsing order.', $tester->getDisplay(true)); | ||
} | ||
|
||
private function createCommandTester(): CommandTester | ||
|
Uh oh!
There was an error while loading. Please reload this page.