Merge pull request #296 from marc1706/ticket/293

[ticket/293] Use trimmessage as composer dependency
This commit is contained in:
Marc Alexander
2014-07-08 00:27:06 +02:00
4 changed files with 47 additions and 9 deletions

View File

@@ -41,7 +41,8 @@
}], }],
"require": { "require": {
"php": ">=5.3.3", "php": ">=5.3.3",
"satooshi/php-coveralls": "dev-master" "satooshi/php-coveralls": "dev-master",
"nickvergessen/phpbb-tool-trimmessage": "1.3.*"
}, },
"extra": { "extra": {
"display-name": "Board3 Portal", "display-name": "Board3 Portal",

44
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "dfb16d726d1c31c44d9dab2f34cc1d8d", "hash": "913c7bb36f43b871d1e5596aad308cf3",
"packages": [ "packages": [
{ {
"name": "guzzle/guzzle", "name": "guzzle/guzzle",
@@ -98,6 +98,48 @@
], ],
"time": "2014-05-07 17:04:22" "time": "2014-05-07 17:04:22"
}, },
{
"name": "nickvergessen/phpbb-tool-trimmessage",
"version": "1.3.0",
"source": {
"type": "git",
"url": "https://github.com/nickvergessen/phpbb-tool-trimmessage.git",
"reference": "2a3d8273dc1238dd06454688bcb6496f62f66c3b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nickvergessen/phpbb-tool-trimmessage/zipball/2a3d8273dc1238dd06454688bcb6496f62f66c3b",
"reference": "2a3d8273dc1238dd06454688bcb6496f62f66c3b",
"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": "2014-07-06 19:42:34"
},
{ {
"name": "psr/log", "name": "psr/log",
"version": "1.0.0", "version": "1.0.0",

View File

@@ -400,9 +400,9 @@ function character_limit(&$title, $limit = 0)
*/ */
function get_sub_taged_string($message, $bbcode_uid, $length) function get_sub_taged_string($message, $bbcode_uid, $length)
{ {
if (class_exists('\nickvergessen\trimmessage\trim_message')) if (class_exists('\Nickvergessen\TrimMessage\TrimMessage'))
{ {
$trim = new \nickvergessen\trimmessage\trim_message($message, $bbcode_uid, $length); $trim = new \Nickvergessen\TrimMessage\TrimMessage($message, $bbcode_uid, $length);
$message = $trim->message(); $message = $trim->message();
unset($trim); unset($trim);
} }

View File

@@ -59,11 +59,6 @@ class phpbb_functional_portal_announcement_test extends \board3\portal\tests\tes
public function test_shortened_message() public function test_shortened_message()
{ {
if (!class_exists('\nickvergessen\trimmessage\trim_message'))
{
$this->markTestSkipped('trimmessage is not available for testing.');
}
// 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,