File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1515 "require" : {
1616 "php" : " >=5.2.7"
1717 },
18+ "require-dev" : {
19+ "phpunit/phpunit" : " 5.5.x"
20+ },
1821 "autoload" : {
1922 "psr-0" : {
2023 "GuahanWeb\\ Http" : " src/"
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" utf-8" ?>
2+ <phpunit bootstrap =" ./vendor/autoload.php" >
3+ <testsuites >
4+ <testsuite name =" PHP Router Test Suite" >
5+ <directory >./tests</directory >
6+ </testsuite >
7+ </testsuites >
8+ </phpunit >
Original file line number Diff line number Diff line change 1+ <?php
2+ use PHPUnit \Framework \TestCase ;
3+ use GuahanWeb \Http ;
4+
5+ class RequestTest extends TestCase {
6+ protected function tearDown () {
7+ $ _SERVER = null ;
8+ }
9+
10+ public function testBasicAttributes () {
11+ // Mock request
12+ $ _SERVER = array (
13+ 'REQUEST_METHOD ' => 'GET ' ,
14+ 'REQUEST_URI ' => '/ '
15+ );
16+
17+ $ request = new Http \Request ();
18+ $ this ->assertEquals ($ request ->method , 'GET ' );
19+ $ this ->assertEquals ($ request ->uri , '/ ' );
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments