Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

adjusted tests to not use RouteCollection::getPrefix

  • Loading branch information...
commit 2f1a4ce9c87376c21ce90e08f062e65bc5d4eb9a 1 parent 9efa144
Tobias Schultze authored December 07, 2012

Showing 1 changed file with 4 additions and 6 deletions. Show diff stats Hide diff stats

  1. 10  Tests/RouteCollectionTest.php
10  Tests/RouteCollectionTest.php
@@ -133,9 +133,8 @@ public function testAddPrefix()
133 133
         $collection2 = new RouteCollection();
134 134
         $collection2->add('bar', $bar = new Route('/bar'));
135 135
         $collection->addCollection($collection2);
136  
-        $this->assertSame('', $collection->getPrefix(), '->getPrefix() is initialized with ""');
137 136
         $collection->addPrefix(' / ');
138  
-        $this->assertSame('', $collection->getPrefix(), '->addPrefix() trims the prefix and a single slash has no effect');
  137
+        $this->assertSame('/foo', $collection->get('foo')->getPattern(), '->addPrefix() trims the prefix and a single slash has no effect');
139 138
         $collection->addPrefix('/{admin}', array('admin' => 'admin'), array('admin' => '\d+'), array('foo' => 'bar'));
140 139
         $this->assertEquals('/{admin}/foo', $collection->get('foo')->getPath(), '->addPrefix() adds a prefix to all routes');
141 140
         $this->assertEquals('/{admin}/bar', $collection->get('bar')->getPath(), '->addPrefix() adds a prefix to all routes');
@@ -152,11 +151,10 @@ public function testAddPrefix()
152 151
             $collection->get('bar')->getOptions(), '->addPrefix() adds an option to all routes'
153 152
         );
154 153
         $collection->addPrefix('0');
155  
-        $this->assertEquals('/0/{admin}', $collection->getPrefix(), '->addPrefix() ensures a prefix must start with a slash and must not end with a slash');
  154
+        $this->assertEquals('/0/{admin}/foo', $collection->get('foo')->getPattern(), '->addPrefix() ensures a prefix must start with a slash and must not end with a slash');
156 155
         $collection->addPrefix('/ /');
157  
-        $this->assertSame('/ /0/{admin}', $collection->getPrefix(), '->addPrefix() can handle spaces if desired');
158  
-        $this->assertSame('/ /0/{admin}/foo', $collection->get('foo')->getPath(), 'the route path is in synch with the collection prefix');
159  
-        $this->assertSame('/ /0/{admin}/bar', $collection->get('bar')->getPath(), 'the route path in a sub-collection is in synch with the collection prefix');
  156
+        $this->assertSame('/ /0/{admin}/foo', $collection->get('foo')->getPath(), '->addPrefix() can handle spaces if desired');
  157
+        $this->assertSame('/ /0/{admin}/bar', $collection->get('bar')->getPath(), 'the route pattern of an added collection is in synch with the added prefix');
160 158
     }
161 159
 
162 160
     public function testAddPrefixOverridesDefaultsAndRequirements()

0 notes on commit 2f1a4ce

Please sign in to comment.
Something went wrong with that request. Please try again.