Permalink
Browse files

Updated tests

  • Loading branch information...
1 parent b5a43a8 commit 502097c38214231a1a638785dcde7c81bfc8e30e @chanmix51 committed Mar 21, 2012
@@ -1,52 +0,0 @@
-<?php
-
-
-namespace \GHub\Silex\PommGuard\Test;
-
-use Silex\Application;
-use GHub\Silex\PommGuard\PommGuardServiceProvider;
-
-use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
-
-/**
- * Session test cases.
- *
- * @Grégoire Hubert <hubert.greg@gmail.com>
- */
-class PommGuardServiceProviderTest extends \PHPUnit_Framework_TestCase
-{
- public function testRegister()
- {
- $app = new Application();
-
- $app->register(new PommGuardServiceProvider(), array(
-
-));
-
- $app['session.storage'] = $app->share(function () use ($app) {
- return new MockArraySessionStorage();
- });
-
- $app->get('/login', function () use ($app) {
- $app['session']->set('logged_in', true);
- return 'Logged in successfully.';
- });
-
- $app->get('/account', function () use ($app) {
- if (!$app['session']->get('logged_in')) {
- return 'You are not logged in.';
- }
-
- return 'This is your account.';
- });
-
- $request = Request::create('/login');
- $response = $app->handle($request);
- $this->assertEquals('Logged in successfully.', $response->getContent());
-
- $request = Request::create('/account');
- $response = $app->handle($request);
- $this->assertEquals('This is your account.', $response->getContent());
- }
-}
@@ -21,7 +21,6 @@ public function testRegister()
{
$app = new Application();
- $app->register(new \Silex\Provider\SessionServiceProvider());
$app->register(new PommServiceProvider(), array(
'pomm.databases' => array('default' => array('dsn' => 'pgsql://test/test', 'name' => 'test'))
));

0 comments on commit 502097c

Please sign in to comment.