-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathDeleteRequestTest.php
More file actions
42 lines (35 loc) · 1.12 KB
/
DeleteRequestTest.php
File metadata and controls
42 lines (35 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php declare(strict_types=1);
namespace hollodotme\FastCGI\Tests\Unit\Requests;
use hollodotme\FastCGI\RequestContents\UrlEncodedFormData;
use hollodotme\FastCGI\Requests\DeleteRequest;
use PHPUnit\Framework\ExpectationFailedException;
use PHPUnit\Framework\TestCase;
use SebastianBergmann\RecursionContext\InvalidArgumentException;
final class DeleteRequestTest extends TestCase
{
/**
* @throws ExpectationFailedException
* @throws InvalidArgumentException
*/
public function testRequestMethodIsGet() : void
{
$request = new DeleteRequest( '/path/to/script.php' );
self::assertSame( 'DELETE', $request->getRequestMethod() );
}
/**
* @throws ExpectationFailedException
* @throws InvalidArgumentException
*/
public function testCanCreateInstanceWithRequestContent() : void
{
$urlEncodedContent = new UrlEncodedFormData(
[
'unit' => 'test',
'test' => 'unit',
]
);
$request = new DeleteRequest( '/path/to/script.php', $urlEncodedContent );
self::assertSame( 'application/x-www-form-urlencoded', $request->getContentType() );
self::assertSame( 'unit=test&test=unit', $request->getContent() );
}
}