-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Description
This new change in symfony router (symfony/symfony#26792), now adds an extra check to make sure there are allowed methods configured in case the matching path is '/'.
I am not 100% sure if this is a side effect of a bit hacky approach to rely on app errors (without registering any proper routes) or a possible BC break by the symfony router.
Example test case:
<?php
namespace Tests;
use InterNations\Component\HttpMock\PHPUnit\HttpMockTrait;
use PHPUnit\Framework\TestCase;
class ExampleTest extends TestCase
{
use HttpMockTrait;
public static function setUpBeforeClass()
{
static::setUpHttpMockBeforeClass('8082', 'localhost');
}
public static function tearDownAfterClass()
{
static::tearDownHttpMockAfterClass();
}
public function setUp()
{
$this->setUpHttpMock();
}
public function tearDown()
{
$this->tearDownHttpMock();
}
public function testSimpleRequest()
{
$this->http->mock
->when()
->methodIs('GET')
->pathIs('/')
->then()
->body('mocked body')
->end();
$this->http->setUp();
$this->assertSame('mocked body', file_get_contents('http://localhost:8082/'));
}
}
This test will fail because now router will throw a NoConfigurationException
Metadata
Metadata
Assignees
Labels
No labels