Skip to content

Commit e0b4543

Browse files
committed
Тесты.
1 parent be08905 commit e0b4543

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Tests/Cases/RoutingTest.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace Prokl\WpSymfonyRouterBundle\Tests\Cases;
44

5-
use Faker\Factory;
65
use Prokl\WpSymfonyRouterBundle\Services\Utils\RouteChecker;
76
use Prokl\WpSymfonyRouterBundle\Tests\Fixture\ExampleSimpleController;
87
use Prokl\WpSymfonyRouterBundle\Tests\Tools\ContainerAwareBaseTestCase;
8+
use Symfony\Component\HttpFoundation\Request;
99
use Symfony\Component\HttpKernel\Controller\ControllerReference;
1010
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
1111
use Symfony\Component\Routing\RequestContext;
@@ -36,15 +36,13 @@ protected function setUp(): void
3636
{
3737
parent::setUp();
3838

39-
$this->faker = Factory::create();
40-
4139
$this->obTestObject = new RouteChecker(
4240
$this->getRouteCollection(),
43-
$this->container->get('global.request'),
41+
new Request(),
4442
new RequestContext(
4543
'',
4644
'GET',
47-
$this->container->getParameter('local.http.host')
45+
'test.loc'
4846
)
4947
);
5048
}
@@ -144,10 +142,10 @@ public function testGenerateUrlAbsoluteUrl() : void
144142
UrlGeneratorInterface::ABSOLUTE_URL
145143
);
146144

147-
$expectedHost = 'http://' . $this->containerSymfony->getParameter('kernel.http.host');
145+
$expectedHost = 'test.loc';
148146

149147
$this->assertSame(
150-
$expectedHost . '/api/testing/',
148+
'http://' . $expectedHost . '/api/testing/',
151149
$result,
152150
'Не верный url роута.'
153151
);
@@ -225,7 +223,7 @@ private function getRouteCollection() : RouteCollection
225223
['_controller' => ExampleSimpleController::class, 'id' => $this->faker->numberBetween(100, 200)]
226224
);
227225

228-
$route->setHost($this->container->getParameter('kernel.http.host'));
226+
$route->setHost('test.loc');
229227

230228
$routeCollection = new RouteCollection();
231229

0 commit comments

Comments
 (0)