FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
phpbb3/tests/bbcode/url_bbcode_test.php at develop · upspace/phpbb3 · GitHub
upspace
/
phpbb3
Public
forked from
phpbb/phpbb
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
phpbb3
/
tests
/
bbcode
/
url_bbcode_test.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
63 lines (59 loc) · 1.92 KB
Breadcrumbs
phpbb3
/
tests
/
bbcode
/
url_bbcode_test.php
Copy path
File metadata and controls
63 lines (59 loc) · 1.92 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/**
*
* @package testing
* @copyright (c) 2010 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
require_once
dirname
(
__FILE__
) .
'
/../../phpBB/includes/functions.php
'
;
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_url_bbcode_test
extends
phpbb_test_case
{
public
function
url_bbcode_test_data
()
{
return
array
(
array
(
'
url only
'
,
'
[url]http://www.phpbb.com/community/[/url]
'
,
'
[url:]http://www.phpbb.com/community/[/url:]
'
),
array
(
'
url with title
'
,
'
[url=http://www.phpbb.com/community/]One line URL text[/url]
'
,
'
[url=http://www.phpbb.com/community/:]One line URL text[/url:]
'
),
array
(
'
url with multiline title
'
,
"
[url=http://www.phpbb.com/community/]Multiline
\x0A
URL
\x0A
text[/url]
"
,
"
[url=http://www.phpbb.com/community/:]Multiline
\x0A
URL
\x0A
text[/url:]
"
),
array
(
'
unclosed url with multiline
'
,
"
test [url] test
\x0A
test [url=http://www.phpbb.com/]test[/url] test
"
,
"
test [url] test
\x0A
test [url=http://www.phpbb.com/:]test[/url:] test
"
),
array
(
'
unclosed url with multiline and title
'
,
"
test [url=http://www.phpbb.com/]test
\x0A
[url]http://phpbb.com[/url] test
"
,
"
test [url=http://www.phpbb.com/:]test
\x0A
[url]http://phpbb.com[/url:] test
"
),
);
}
/**
* @dataProvider url_bbcode_test_data
*/
public
function
test_url
(
$
description
,
$
message
,
$
expected
)
{
global
$
user
,
$
request
;
$
user
=
new
phpbb_mock_user
;
$
request
=
new
phpbb_mock_request
;
$
bbcode
=
new
bbcode_firstpass
();
$
bbcode
->
message
=
$
message
;
$
bbcode
->
bbcode_init
(
false
);
$
bbcode
->
parse_bbcode
();
$
this
->
assertEquals
(
$
expected
,
$
bbcode
->
message
);
}
}
Back
|
FazBrowse Home
|
New Git URL