[HttpFoundation] Add and relocate tests.

This commit is contained in:
Drak 2012-03-03 08:49:40 +05:45
parent 88b1170356
commit 130831248d
12 changed files with 203 additions and 0 deletions

View File

@ -0,0 +1,69 @@
<?php
namespace Symfony\Tests\Component\HttpFoundation\Session\Storage\Proxy;
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy;
class ConcreteProxy extends AbstractProxy
{
}
/**
* Test class for AbstractProxy.
*
* @runTestsInSeparateProcesses
*/
class AbstractProxyTest extends \PHPUnit_Framework_TestCase
{
/**
* @var AbstractProxy
*/
protected $proxy;
protected function setUp()
{
$this->proxy = new ConcreteProxy;
}
protected function tearDown()
{
$this->proxy = null;
}
public function testGetSaveHandlerName()
{
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
public function testIsSessionHandlerInterface()
{
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
public function testIsWrapper()
{
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
public function testIsActive()
{
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
public function testSetActive()
{
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
}

View File

@ -0,0 +1,34 @@
<?php
namespace Symfony\Tests\Component\HttpFoundation\Session\Storage\Proxy;
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler;
/**
* Test class for NativeProxy.
*
* @runTestsInSeparateProcesses
*/
class NativeProxyPHP53Test extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (version_compare(phpversion(), '5.4.0', '>=')) {
$this->markTestSkipped('Test skipped, only for PHP 5.3');
}
}
public function testIsWrapper()
{
$proxy = new NativeProxy(new NativeFileSessionHandler());
$this->assertFalse($proxy->isWrapper());
}
public function testGetSaveHandlerName()
{
$name = ini_get('session.save_handler');
$proxy = new NativeProxy(new NativeFileSessionHandler());
$this->assertEquals($name, $proxy->getSaveHandlerName());
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace Symfony\Tests\Component\HttpFoundation\Session\Storage\Proxy;
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler;
/**
* Test class for NativeProxy.
*
* @runTestsInSeparateProcesses
*/
class NativeProxyPHP54Test extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (version_compare(phpversion(), '5.4.0', '<')) {
$this->markTestSkipped('Test skipped, only for PHP 5.4');
}
}
/**
* @expectedException \InvalidArgumentException
*/
public function testConstructor()
{
$proxy = new NativeProxy(new NativeFileSessionHandler());
$this->assertTrue($proxy->isWrapper());
}
}

View File

@ -0,0 +1,70 @@
<?php
namespace Symfony\Tests\Component\HttpFoundation\Session\Storage\Proxy;
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NullSessionHandler;
/**
* @runTestsInSeparateProcesses
*/
class SessionHandlerProxyTest extends \PHPUnit_Framework_TestCase
{
/**
* @var SessionHandlerProxy
*/
protected $proxy;
protected function setUp()
{
$this->proxy = new SessionHandlerProxy(new NullSessionHandler());
}
protected function tearDown()
{
$this->proxy = null;
}
public function testOpen()
{
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
public function testClose()
{
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
public function testRead()
{
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
public function testWrite()
{
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
public function testDestroy()
{
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
public function testGc()
{
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
}