mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-27 02:34:39 +01:00
More unit tests
This commit is contained in:
parent
fd03bdec63
commit
1873d97dda
@ -35,6 +35,8 @@ class EntitiesTest extends MadelineTestCase
|
||||
}
|
||||
public function provideEntities(): array
|
||||
{
|
||||
$this->setUpBeforeClass();
|
||||
$mention = self::$MadelineProto->getPwrChat(getenv('TEST_USERNAME'));
|
||||
return [
|
||||
[
|
||||
'html',
|
||||
@ -161,6 +163,25 @@ class EntitiesTest extends MadelineTestCase
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'html',
|
||||
'<a href="mention:'.getenv('TEST_USERNAME').'">mention1</a> <a href="tg://user?id='.getenv('TEST_USERNAME').'">mention2</a>',
|
||||
'mention1 mention2',
|
||||
[
|
||||
[
|
||||
'offset' => 0,
|
||||
'length' => 8,
|
||||
'type' => 'text_mention',
|
||||
'user' => $mention
|
||||
],
|
||||
[
|
||||
'offset' => 9,
|
||||
'length' => 8,
|
||||
'type' => 'text_mention',
|
||||
'user' => $mention
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'markdown',
|
||||
'test *italic* **bold** <u>underlined</u> ~~strikethrough~~ <pre language="test">pre</pre> <code>code</code> <spoiler>spoiler</spoiler>',
|
||||
|
@ -22,6 +22,9 @@ abstract class MadelineTestCase extends TestCase
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
if (self::$MadelineProto !== null) {
|
||||
return;
|
||||
}
|
||||
self::$MadelineProto = new API(
|
||||
'testing.madeline',
|
||||
[
|
||||
|
Loading…
Reference in New Issue
Block a user