1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[feature/system-cron] Move tests to phpunit.xml and always load class loader

PHPBB3-9596
This commit is contained in:
Nils Adermann
2011-01-07 18:40:32 +01:00
committed by Oleg Pudeyev
parent 4fbf3fbd40
commit 6e5e4721d8
3 changed files with 12 additions and 59 deletions

View File

@@ -7,50 +7,39 @@
*
*/
define('IN_PHPBB', true);
require_once 'test_framework/framework.php';
// need the class loader since cron does not include/require cron task files
require($phpbb_root_path . 'includes/class_loader.' . $phpEx);
// do not use cache
$class_loader = new phpbb_class_loader($phpbb_root_path, '.' . $phpEx);
$class_loader->register();
require_once '../phpBB/includes/cron/manager.php';
class phpbb_cron_manager_test extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->manager = new phpbb_cron_manager();
}
public function test_manager_finds_shipped_tasks()
{
$tasks = $this->manager->find_cron_task_names();
$this->assertGreaterThan(1, count($tasks));
}
public function test_manager_finds_shipped_task_by_name()
{
$task = $this->manager->find_task('phpbb_cron_task_core_queue');
$this->assertNotNull($task);
}
public function test_manager_instantiates_task_by_name()
{
$task = $this->manager->instantiate_task('phpbb_cron_task_core_queue', array());
$this->assertNotNull($task);
}
public function test_manager_finds_all_ready_tasks()
{
$tasks = $this->manager->find_all_ready_tasks();
$this->assertGreaterThan(0, count($tasks));
}
public function test_manager_finds_one_ready_task() {
public function test_manager_finds_one_ready_task()
{
$task = $this->manager->find_one_ready_task();
$this->assertNotNull($task);
}