mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
Merge branch 'develop-ascraeus' into develop
# By Joas Schilling # Via Dhruv Goel (1) and Joas Schilling (1) * develop-ascraeus: [ticket/12504] Use local variables where possible [ticket/12504] Use defined variables [ticket/12504] Remove unused request object from avatar manager test [ticket/12486] Make assertion on the return to remove "Risky" from phpunit [ticket/12486] Rename data provider to fix "Risky" from phpunit [ticket/12503] All tests should extend \phpbb_test_case
This commit is contained in:
commit
a9fe4ad1a4
7 changed files with 20 additions and 20 deletions
|
@ -9,29 +9,33 @@
|
|||
|
||||
require_once dirname(__FILE__) . '/driver/foobar.php';
|
||||
|
||||
class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase
|
||||
class phpbb_avatar_manager_test extends \phpbb_test_case
|
||||
{
|
||||
/** @var \phpbb\avatar\manager */
|
||||
protected $manager;
|
||||
protected $avatar_foobar;
|
||||
protected $avatar_barfoo;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
|
||||
// Mock phpbb_container
|
||||
$this->phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
|
||||
$this->phpbb_container->expects($this->any())
|
||||
$phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
|
||||
$phpbb_container->expects($this->any())
|
||||
->method('get')
|
||||
->will($this->returnArgument(0));
|
||||
|
||||
// Prepare dependencies for avatar manager and driver
|
||||
$config = new \phpbb\config\config(array());
|
||||
$request = $this->getMock('\phpbb\request\request');
|
||||
$cache = $this->getMock('\phpbb\cache\driver\driver_interface');
|
||||
$path_helper = new \phpbb\path_helper(
|
||||
new \phpbb\symfony_request(
|
||||
new phpbb_mock_request()
|
||||
),
|
||||
new \phpbb\filesystem(),
|
||||
$this->phpbb_root_path,
|
||||
$this->phpEx
|
||||
$phpbb_root_path,
|
||||
$phpEx
|
||||
);
|
||||
|
||||
// $this->avatar_foobar will be needed later on
|
||||
|
@ -60,7 +64,7 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase
|
|||
$config['allow_avatar_' . get_class($this->avatar_barfoo)] = false;
|
||||
|
||||
// Set up avatar manager
|
||||
$this->manager = new \phpbb\avatar\manager($config, $avatar_drivers, $this->phpbb_container);
|
||||
$this->manager = new \phpbb\avatar\manager($config, $avatar_drivers, $phpbb_container);
|
||||
}
|
||||
|
||||
protected function avatar_drivers()
|
||||
|
@ -222,8 +226,6 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase
|
|||
*/
|
||||
public function test_clean_row(array $input, array $output, $prefix = '')
|
||||
{
|
||||
$cleaned_row = array();
|
||||
|
||||
$cleaned_row = \phpbb\avatar\manager::clean_row($input, $prefix);
|
||||
foreach ($output as $key => $value)
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
|
|||
require_once dirname(__FILE__) . '/../../phpBB/includes/bbcode.php';
|
||||
require_once dirname(__FILE__) . '/../../phpBB/includes/message_parser.php';
|
||||
|
||||
class phpbb_bbcode_parser_test extends PHPUnit_Framework_TestCase
|
||||
class phpbb_bbcode_parser_test extends \phpbb_test_case
|
||||
{
|
||||
public function bbcode_firstpass_data()
|
||||
{
|
||||
|
|
6
tests/cache/null_driver_test.php
vendored
6
tests/cache/null_driver_test.php
vendored
|
@ -35,14 +35,12 @@ class phpbb_cache_null_driver_test extends phpbb_database_test_case
|
|||
|
||||
public function test_purge()
|
||||
{
|
||||
// does nothing
|
||||
$this->driver->purge();
|
||||
$this->assertNull($this->driver->purge());
|
||||
}
|
||||
|
||||
public function test_destroy()
|
||||
{
|
||||
// does nothing
|
||||
$this->driver->destroy('foo');
|
||||
$this->assertNull($this->driver->destroy('foo'));
|
||||
}
|
||||
|
||||
public function test_cache_sql()
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
class phpbb_class_loader_test extends PHPUnit_Framework_TestCase
|
||||
class phpbb_class_loader_test extends \phpbb_test_case
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@ require_once dirname(__FILE__) . '/tasks/simple_ready.php';
|
|||
require_once dirname(__FILE__) . '/tasks/simple_not_runnable.php';
|
||||
require_once dirname(__FILE__) . '/tasks/simple_should_not_run.php';
|
||||
|
||||
class phpbb_cron_manager_test extends PHPUnit_Framework_TestCase
|
||||
class phpbb_cron_manager_test extends \phpbb_test_case
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
class phpbb_passwords_helper_test extends PHPUnit_Framework_TestCase
|
||||
class phpbb_passwords_helper_test extends \phpbb_test_case
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
class phpbb_passwords_manager_test extends PHPUnit_Framework_TestCase
|
||||
class phpbb_passwords_manager_test extends \phpbb_test_case
|
||||
{
|
||||
protected $passwords_drivers;
|
||||
|
||||
|
@ -176,7 +176,7 @@ class phpbb_passwords_manager_test extends PHPUnit_Framework_TestCase
|
|||
}
|
||||
}
|
||||
|
||||
public function test_combined_hash_data()
|
||||
public function combined_hash_data()
|
||||
{
|
||||
if (version_compare(PHP_VERSION, '5.3.7', '<'))
|
||||
{
|
||||
|
@ -242,7 +242,7 @@ class phpbb_passwords_manager_test extends PHPUnit_Framework_TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* @dataProvider test_combined_hash_data
|
||||
* @dataProvider combined_hash_data
|
||||
*/
|
||||
public function test_combined_hash_password($first_type, $second_type, $expected = true)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue