Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F633672
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/tests/Unit/Entities/EntityTest.php b/tests/Unit/Entities/EntityTest.php
index 6de479b..47299c8 100644
--- a/tests/Unit/Entities/EntityTest.php
+++ b/tests/Unit/Entities/EntityTest.php
@@ -1,50 +1,54 @@
<?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\Entities;
use Longman\TelegramBot\Entities\Entity;
use Longman\TelegramBot\Tests\Unit\TestCase;
/**
* @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(): void
{
// 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~'));
}
- public function testSettingDynamicParameterWorks(): void {
- $anonClass = new class([]) extends Entity {};
- $anonClass->newParameter = 'test';
+ public function testSettingDynamicParameterWorks(): void
+ {
+ $entity = new class ( [] ) extends Entity { }; // phpcs:ignore
+
+ $entity->newParameter = 'test';
- $this->assertEquals('test', $anonClass->newParameter);
+ $this->assertEquals('test', $entity->newParameter);
}
- public function testGettingUnknownDynamicParameterReturnsNull(): void {
- $anonClass = new class([]) extends Entity {};
- $this->assertEquals(null, $anonClass->unknownParameter);
+ public function testGettingUnknownDynamicParameterReturnsNull(): void
+ {
+ $entity = new class ( [] ) extends Entity { }; // phpcs:ignore
+
+ $this->assertNull($entity->unknownParameter);
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Nov 15, 5:56 PM (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
150681
Default Alt Text
(2 KB)
Attached To
Mode
R123 php-telegram-bot
Attached
Detach File
Event Timeline