Laravel 5.6 updates
Travis config update Removed HHVM script as Laravel no longer support HHVM after releasing 5.3
This commit is contained in:
@@ -18,10 +18,9 @@ class StaticPrefixCollectionTest extends TestCase
|
||||
foreach ($routes as $route) {
|
||||
list($path, $name) = $route;
|
||||
$staticPrefix = (new Route($path))->compile()->getStaticPrefix();
|
||||
$collection->addRoute($staticPrefix, $name);
|
||||
$collection->addRoute($staticPrefix, array($name));
|
||||
}
|
||||
|
||||
$collection->optimizeGroups();
|
||||
$dumped = $this->dumpCollection($collection);
|
||||
$this->assertEquals($expected, $dumped);
|
||||
}
|
||||
@@ -36,21 +35,22 @@ class StaticPrefixCollectionTest extends TestCase
|
||||
array('/leading/segment/', 'leading_segment'),
|
||||
),
|
||||
<<<EOF
|
||||
/ root
|
||||
/prefix/segment prefix_segment
|
||||
/leading/segment leading_segment
|
||||
root
|
||||
prefix_segment
|
||||
leading_segment
|
||||
EOF
|
||||
),
|
||||
'Not nested - group too small' => array(
|
||||
'Nested - small group' => array(
|
||||
array(
|
||||
array('/', 'root'),
|
||||
array('/prefix/segment/aa', 'prefix_segment'),
|
||||
array('/prefix/segment/bb', 'leading_segment'),
|
||||
),
|
||||
<<<EOF
|
||||
/ root
|
||||
/prefix/segment/aa prefix_segment
|
||||
/prefix/segment/bb leading_segment
|
||||
root
|
||||
/prefix/segment/
|
||||
-> prefix_segment
|
||||
-> leading_segment
|
||||
EOF
|
||||
),
|
||||
'Nested - contains item at intersection' => array(
|
||||
@@ -60,10 +60,10 @@ EOF
|
||||
array('/prefix/segment/bb', 'leading_segment'),
|
||||
),
|
||||
<<<EOF
|
||||
/ root
|
||||
/prefix/segment
|
||||
-> /prefix/segment prefix_segment
|
||||
-> /prefix/segment/bb leading_segment
|
||||
root
|
||||
/prefix/segment/
|
||||
-> prefix_segment
|
||||
-> leading_segment
|
||||
EOF
|
||||
),
|
||||
'Simple one level nesting' => array(
|
||||
@@ -74,11 +74,11 @@ EOF
|
||||
array('/group/other/', 'other_segment'),
|
||||
),
|
||||
<<<EOF
|
||||
/ root
|
||||
/group
|
||||
-> /group/segment nested_segment
|
||||
-> /group/thing some_segment
|
||||
-> /group/other other_segment
|
||||
root
|
||||
/group/
|
||||
-> nested_segment
|
||||
-> some_segment
|
||||
-> other_segment
|
||||
EOF
|
||||
),
|
||||
'Retain matching order with groups' => array(
|
||||
@@ -86,21 +86,21 @@ EOF
|
||||
array('/group/aa/', 'aa'),
|
||||
array('/group/bb/', 'bb'),
|
||||
array('/group/cc/', 'cc'),
|
||||
array('/', 'root'),
|
||||
array('/(.*)', 'root'),
|
||||
array('/group/dd/', 'dd'),
|
||||
array('/group/ee/', 'ee'),
|
||||
array('/group/ff/', 'ff'),
|
||||
),
|
||||
<<<EOF
|
||||
/group
|
||||
-> /group/aa aa
|
||||
-> /group/bb bb
|
||||
-> /group/cc cc
|
||||
/ root
|
||||
/group
|
||||
-> /group/dd dd
|
||||
-> /group/ee ee
|
||||
-> /group/ff ff
|
||||
/group/
|
||||
-> aa
|
||||
-> bb
|
||||
-> cc
|
||||
root
|
||||
/group/
|
||||
-> dd
|
||||
-> ee
|
||||
-> ff
|
||||
EOF
|
||||
),
|
||||
'Retain complex matching order with groups at base' => array(
|
||||
@@ -109,28 +109,30 @@ EOF
|
||||
array('/prefixed/group/aa/', 'aa'),
|
||||
array('/prefixed/group/bb/', 'bb'),
|
||||
array('/prefixed/group/cc/', 'cc'),
|
||||
array('/prefixed/', 'root'),
|
||||
array('/prefixed/(.*)', 'root'),
|
||||
array('/prefixed/group/dd/', 'dd'),
|
||||
array('/prefixed/group/ee/', 'ee'),
|
||||
array('/prefixed/', 'parent'),
|
||||
array('/prefixed/group/ff/', 'ff'),
|
||||
array('/aaa/222/', 'second_aaa'),
|
||||
array('/aaa/333/', 'third_aaa'),
|
||||
),
|
||||
<<<EOF
|
||||
/aaa
|
||||
-> /aaa/111 first_aaa
|
||||
-> /aaa/222 second_aaa
|
||||
-> /aaa/333 third_aaa
|
||||
/prefixed
|
||||
-> /prefixed/group
|
||||
-> -> /prefixed/group/aa aa
|
||||
-> -> /prefixed/group/bb bb
|
||||
-> -> /prefixed/group/cc cc
|
||||
-> /prefixed root
|
||||
-> /prefixed/group
|
||||
-> -> /prefixed/group/dd dd
|
||||
-> -> /prefixed/group/ee ee
|
||||
-> -> /prefixed/group/ff ff
|
||||
/aaa/
|
||||
-> first_aaa
|
||||
-> second_aaa
|
||||
-> third_aaa
|
||||
/prefixed/
|
||||
-> /prefixed/group/
|
||||
-> -> aa
|
||||
-> -> bb
|
||||
-> -> cc
|
||||
-> root
|
||||
-> /prefixed/group/
|
||||
-> -> dd
|
||||
-> -> ee
|
||||
-> -> ff
|
||||
-> parent
|
||||
EOF
|
||||
),
|
||||
|
||||
@@ -145,13 +147,13 @@ EOF
|
||||
),
|
||||
<<<EOF
|
||||
/aaa-
|
||||
-> /aaa-111 a1
|
||||
-> /aaa-222 a2
|
||||
-> /aaa-333 a3
|
||||
-> a1
|
||||
-> a2
|
||||
-> a3
|
||||
/group-
|
||||
-> /group-aa g1
|
||||
-> /group-bb g2
|
||||
-> /group-cc g3
|
||||
-> g1
|
||||
-> g2
|
||||
-> g3
|
||||
EOF
|
||||
),
|
||||
);
|
||||
@@ -161,7 +163,7 @@ EOF
|
||||
{
|
||||
$lines = array();
|
||||
|
||||
foreach ($collection->getItems() as $item) {
|
||||
foreach ($collection->getRoutes() as $item) {
|
||||
if ($item instanceof StaticPrefixCollection) {
|
||||
$lines[] = $prefix.$item->getPrefix();
|
||||
$lines[] = $this->dumpCollection($item, $prefix.'-> ');
|
||||
|
Reference in New Issue
Block a user