CommandTestCase.php 1.39 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
<?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.
 */

11
namespace Longman\TelegramBot\Tests\Unit\Commands;
12

13
use Longman\TelegramBot\Tests\Unit\TestCase;
14 15 16 17 18 19 20 21 22 23 24
use Longman\TelegramBot\Telegram;

/**
 * @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            http://www.github.com/akalongman/php-telegram-bot
 */
class CommandTestCase extends TestCase
{
25 26 27
    /**
     * @var \Longman\TelegramBot\Telegram
     */
28
    protected $telegram;
29 30 31 32

    /**
     * @var \Longman\TelegramBot\Commands\Command
     */
33 34
    protected $command;

35 36 37
    /**
     * setUp
     */
38 39
    public function setUp()
    {
40
        $this->telegram = new Telegram('apikey', 'testbot');
41 42 43 44 45 46 47 48 49 50 51 52
        $this->telegram->addCommandsPath(BASE_COMMANDS_PATH . '/UserCommands');
        $this->telegram->getCommandsList();
    }

    /**
     * Make sure the version number is in the format x.x.x, x.x or x
     */
    public function testVersionNumberFormat()
    {
        $this->assertRegExp('/^(\d+\\.)?(\d+\\.)?(\d+)$/', $this->command->getVersion());
    }
}