Commit a97c45e0 authored by Taylor Otwell's avatar Taylor Otwell

added session resolver tests.

parent 49c9094f
...@@ -221,11 +221,11 @@ return array( ...@@ -221,11 +221,11 @@ return array(
'laravel.session.cookie' => array('resolver' => function($container) 'laravel.session.cookie' => array('resolver' => function($container)
{ {
$cookies = $container->resolve('laravel.request')->input->cookies; $cookies = $container->resolve('laravel.cookie');
$config = $container->resolve('laravel.config')->get('session'); $config = $container->resolve('laravel.config')->get('session');
return new Session\Drivers\Cookie(Security\Crypter::make(), $cookies); return new Session\Drivers\Cookie($container->resolve('laravel.crypter'), $cookies);
}), }),
/* /*
...@@ -238,7 +238,7 @@ return array( ...@@ -238,7 +238,7 @@ return array(
{ {
$table = $container->resolve('laravel.config')->get('session.table'); $table = $container->resolve('laravel.config')->get('session.table');
return new Session\Drivers\Database($container->resolve('laravel.database.manager')->connection()); return new Session\Drivers\Database($container->resolve('laravel.database')->connection());
}), }),
/* /*
......
<?php
class SessionResolverTest extends PHPUnit_Framework_TestCase {
public function testDriversCanBeResolved()
{
IoC::resolve('laravel.config')->set('application.key', 'something');
$this->assertInstanceOf('Laravel\\Session\\Manager', IoC::resolve('laravel.session.manager'));
$this->assertInstanceOf('Laravel\\Session\\Drivers\\APC', IoC::resolve('laravel.session.apc'));
$this->assertInstanceOf('Laravel\\Session\\Drivers\\Cookie', IoC::resolve('laravel.session.cookie'));
$this->assertInstanceOf('Laravel\\Session\\Drivers\\Database', IoC::resolve('laravel.session.database'));
$this->assertInstanceOf('Laravel\\Session\\Drivers\\File', IoC::resolve('laravel.session.file'));
$this->assertInstanceOf('Laravel\\Session\\Drivers\\Memcached', IoC::resolve('laravel.session.memcached'));
}
}
\ No newline at end of file
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