|
2 | 2 |
|
3 | 3 | namespace Prokl\WpSymfonyRouterBundle\Tests\Cases; |
4 | 4 |
|
5 | | -use Faker\Factory; |
6 | 5 | use Prokl\WpSymfonyRouterBundle\Services\Utils\RouteChecker; |
7 | 6 | use Prokl\WpSymfonyRouterBundle\Tests\Fixture\ExampleSimpleController; |
8 | 7 | use Prokl\WpSymfonyRouterBundle\Tests\Tools\ContainerAwareBaseTestCase; |
| 8 | +use Symfony\Component\HttpFoundation\Request; |
9 | 9 | use Symfony\Component\HttpKernel\Controller\ControllerReference; |
10 | 10 | use Symfony\Component\Routing\Generator\UrlGeneratorInterface; |
11 | 11 | use Symfony\Component\Routing\RequestContext; |
@@ -36,15 +36,13 @@ protected function setUp(): void |
36 | 36 | { |
37 | 37 | parent::setUp(); |
38 | 38 |
|
39 | | - $this->faker = Factory::create(); |
40 | | - |
41 | 39 | $this->obTestObject = new RouteChecker( |
42 | 40 | $this->getRouteCollection(), |
43 | | - $this->container->get('global.request'), |
| 41 | + new Request(), |
44 | 42 | new RequestContext( |
45 | 43 | '', |
46 | 44 | 'GET', |
47 | | - $this->container->getParameter('local.http.host') |
| 45 | + 'test.loc' |
48 | 46 | ) |
49 | 47 | ); |
50 | 48 | } |
@@ -144,10 +142,10 @@ public function testGenerateUrlAbsoluteUrl() : void |
144 | 142 | UrlGeneratorInterface::ABSOLUTE_URL |
145 | 143 | ); |
146 | 144 |
|
147 | | - $expectedHost = 'http://' . $this->containerSymfony->getParameter('kernel.http.host'); |
| 145 | + $expectedHost = 'test.loc'; |
148 | 146 |
|
149 | 147 | $this->assertSame( |
150 | | - $expectedHost . '/api/testing/', |
| 148 | + 'http://' . $expectedHost . '/api/testing/', |
151 | 149 | $result, |
152 | 150 | 'Не верный url роута.' |
153 | 151 | ); |
@@ -225,7 +223,7 @@ private function getRouteCollection() : RouteCollection |
225 | 223 | ['_controller' => ExampleSimpleController::class, 'id' => $this->faker->numberBetween(100, 200)] |
226 | 224 | ); |
227 | 225 |
|
228 | | - $route->setHost($this->container->getParameter('kernel.http.host')); |
| 226 | + $route->setHost('test.loc'); |
229 | 227 |
|
230 | 228 | $routeCollection = new RouteCollection(); |
231 | 229 |
|
|
0 commit comments