mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 06:18:52 +00:00
* develop: (441 commits) [feature/new-tz-handling] Don't use global user but make it a parameter [feature/new-tz-handling] Fix size of suggestion button in chrome [feature/new-tz-handling] Fall back to UTC, if the timezone is invalid [feature/new-tz-handling] Add previous selected value to validation if valid [feature/new-tz-handling] Display suggestion when a different value is selected [ticket/10998] Add border-radius to forum rules block - prosilver [feature/new-tz-handling] Remove additional marking of selected items [feature/new-tz-handling] Move update helper function to new class [feature/new-tz-handling] Fix unit test [feature/new-tz-handling] Delete old variable which is not used anymore [feature/new-tz-handling] Rename $user->tz back to $user->timezone [feature/pagination-as-list] New parameter for name of start var [feature/pagination-as-list] Updates for nils comments [feature/pagination-as-list] Rename and deprecate functions [feature/pagination-as-list] Various fixes and improvements [ticket/10968] Render pagination within the template [feature/new-tz-handling] Remove "timezone might be numeric" [feature/new-tz-handling] Add function to update the timezone [feature/new-tz-handling] Correctly update user and board timezones on update [ticket/10996] Use correct DBMS name in Travis config for PostgreSQL ... Conflicts: phpBB/common.php phpBB/composer.json phpBB/composer.lock tests/cron/task_provider_test.php
50 lines
1.2 KiB
PHP
50 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
*
|
|
* @package testing
|
|
* @copyright (c) 2010 phpBB Group
|
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
|
*
|
|
*/
|
|
|
|
class phpbb_cron_task_provider_test extends PHPUnit_Framework_TestCase
|
|
{
|
|
public function setUp()
|
|
{
|
|
$this->tasks = array(
|
|
'phpbb_cron_task_core_dummy_task',
|
|
'phpbb_cron_task_core_second_dummy_task',
|
|
'phpbb_ext_testext_cron_dummy_task',
|
|
);
|
|
|
|
$container = $this->getMock('Symfony\Component\DependencyInjection\TaggedContainerInterface');
|
|
$container
|
|
->expects($this->once())
|
|
->method('findTaggedServiceIds')
|
|
->will($this->returnValue(array_flip($this->tasks)));
|
|
$container
|
|
->expects($this->any())
|
|
->method('get')
|
|
->will($this->returnCallback(function ($name) {
|
|
return new $name;
|
|
}));
|
|
|
|
$this->provider = new phpbb_cron_task_provider($container);
|
|
}
|
|
|
|
public function test_manager_finds_shipped_tasks()
|
|
{
|
|
$task_names = array();
|
|
foreach ($this->provider as $task)
|
|
{
|
|
$task_names[] = $task->get_name();
|
|
}
|
|
sort($task_names);
|
|
|
|
$this->assertEquals(array(
|
|
'phpbb_cron_task_core_dummy_task',
|
|
'phpbb_cron_task_core_second_dummy_task',
|
|
'phpbb_ext_testext_cron_dummy_task',
|
|
), $task_names);
|
|
}
|
|
}
|