Skip to content
Snippets Groups Projects
Verified Commit 211394b7 authored by Thomas Flori's avatar Thomas Flori
Browse files

add a test in ServerResponseTest and the code-style command

parent 35e6a680
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,9 @@
"description": "A guzzle/psr-7 wrapper to add additional functionality like sending responses and managing cookies",
"type": "library",
"license": "MIT",
"scripts": {
"code-style": "phpcs --standard=PSR2 src && phpcs --standard=PSR2 --ignore=example tests"
},
"require": {
"guzzlehttp/psr7": "^1.4.2"
},
......
......@@ -239,7 +239,7 @@ class ClientResponseTest extends TestCase
{
$r1 = new Response(200, ['OWS' => " \t \tFoo\t \t "]);
$r2 = (new Response())->withHeader('OWS', " \t \tFoo\t \t ");
$r3 = (new Response())->withAddedHeader('OWS', " \t \tFoo\t \t ");;
$r3 = (new Response())->withAddedHeader('OWS', " \t \tFoo\t \t ");
foreach ([$r1, $r2, $r3] as $r) {
$this->assertSame(['OWS' => ['Foo']], $r->getHeaders());
......
......@@ -3,8 +3,18 @@
namespace Tal\Test;
use PHPUnit\Framework\TestCase;
use Tal\ServerResponse;
class ServerResponseTest extends TestCase
{
public function testSetCookieAddsHeader()
{
$response = new ServerResponse();
$response->setCookie('foo', 'bar');
self::assertEquals([
'Set-Cookie' => ['foo=bar']
], $response->getHeaders());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment