Skip to content

Commit

Permalink
removed tests for SF < 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Tetragramat committed Feb 11, 2020
1 parent b539345 commit ff70503
Showing 1 changed file with 0 additions and 66 deletions.
66 changes: 0 additions & 66 deletions Tests/EventListener/ReplyToHttpResponseListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,72 +83,6 @@ public function shouldSetResponseReturnedByConverterToEvent()
$this->assertSame($reply, $event->getThrowable());
}

/**
* @test
*/
public function shouldSetXStatusFromResponseStatusCode()
{
$reply = new HttpRedirect('/foo/bar');
$response = new Response('', 302, ['X-Status-Code' => 302]);

$event = new ExceptionEvent(
$this->createHttpKernelMock(),
new Request,
Kernel::MASTER_REQUEST,
$reply
);

$converterMock = $this->createReplyToSymfonyResponseConverterMock();
$converterMock
->expects($this->once())
->method('convert')
->with($this->identicalTo($reply))
->will($this->returnValue($response))
;

$listener = new ReplyToHttpResponseListener($converterMock);

$listener->onKernelException($event);

$this->assertInstanceOf(Response::class, $event->getResponse());
$this->assertTrue($event->getResponse()->headers->has('X-Status-Code'));
$this->assertEquals(302, $event->getResponse()->headers->get('X-Status-Code'));
}

/**
* @test
*/
public function shouldNotSetXStatusIfAlreadySet()
{
$reply = new HttpRedirect('/foo/bar');
$response = new Response('', 555, array(
'X-Status-Code' => 666,
));

$event = new ExceptionEvent(
$this->createHttpKernelMock(),
new Request,
Kernel::MASTER_REQUEST,
$reply
);

$converterMock = $this->createReplyToSymfonyResponseConverterMock();
$converterMock
->expects($this->once())
->method('convert')
->with($this->identicalTo($reply))
->will($this->returnValue($response))
;

$listener = new ReplyToHttpResponseListener($converterMock);

$listener->onKernelException($event);

$this->assertInstanceOf(Response::class, $event->getResponse());
$this->assertTrue($event->getResponse()->headers->has('X-Status-Code'));
$this->assertEquals(666, $event->getResponse()->headers->get('X-Status-Code'));
}

/**
* @test
*/
Expand Down

0 comments on commit ff70503

Please sign in to comment.