mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 23:16:13 +02:00
[ticket/11103] Handle the ext notification type better
We don't actually need to test the finder here, so don't copy the ext directory over PHPBB3-11103
This commit is contained in:
parent
b1ba7b27ad
commit
ead1d92b22
@ -10,52 +10,12 @@
|
||||
class phpbb_notification_test extends phpbb_database_test_case
|
||||
{
|
||||
protected $notifications;
|
||||
static private $copied_files = array();
|
||||
static private $helper;
|
||||
|
||||
public function getDataSet()
|
||||
{
|
||||
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/notification.xml');
|
||||
}
|
||||
|
||||
/**
|
||||
* This should only be called once before the tests are run.
|
||||
* This is used to copy the extensions to the phpBB install
|
||||
*/
|
||||
static public function setUpBeforeClass()
|
||||
{
|
||||
global $phpbb_root_path;
|
||||
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
self::$helper = new phpbb_test_case_helpers(self);
|
||||
|
||||
// First, move any extensions setup on the board to a temp directory
|
||||
self::$copied_files = self::$helper->copy_dir($phpbb_root_path . 'ext/', $phpbb_root_path . 'store/temp_ext/');
|
||||
|
||||
// Then empty the ext/ directory on the board (for accurate test cases)
|
||||
self::$helper->empty_dir($phpbb_root_path . 'ext/');
|
||||
|
||||
// Copy our ext/ files from the test case to the board
|
||||
self::$copied_files = array_merge(self::$copied_files, self::$helper->copy_dir(dirname(__FILE__) . '/ext/', $phpbb_root_path . 'ext/'));
|
||||
}
|
||||
|
||||
/**
|
||||
* This should only be called once after the tests are run.
|
||||
* This is used to remove the files copied to the phpBB install
|
||||
*/
|
||||
static public function tearDownAfterClass()
|
||||
{
|
||||
global $phpbb_root_path;
|
||||
|
||||
// Copy back the board installed extensions from the temp directory
|
||||
self::$helper->copy_dir($phpbb_root_path . 'store/temp_ext/', $phpbb_root_path . 'ext/');
|
||||
|
||||
self::$copied_files[] = $phpbb_root_path . 'store/temp_ext/';
|
||||
|
||||
// Remove all of the files we copied around (from board ext -> temp_ext, from test ext -> board ext)
|
||||
self::$helper->remove_files(self::$copied_files);
|
||||
}
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
@ -68,6 +28,8 @@ class phpbb_notification_test extends phpbb_database_test_case
|
||||
include($phpbb_root_path . 'includes/functions.' . $phpEx);
|
||||
}
|
||||
|
||||
include_once(__DIR__ . '/ext/test/notification/type/test.' . $phpEx);
|
||||
|
||||
$db = $this->new_dbal();
|
||||
$config = new phpbb_config(array(
|
||||
'allow_privmsg' => true,
|
||||
@ -111,7 +73,6 @@ class phpbb_notification_test extends phpbb_database_test_case
|
||||
$this->assertArrayHasKey('phpbb_notification_type_topic', $subscription_types['NOTIFICATION_GROUP_POSTING']);
|
||||
|
||||
$this->assertArrayHasKey('phpbb_notification_type_pm', $subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']);
|
||||
$this->assertArrayHasKey('phpbb_ext_test_notification_type_test', $subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']);
|
||||
|
||||
//get_subscription_types
|
||||
//get_subscription_methods
|
||||
|
Loading…
x
Reference in New Issue
Block a user