Skip to content

Commit

Permalink
Added Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mathmarques committed Mar 21, 2017
1 parent c5dcaf4 commit c491a0c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/Http/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,20 @@ public function testWithMethod()
$this->assertAttributeEquals('PUT', 'originalMethod', $request);
}

public function testWithAllAllowedCharactersMethod()
{
$request = $this->requestFactory()->withMethod("!#$%&'*+.^_`|~09AZ-");

$this->assertAttributeEquals("!#$%&'*+.^_`|~09AZ-", 'method', $request);
$this->assertAttributeEquals("!#$%&'*+.^_`|~09AZ-", 'originalMethod', $request);
}

/**
* @expectedException \InvalidArgumentException
*/
public function testWithMethodInvalid()
{
$this->requestFactory()->withMethod('FOO');
$this->requestFactory()->withMethod('B@R');
}

public function testWithMethodNull()
Expand Down Expand Up @@ -208,7 +216,7 @@ public function testCreateRequestWithInvalidMethodString()
$cookies = [];
$serverParams = [];
$body = new RequestBody();
$request = new Request('FOO', $uri, $headers, $cookies, $serverParams, $body);
$request = new Request('B@R', $uri, $headers, $cookies, $serverParams, $body);
}

/**
Expand Down

0 comments on commit c491a0c

Please sign in to comment.