Skip to content

Commit

Permalink
[HttpFoundation] Add and relocate tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Drak committed Mar 14, 2012
1 parent 88b1170 commit 1308312
Show file tree
Hide file tree
Showing 12 changed files with 203 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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.'
);
}

}
Original file line number Diff line number Diff line change
@@ -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());
}
}
Original file line number Diff line number Diff line change
@@ -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());
}
}
Original file line number Diff line number Diff line change
@@ -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.'
);
}

}

0 comments on commit 1308312

Please sign in to comment.