Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F630547
TelegramTest.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
TelegramTest.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
Tests
\
Unit
;
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
TelegramTest
extends
TestCase
{
/**
* @var \Longman\TelegramBot\Telegram
*/
private
$telegram
;
/**
* setUp
*/
protected
function
setUp
(
)
{
$this
->
telegram
=
new
Telegram
(
'testapikey'
,
'testbotname'
)
;
}
/**
* @test
* @expectedException \Longman\TelegramBot\Exception\TelegramException
*/
public
function
newInstanceWithoutParams
(
)
{
$telegram
=
new
Telegram
(
'testapikey'
,
null
)
;
$telegram
=
new
Telegram
(
null
,
'test'
)
;
}
/**
* @test
*/
public
function
getCommandsList
(
)
{
$commands
=
$this
->
telegram
->
getCommandsList
(
)
;
$this
->
assertInternalType
(
'array'
,
$commands
)
;
$this
->
assertNotCount
(
0
,
$commands
)
;
}
/**
* @test
*/
public
function
getCommandsClass
(
)
{
$command
=
$this
->
telegram
->
getCommandClass
(
'help'
)
;
$this
->
assertInstanceOf
(
'Longman\TelegramBot\Commands\HelpCommand'
,
$command
)
;
}
/**
* @test
*/
public
function
getApiKey
(
)
{
$this
->
assertEquals
(
'testapikey'
,
$this
->
telegram
->
getApiKey
(
)
)
;
}
/**
* @test
*/
public
function
getBotName
(
)
{
$this
->
assertEquals
(
'testbotname'
,
$this
->
telegram
->
getBotName
(
)
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 15, 9:45 AM (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
144004
Default Alt Text
TelegramTest.php (1 KB)
Attached To
Mode
R123 php-telegram-bot
Attached
Detach File
Event Timeline