Commit 662d6af0 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[TASK] Drop an always skipped unit test

* Test relies on xdebug, which is not available on CI, this
  test is never executed there.
* Since the low level API header() is tested, the test
  additionally needs to fork a php process to do it's thing.
  This is ugly for a unit test.
* Turning the test into a functional test won't improve the
  situation since the response emitting is not done with
  functional sub requests.
* The skip logic breaks with xdebug 3.0 using xdebug.mode=off.

Resolves: #93598
Releases: master, 10.4, 9.5
Change-Id: Ibab9452bdcbc83228c1445db1a92b42db54dc192
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/68136

Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent c4e71261
......@@ -57,7 +57,7 @@ class NodeVisitor extends NodeVisitorAbstract
// PHPDocumentor 2 tags
'api', 'author', 'category', 'copyright', 'deprecated', 'example', 'filesource', 'global', 'ignore', 'internal', 'license', 'link', 'method', 'package', 'param', 'property', 'property-read', 'property-write', 'return', 'see', 'since', 'source', 'subpackage', 'throws', 'todo', 'TODO', 'usedby', 'uses', 'var', 'version',
// PHPUnit tags
'codeCoverageIgnore', 'codeCoverageIgnoreStart', 'codeCoverageIgnoreEnd', 'test', 'covers', 'dataProvider', 'group', 'skip', 'depends', 'expectedException', 'before', 'requires', 'runInSeparateProcess',
'codeCoverageIgnore', 'codeCoverageIgnoreStart', 'codeCoverageIgnoreEnd', 'test', 'covers', 'dataProvider', 'group', 'skip', 'depends', 'expectedException', 'before', 'requires',
// codeception tags
'env',
// PHPCheckStyle
......
<?php
namespace TYPO3\CMS\Core\Tests\Unit\Http;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Http\AbstractApplication;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
class AbstractApplicationTest extends UnitTestCase
{
/**
* @runInSeparateProcess
*/
public function testCookiesAreSentAsMultipleHeaders()
{
if (!extension_loaded('xdebug')) {
$this->markTestSkipped('This test can only be executed if xdebug is present.');
}
$application = new class extends AbstractApplication {
public function sendResponse(ResponseInterface $response)
{
parent::sendResponse($response);
}
};
$response = (new Response())
->withStatus(204)
->withAddedHeader('Cache-Control', 'public')
->withAddedHeader('Cache-Control', 'max-age=3600')
->withAddedHeader('Set-Cookie', 'foo=bar')
->withAddedHeader('Set-Cookie', 'baz=foobar');
$application->sendResponse($response);
$this->assertSame([
'Cache-Control: public, max-age=3600',
'Set-Cookie: foo=bar',
'Set-Cookie: baz=foobar',
], xdebug_get_headers());
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment