[ticket/690] Update test for phpBB 3.2.0 and PHP 7.1 compatibility
B3P-690
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
}],
|
}],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.9",
|
"php": ">=5.3.9",
|
||||||
"nickvergessen/phpbb-tool-trimmessage": "1.3.*"
|
"marc1706/phpbb-text-shortener": "^0.1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpbb/epv": "dev-master"
|
"phpbb/epv": "dev-master"
|
||||||
|
|||||||
101
composer.lock
generated
101
composer.lock
generated
@@ -4,49 +4,62 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"hash": "16fa7b983ba4704c2b4fb11611f8c1d7",
|
"hash": "f79966a0c35657dc6831652d3a8b0f6e",
|
||||||
|
"content-hash": "eec8e152b8e3363ee143a27bf2481202",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "nickvergessen/phpbb-tool-trimmessage",
|
"name": "marc1706/phpbb-text-shortener",
|
||||||
"version": "1.3.1",
|
"version": "v0.1.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/nickv-phpbb/phpbb-tool-trimmessage.git",
|
"url": "https://github.com/marc1706/phpbb-text-shortener.git",
|
||||||
"reference": "0ed883bc2d473ec2e84cabb9c9395785daeeebcf"
|
"reference": "c698ea6e7527513e8ac98f385e076cdbc405a5d2"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/nickv-phpbb/phpbb-tool-trimmessage/zipball/0ed883bc2d473ec2e84cabb9c9395785daeeebcf",
|
"url": "https://api.github.com/repos/marc1706/phpbb-text-shortener/zipball/c698ea6e7527513e8ac98f385e076cdbc405a5d2",
|
||||||
"reference": "0ed883bc2d473ec2e84cabb9c9395785daeeebcf",
|
"reference": "c698ea6e7527513e8ac98f385e076cdbc405a5d2",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.3"
|
"php": ">=5.4.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "4.1.*"
|
"phpunit/phpunit": "4.*",
|
||||||
|
"symfony/yaml": "~2.8"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"classmap": [
|
"psr-4": {
|
||||||
"src/"
|
"Marc1706\\TextShortener\\": "src",
|
||||||
]
|
"Marc1706\\TextShortener\\tests\\": "tests"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
"GPL-2.0"
|
"MIT"
|
||||||
],
|
],
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Joas Schilling",
|
"name": "Marc Alexander",
|
||||||
"email": "nickvergessen@gmx.de",
|
"email": "admin@m-a-styles.de",
|
||||||
"homepage": "https://github.com/nickvergessen",
|
"homepage": "https://www.m-a-styles.de",
|
||||||
"role": "Developer"
|
"role": "Developer"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "This tool contains a class, that is able to trim a message from the phpbb message_parser to a maximum length without breaking the bbcodes/smilies and links.",
|
"description": "Library for shortening post text in phpBB 3.2.x",
|
||||||
"homepage": "https://github.com/nickvergessen/phpbb-tool-trimmessage",
|
"homepage": "https://www.m-a-styles.de",
|
||||||
"time": "2015-04-17 16:41:50"
|
"keywords": [
|
||||||
|
"bbcode",
|
||||||
|
"extension",
|
||||||
|
"extensions",
|
||||||
|
"minify",
|
||||||
|
"php",
|
||||||
|
"phpbb",
|
||||||
|
"post",
|
||||||
|
"shortening"
|
||||||
|
],
|
||||||
|
"time": "2016-01-10 11:01:04"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"packages-dev": [
|
"packages-dev": [
|
||||||
@@ -102,6 +115,48 @@
|
|||||||
"homepage": "http://gitonomy.com",
|
"homepage": "http://gitonomy.com",
|
||||||
"time": "2014-07-13 19:02:31"
|
"time": "2014-07-13 19:02:31"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "nickvergessen/phpbb-tool-trimmessage",
|
||||||
|
"version": "1.3.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/nickv-phpbb/phpbb-tool-trimmessage.git",
|
||||||
|
"reference": "0ed883bc2d473ec2e84cabb9c9395785daeeebcf"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/nickv-phpbb/phpbb-tool-trimmessage/zipball/0ed883bc2d473ec2e84cabb9c9395785daeeebcf",
|
||||||
|
"reference": "0ed883bc2d473ec2e84cabb9c9395785daeeebcf",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.3"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "4.1.*"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"classmap": [
|
||||||
|
"src/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"GPL-2.0"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Joas Schilling",
|
||||||
|
"email": "nickvergessen@gmx.de",
|
||||||
|
"homepage": "https://github.com/nickvergessen",
|
||||||
|
"role": "Developer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "This tool contains a class, that is able to trim a message from the phpbb message_parser to a maximum length without breaking the bbcodes/smilies and links.",
|
||||||
|
"homepage": "https://github.com/nickvergessen/phpbb-tool-trimmessage",
|
||||||
|
"time": "2015-04-17 16:41:50"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "nikic/php-parser",
|
"name": "nikic/php-parser",
|
||||||
"version": "v0.9.5",
|
"version": "v0.9.5",
|
||||||
@@ -157,7 +212,7 @@
|
|||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpbb/epv/zipball/d837a835dfdfdac233854d9e50d58565542764cb",
|
"url": "https://api.github.com/repos/phpbb/epv/zipball/87c89df9560431910fa9027a8129a9efac362ba4",
|
||||||
"reference": "75df9936ffbb8f05a1351cf622cf6f41c7d2d9f2",
|
"reference": "75df9936ffbb8f05a1351cf622cf6f41c7d2d9f2",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
@@ -246,12 +301,12 @@
|
|||||||
"target-dir": "Symfony/Component/Console",
|
"target-dir": "Symfony/Component/Console",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/Console.git",
|
"url": "https://github.com/symfony/console.git",
|
||||||
"reference": "53f86497ccd01677e22435cfb7262599450a90d1"
|
"reference": "53f86497ccd01677e22435cfb7262599450a90d1"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/Console/zipball/53f86497ccd01677e22435cfb7262599450a90d1",
|
"url": "https://api.github.com/repos/symfony/console/zipball/53f86497ccd01677e22435cfb7262599450a90d1",
|
||||||
"reference": "53f86497ccd01677e22435cfb7262599450a90d1",
|
"reference": "53f86497ccd01677e22435cfb7262599450a90d1",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
@@ -457,7 +512,7 @@
|
|||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": ">=5.3.3"
|
"php": ">=5.3.9"
|
||||||
},
|
},
|
||||||
"platform-dev": []
|
"platform-dev": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -281,6 +281,9 @@ class calendar extends module_base
|
|||||||
|
|
||||||
foreach ($events as $key => $cur_event)
|
foreach ($events as $key => $cur_event)
|
||||||
{
|
{
|
||||||
|
$cur_event['start_time'] = (int) $cur_event['start_time'];
|
||||||
|
$cur_event['end_time'] = (int) $cur_event['end_time'];
|
||||||
|
|
||||||
if (($cur_event['start_time'] + $this->time->getOffset()) >= $today_timestamp ||
|
if (($cur_event['start_time'] + $this->time->getOffset()) >= $today_timestamp ||
|
||||||
($cur_event['end_time'] + $this->time->getOffset()) >= $today_timestamp ||
|
($cur_event['end_time'] + $this->time->getOffset()) >= $today_timestamp ||
|
||||||
(($cur_event['start_time'] + $this->time->getOffset() + self::TIME_DAY) >= $today_timestamp && $cur_event['all_day']))
|
(($cur_event['start_time'] + $this->time->getOffset() + self::TIME_DAY) >= $today_timestamp && $cur_event['all_day']))
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ class welcome extends module_base
|
|||||||
default:
|
default:
|
||||||
if (!isset($welcome_message))
|
if (!isset($welcome_message))
|
||||||
{
|
{
|
||||||
$welcome_message = generate_text_for_edit($portal_config['board3_welcome_message_' . $module_id], $this->config['board3_welcome_message_uid_' . $module_id], '');
|
$welcome_message = generate_text_for_edit($portal_config['board3_welcome_message_' . $module_id], $this->config['board3_welcome_message_uid_' . $module_id], 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->template->assign_vars(array(
|
$this->template->assign_vars(array(
|
||||||
|
|||||||
@@ -649,10 +649,11 @@ class fetch_posts
|
|||||||
*/
|
*/
|
||||||
public function shorten_message($message, $bbcode_uid, $length)
|
public function shorten_message($message, $bbcode_uid, $length)
|
||||||
{
|
{
|
||||||
if (class_exists('\Nickvergessen\TrimMessage\TrimMessage'))
|
if (class_exists('\Marc1706\TextShortener\Shortener'))
|
||||||
{
|
{
|
||||||
$trim = new \Nickvergessen\TrimMessage\TrimMessage($message, $bbcode_uid, $length);
|
$trim = new \Marc1706\TextShortener\Shortener();
|
||||||
$message = $trim->message();
|
$message = $trim->setText($message)
|
||||||
|
->shortenText($length);
|
||||||
unset($trim);
|
unset($trim);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,8 +60,6 @@ class phpbb_functional_portal_announcement_test extends \board3\portal\tests\tes
|
|||||||
|
|
||||||
public function test_shortened_message()
|
public function test_shortened_message()
|
||||||
{
|
{
|
||||||
$this->markTestIncomplete('Trim message tool no longer works correctly for new posts in 3.2.x');
|
|
||||||
|
|
||||||
// Create topic as announcement
|
// Create topic as announcement
|
||||||
$data = $this->create_topic(2, 'Portal-announce-global', str_repeat('This is a global announcement for the portal', 6), array(
|
$data = $this->create_topic(2, 'Portal-announce-global', str_repeat('This is a global announcement for the portal', 6), array(
|
||||||
'topic_type' => POST_GLOBAL,
|
'topic_type' => POST_GLOBAL,
|
||||||
@@ -71,7 +69,7 @@ class phpbb_functional_portal_announcement_test extends \board3\portal\tests\tes
|
|||||||
{
|
{
|
||||||
// no errors should appear on portal
|
// no errors should appear on portal
|
||||||
$crawler = self::request('GET', 'app.php/portal');
|
$crawler = self::request('GET', 'app.php/portal');
|
||||||
$this->assertContains('This is a global announc [...]', $crawler->text());
|
$this->assertContains('This is a global announc ...', $crawler->text());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,8 +59,7 @@ class listener_test extends \phpbb_template_template_test_case
|
|||||||
$manager = new \phpbb_mock_extension_manager(dirname(__FILE__) . '/', array());
|
$manager = new \phpbb_mock_extension_manager(dirname(__FILE__) . '/', array());
|
||||||
$finder = new \phpbb\finder(
|
$finder = new \phpbb\finder(
|
||||||
new \phpbb\filesystem\filesystem(),
|
new \phpbb\filesystem\filesystem(),
|
||||||
dirname(__FILE__) . '/',
|
dirname(__FILE__) . '/'
|
||||||
new \phpbb_mock_cache()
|
|
||||||
);
|
);
|
||||||
$finder->set_extensions(array_keys($manager->all_enabled()));
|
$finder->set_extensions(array_keys($manager->all_enabled()));
|
||||||
$request = new \phpbb_mock_request();
|
$request = new \phpbb_mock_request();
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class board3_includes_modules_helper_test extends \board3\portal\tests\testframe
|
|||||||
|
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx;
|
global $phpbb_root_path, $phpEx, $phpbb_dispatcher;
|
||||||
|
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
@@ -37,6 +37,7 @@ class board3_includes_modules_helper_test extends \board3\portal\tests\testframe
|
|||||||
$controller_helper->add_route('board3_portal_controller', 'portal');
|
$controller_helper->add_route('board3_portal_controller', 'portal');
|
||||||
|
|
||||||
$this->modules_helper = new \board3\portal\includes\modules_helper($auth, $this->config, $controller_helper, $request);
|
$this->modules_helper = new \board3\portal\includes\modules_helper($auth, $this->config, $controller_helper, $request);
|
||||||
|
$phpbb_dispatcher = new \phpbb_mock_event_dispatcher();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function data_get_disallowed_forums()
|
public function data_get_disallowed_forums()
|
||||||
|
|||||||
Reference in New Issue
Block a user