-
-
Notifications
You must be signed in to change notification settings - Fork 958
Expand file tree
/
Copy pathCommandTestCase.php
More file actions
56 lines (48 loc) · 1.45 KB
/
Copy pathCommandTestCase.php
File metadata and controls
56 lines (48 loc) · 1.45 KB
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
<?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\Commands;
use Longman\TelegramBot\Commands\Command;
use Longman\TelegramBot\Telegram;
use Longman\TelegramBot\Tests\Unit\TestCase;
/**
* @package TelegramTest
* @author Avtandil Kikabidze <akalongman@gmail.com>
* @copyright Avtandil Kikabidze <akalongman@gmail.com>
* @license http://opensource.org/licenses/mit-license.php The MIT License (MIT)
* @link https://github.com/php-telegram-bot/core
*/
class CommandTestCase extends TestCase
{
/**
* @var Telegram
*/
protected $telegram;
/**
* @var Command
*/
protected $command;
/**
* setUp
*/
public function setUp(): void
{
$this->telegram = new Telegram(self::$dummy_api_key, 'testbot');
// Add custom commands dedicated to do some tests.
$this->telegram->addCommandsPath(__DIR__ . '/CustomTestCommands');
$this->telegram->getCommandsList();
}
/**
* Make sure the version number is in the format x.x.x, x.x or x
*/
public function testVersionNumberFormat(): void
{
self::assertRegExp('/^(\d+\\.)?(\d+\\.)?(\d+)$/', $this->command->getVersion());
}
}