-
-
Save jmather/4320569 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Silex\WebTestCase; | |
use Silex\Application; | |
use Silex\Provider\SessionServiceProvider; | |
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; | |
class unitTest extends WebTestCase | |
{ | |
public function testUn() | |
{ | |
$client = $this->createClient(); | |
$client->request('GET', '/'); | |
$client->request('GET', '/'); | |
} | |
public function createApplication() | |
{ | |
$app = new Application('test'); | |
$app->register(new SessionServiceProvider()); | |
$app['session.storage'] = $app->share(function() { | |
return new MockArraySessionStorage(); | |
}); | |
$app['debug'] = true; | |
$app['exception_handler']->disable(); | |
$app->get('/', function(Application $app) { | |
$app['session']->set('pif', 'paf'); | |
return 'BOOM'; | |
}); | |
return $app; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment