Commit 8d41c599 authored by Igor Wiedler's avatar Igor Wiedler

add a test for getRequest()

parent 872da372
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace Silex\Tests; namespace Silex\Tests;
use Silex\Framework; use Silex\Framework;
use Symfony\Component\HttpFoundation\Request;
/* /*
* This file is part of the Silex framework. * This file is part of the Silex framework.
...@@ -48,4 +49,19 @@ class FrameworkTest extends \PHPUnit_Framework_TestCase ...@@ -48,4 +49,19 @@ class FrameworkTest extends \PHPUnit_Framework_TestCase
$returnValue = $framework->error(function() {}); $returnValue = $framework->error(function() {});
$this->assertSame($framework, $returnValue, '->error() should return $this'); $this->assertSame($framework, $returnValue, '->error() should return $this');
} }
public function testGetRequest()
{
$framework = new Framework();
$framework->get('/', function() {
return 'root';
});
$request = Request::create('/');
$framework->handle($request);
$this->assertEquals($request, $framework->getRequest());
}
} }
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