aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2013-09-10 15:31:52 +0200
committerNils Adermann <naderman@naderman.de>2013-09-16 00:39:34 +0200
commit2a1207b14f7792b935ffd6ffff9d6c89fcce638b (patch)
tree18719bcb3e9e1d77714d0a9ae145a0aa69118c4c
parent239381b946e20e98459dfa5f36962df37cd76d82 (diff)
downloadforums-2a1207b14f7792b935ffd6ffff9d6c89fcce638b.tar
forums-2a1207b14f7792b935ffd6ffff9d6c89fcce638b.tar.gz
forums-2a1207b14f7792b935ffd6ffff9d6c89fcce638b.tar.bz2
forums-2a1207b14f7792b935ffd6ffff9d6c89fcce638b.tar.xz
forums-2a1207b14f7792b935ffd6ffff9d6c89fcce638b.zip
[ticket/11700] Correclty use namespaces in notifications
PHPBB3-11700
-rw-r--r--phpBB/phpbb/notification/type/base.php26
-rw-r--r--tests/notification/convert_test.php2
-rw-r--r--tests/notification/ext/test/notification/type/test.php4
-rw-r--r--tests/notification/manager_helper.php4
-rw-r--r--tests/notification/notification_test.php2
-rw-r--r--tests/notification/submit_post_base.php2
6 files changed, 21 insertions, 19 deletions
diff --git a/phpBB/phpbb/notification/type/base.php b/phpBB/phpbb/notification/type/base.php
index 1605f59c55..cc0355771b 100644
--- a/phpBB/phpbb/notification/type/base.php
+++ b/phpBB/phpbb/notification/type/base.php
@@ -95,7 +95,7 @@ abstract class base implements \phpbb\notification\type\type_interface
/**
* Notification Type Base Constructor
- *
+ *
* @param \phpbb\user_loader $user_loader
* @param \phpbb\db\driver\driver $db
* @param \phpbb\cache\driver\driver_interface $cache
@@ -128,7 +128,7 @@ abstract class base implements \phpbb\notification\type\type_interface
/**
* Set notification manager (required)
- *
+ *
* @param \phpbb\notification\manager $notification_manager
*/
public function set_notification_manager(\phpbb\notification\manager $notification_manager)
@@ -152,7 +152,7 @@ abstract class base implements \phpbb\notification\type\type_interface
/**
* Magic method to get data from this notification
- *
+ *
* @param mixed $name
* @return mixed
*/
@@ -164,7 +164,7 @@ abstract class base implements \phpbb\notification\type\type_interface
/**
* Magic method to set data on this notification
- *
+ *
* @param mixed $name
* @return null
*/
@@ -176,9 +176,9 @@ abstract class base implements \phpbb\notification\type\type_interface
/**
* Magic method to get a string of this notification
- *
+ *
* Primarily for testing
- *
+ *
* @param string $name
* @return mixed
*/
@@ -222,9 +222,9 @@ abstract class base implements \phpbb\notification\type\type_interface
{
// Defaults
$this->data = array_merge(array(
- 'item_id' => \static::get_item_id($type_data),
+ 'item_id' => static::get_item_id($type_data),
'notification_type_id' => $this->notification_type_id,
- 'item_parent_id' => \static::get_item_parent_id($type_data),
+ 'item_parent_id' => static::get_item_parent_id($type_data),
'notification_time' => time(),
'notification_read' => false,
@@ -285,7 +285,7 @@ abstract class base implements \phpbb\notification\type\type_interface
/**
* Prepare to output the notification to the template
- *
+ *
* @return array Template variables
*/
public function prepare_for_display()
@@ -333,7 +333,7 @@ abstract class base implements \phpbb\notification\type\type_interface
/**
* Get the user's avatar (fall back)
- *
+ *
* @return string
*/
public function get_avatar()
@@ -343,7 +343,7 @@ abstract class base implements \phpbb\notification\type\type_interface
/**
* Get the special items to load (fall back)
- *
+ *
* @return array
*/
public function get_load_special()
@@ -361,7 +361,7 @@ abstract class base implements \phpbb\notification\type\type_interface
/**
* Is available (fall back)
- *
+ *
* @return bool
*/
public function is_available()
@@ -371,7 +371,7 @@ abstract class base implements \phpbb\notification\type\type_interface
/**
* Pre create insert array function (fall back)
- *
+ *
* @return array
*/
public function pre_create_insert_array($type_data, $notify_users)
diff --git a/tests/notification/convert_test.php b/tests/notification/convert_test.php
index e0449cef89..ed1fa9b1bf 100644
--- a/tests/notification/convert_test.php
+++ b/tests/notification/convert_test.php
@@ -25,7 +25,7 @@ class phpbb_notification_convert_test extends phpbb_database_test_case
$this->db = $this->new_dbal();
- $this->migration = new \phpbb\db\migration\data0\notification_options_reconvert(
+ $this->migration = new \phpbb\db\migration\data\v310\notification_options_reconvert(
new \phpbb\config\config(array()),
$this->db,
new \phpbb\db\tools($this->db),
diff --git a/tests/notification/ext/test/notification/type/test.php b/tests/notification/ext/test/notification/type/test.php
index 629954efce..cdb921ca3b 100644
--- a/tests/notification/ext/test/notification/type/test.php
+++ b/tests/notification/ext/test/notification/type/test.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\type;
+
/**
* @ignore
*/
@@ -15,7 +17,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-class phpbb_notification_type_test extends \phpbb\notification\type\base
+class test extends \phpbb\notification\type\base
{
public function get_type()
{
diff --git a/tests/notification/manager_helper.php b/tests/notification/manager_helper.php
index 95caa7c0ba..731dd00b7a 100644
--- a/tests/notification/manager_helper.php
+++ b/tests/notification/manager_helper.php
@@ -40,7 +40,7 @@ class phpbb_notification_manager_helper extends \phpbb\notification\manager
*/
public function get_item_type_class($item_type, $data = array())
{
- $item_type = 'phpbb_notification_type_' . $item_type;
+ $item_type = 'phpbb\notification\type\\' . $item_type;
$item = new $item_type($this->user_loader, $this->db, $this->cache->get_driver(), $this->user, $this->auth, $this->config, $this->phpbb_root_path, $this->php_ext, $this->notification_types_table, $this->notifications_table, $this->user_notifications_table);
@@ -56,7 +56,7 @@ class phpbb_notification_manager_helper extends \phpbb\notification\manager
*/
public function get_method_class($method_name)
{
- $method_name = 'phpbb_notification_method_' . $method_name;
+ $method_name = 'phpbb\notification\method\\' . $method_name;
$method = new $method_name($this->user_loader, $this->db, $this->cache->get_driver(), $this->user, $this->auth, $this->config, $this->phpbb_root_path, $this->php_ext, $this->notification_types_table, $this->notifications_table, $this->user_notifications_table);
diff --git a/tests/notification/notification_test.php b/tests/notification/notification_test.php
index 1e2ce13956..4c7ce9a784 100644
--- a/tests/notification/notification_test.php
+++ b/tests/notification/notification_test.php
@@ -83,7 +83,7 @@ class phpbb_notification_test extends phpbb_database_test_case
'topic_in_queue',
) as $type)
{
- $class = $this->build_type('phpbb_notification_type_' . $type);
+ $class = $this->build_type('\phpbb\notification\type\\' . $type);
$types[$type] = $class;
$this->container->set('notification.type.' . $type, $class);
diff --git a/tests/notification/submit_post_base.php b/tests/notification/submit_post_base.php
index 09cd7b4213..8597c626a4 100644
--- a/tests/notification/submit_post_base.php
+++ b/tests/notification/submit_post_base.php
@@ -105,7 +105,7 @@ class phpbb_notification_submit_post_base extends phpbb_database_test_case
$notification_types_array = array();
foreach ($notification_types as $type)
{
- $class_name = 'phpbb_notification_type_' . $type;
+ $class_name = '\phpbb\notification\type\\' . $type;
$class = new $class_name(
$user_loader, $db, $cache->get_driver(), $user, $auth, $config,
$phpbb_root_path, $phpEx,