Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F623178
EntityTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
EntityTest.php
View Options
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace
Longman
\
TelegramBot
\
Tests
\
Unit
;
use
Longman
\
TelegramBot
\
Entities
\
Entity
;
/**
* @link https://github.com/php-telegram-bot/core
* @author Baev Nikolay <gametester3d@gmail.com>
* @copyright Avtandil Kikabidze <akalongman@gmail.com>
* @license http://opensource.org/licenses/mit-license.php The MIT License (MIT)
* @package TelegramTest
*/
class
EntityTest
extends
TestCase
{
public
function
testEscapeMarkdown
(
)
{
// Make sure all characters that need escaping are escaped.
// Markdown V1
self
::
assertEquals
(
'\[\`\*\_'
,
Entity
::
escapeMarkdown
(
'[`*_'
)
)
;
self
::
assertEquals
(
'\*mark\*\_down\_~test~'
,
Entity
::
escapeMarkdown
(
'*mark*_down_~test~'
)
)
;
// Markdown V2
self
::
assertEquals
(
'\_\*\[\]\(\)\~\`\>\#\+\-\=\|\{\}\.\!'
,
Entity
::
escapeMarkdownV2
(
'_*[]()~`>#+-=|{}.!'
)
)
;
self
::
assertEquals
(
'\*mark\*\_down\_\~test\~'
,
Entity
::
escapeMarkdownV2
(
'*mark*_down_~test~'
)
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 14, 8:57 PM (21 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
134220
Default Alt Text
EntityTest.php (1 KB)
Attached To
Mode
R123 php-telegram-bot
Attached
Detach File
Event Timeline