Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Commit

Permalink
Merge pull request #289 from mbabker/sessionTestNS
Browse files Browse the repository at this point in the history
Namespace Session tests
  • Loading branch information
dongilbert committed Dec 1, 2013
2 parents 738f292 + c389d81 commit 3db74e6
Show file tree
Hide file tree
Showing 9 changed files with 216 additions and 38 deletions.
4 changes: 3 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<target name="phpdoc" description="Generate API documentation using phpDocumentor">
<exec executable="phpdoc${script-suffix}">
<arg value="-i" />
<arg path="${source}/Joomla/*/Tests/,${source}/Joomla/*/_Tests/,${source}/Joomla/*/tests/,${source}/Joomla/String/phputf8/" />
<arg path="${source}/Joomla/String/phputf8/,${source}/Joomla/*/Tests/,${source}/Joomla/*/_Tests/" />
<arg value="-d" />
<arg path="${source}" />
<arg value="-t" />
Expand All @@ -125,6 +125,8 @@
<arg value="joomla" />
<arg value="--title" />
<arg value="Joomla! Framework API" />
<arg value="--force" />
<arg value="--log" />
</exec>
</target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,33 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/

namespace Joomla\Session\Tests\Storage;

use Joomla\Session\Storage\Apc as StorageApc;
use Joomla\Session\Storage;

/**
* Test class for JSessionStorageApc.
* Test class for Joomla\Session\Storage\Apc.
*
* @since 1.0
*/
class JSessionStorageApcTest extends PHPUnit_Framework_TestCase
class ApcTest extends \PHPUnit_Framework_TestCase
{
/**
* @var JSessionStorageApc
* Test object
*
* @var StorageApc
* @since 1.0
*/
protected $object;

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
* @return void
*
* @since 1.0
*/
protected function setUp()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,40 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/

namespace Joomla\Session\Tests\Storage;

use Joomla\Session\Storage\Database as StorageDatabase;
use Joomla\Session\Storage;
use Joomla\Test\TestDatabase;

/**
* Test class for JSessionStorageDatabase.
* Generated by PHPUnit on 2011-10-26 at 19:36:07.
* Test class for Joomla\Session\Storage\Database.
*
* @since 1.0
*/
class JSessionStorageDatabaseTest extends TestDatabase
class DatabaseTest extends TestDatabase
{
/**
* @var StorageDatabase
* Test object
*
* @var StorageDatabase
* @since 1.0
*/
protected $object;

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
* @return void
*
* @since 1.0
*/
protected function setUp()
{
parent::setUp();

$this->object = Storage::getInstance('Database', array(
'db' => self::$driver
));
$this->object = Storage::getInstance('Database', array('db' => static::$driver));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,33 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/

namespace Joomla\Session\Tests\Storage;

use Joomla\Session\Storage\Memcache as StorageMemcache;
use Joomla\Session\Storage;

/**
* Test class for JSessionStorageMemcache.
* Generated by PHPUnit on 2011-10-26 at 19:36:04.
* Test class for Joomla\Session\Storage\Memcache.
*
* @since 1.0
*/
class JSessionStorageMemcacheTest extends PHPUnit_Framework_TestCase
class MemcacheTest extends \PHPUnit_Framework_TestCase
{
/**
* @var JSessionStorageMemcache
* Test object
*
* @var StorageMemcache
* @since 1.0
*/
protected $object;

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
* @return void
*
* @since 1.0
*/
protected function setUp()
{
Expand Down
138 changes: 138 additions & 0 deletions src/Joomla/Session/Tests/Storage/MemcachedTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<?php
/**
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/

namespace Joomla\Session\Tests\Storage;

use Joomla\Session\Storage\Memcached as StorageMemcached;
use Joomla\Session\Storage;

/**
* Test class for Joomla\Session\Storage\Memcached.
*
* @since 1.0
*/
class MemcachedTest extends \PHPUnit_Framework_TestCase
{
/**
* Test object
*
* @var StorageMemcached
* @since 1.0
*/
protected $object;

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*
* @since 1.0
*/
protected function setUp()
{
parent::setUp();

// Skip these tests if Memcache isn't available.
if (!StorageMemcached::isSupported())
{
$this->markTestSkipped('Memcached storage is not enabled on this system.');
}

$this->object = Storage::getInstance('Memcached');
}

/**
* Test...
*
* @todo Implement testOpen().
*
* @return void
*/
public function testOpen()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete('This test has not been implemented yet.');
}

/**
* Test...
*
* @todo Implement testClose().
*
* @return void
*/
public function testClose()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete('This test has not been implemented yet.');
}

/**
* Test...
*
* @todo Implement testRead().
*
* @return void
*/
public function testRead()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete('This test has not been implemented yet.');
}

/**
* Test...
*
* @todo Implement testWrite().
*
* @return void
*/
public function testWrite()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete('This test has not been implemented yet.');
}

/**
* Test...
*
* @todo Implement testDestroy().
*
* @return void
*/
public function testDestroy()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete('This test has not been implemented yet.');
}

/**
* Test...
*
* @todo Implement testGc().
*
* @return void
*/
public function testGc()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete('This test has not been implemented yet.');
}

/**
* Test...
*
* @todo Implement testIsSupported().
*
* @return void
*/
public function testIsSupported()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete('This test has not been implemented yet.');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,33 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/

namespace Joomla\Session\Tests\Storage;

use Joomla\Session\Storage\None as StorageNone;
use Joomla\Session\Storage;

/**
* Test class for JSessionStorageNone.
* Generated by PHPUnit on 2011-10-26 at 19:36:08.
* Test class for Joomla\Session\Storage\None.
*
* @since 1.0
*/
class JSessionStorageNoneTest extends PHPUnit_Framework_TestCase
class NoneTest extends \PHPUnit_Framework_TestCase
{
/**
* @var JSessionStorageNone
* Test object
*
* @var StorageNone
* @since 1.0
*/
protected $object;

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
* @return void
*
* @since 1.0
*/
protected function setUp()
{
Expand All @@ -33,9 +40,11 @@ protected function setUp()
}

/**
* Test JSessionStorageNone::Register().
* Test Joomla\Session\Storage\None::register().
*
* @return void
*
* @return void
* @since 1.0
*/
public function testRegister()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,33 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/

namespace Joomla\Session\Tests\Storage;

use Joomla\Session\Storage\Wincache as StorageWincache;
use Joomla\Session\Storage;

/**
* Test class for JSessionStorageWincache.
* Generated by PHPUnit on 2011-10-26 at 19:36:01.
* Test class for Joomla\Session\Storage\Wincache.
*
* @since 1.0
*/
class JSessionStorageWincacheTest extends PHPUnit_Framework_TestCase
class WincacheTest extends \PHPUnit_Framework_TestCase
{
/**
* @var JSessionStorageWincache
* Test object
*
* @var StorageWincache
* @since 1.0
*/
protected $object;

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
* @return void
*
* @since 1.0
*/
protected function setUp()
{
Expand Down
Loading

0 comments on commit 3db74e6

Please sign in to comment.