You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
sunspikes
changed the title
http-mock fails for the path '/' with the newest symfony router (3.4.8)
http-mock fails for the path '/' with the newest symfony routerx (3.4.8)
Apr 12, 2018
sunspikes
changed the title
http-mock fails for the path '/' with the newest symfony routerx (3.4.8)
http-mock fails for the path '/' with the newest symfony routers (3.4.8 || 4.0.8)
Apr 12, 2018
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:
This test will fail because now router will throw a
NoConfigurationException
The text was updated successfully, but these errors were encountered: