Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
TelegramBot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
TelegramBot
Commits
9a66af0d
Unverified
Commit
9a66af0d
authored
Jul 06, 2016
by
Armando Lüscher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set test bot name to "testbot" and it's API key to "apikey".
parent
764633a9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
10 deletions
+10
-10
CommandTest.php
tests/Unit/Commands/CommandTest.php
+2
-2
CommandTestCase.php
tests/Unit/Commands/CommandTestCase.php
+1
-1
HelpCommandTest.php
tests/Unit/Commands/UserCommands/HelpCommandTest.php
+1
-1
ConversationTest.php
tests/Unit/ConversationTest.php
+1
-1
TelegramTest.php
tests/Unit/TelegramTest.php
+5
-5
No files found.
tests/Unit/Commands/CommandTest.php
View file @
9a66af0d
...
@@ -51,11 +51,11 @@ class CommandTest extends TestCase
...
@@ -51,11 +51,11 @@ class CommandTest extends TestCase
public
function
setUp
()
public
function
setUp
()
{
{
//Default command object
//Default command object
$this
->
telegram
=
new
Telegram
(
'apikey'
,
'
botname
'
);
$this
->
telegram
=
new
Telegram
(
'apikey'
,
'
testbot
'
);
$this
->
command_stub
=
$this
->
getMockForAbstractClass
(
$this
->
command_namespace
,
[
$this
->
telegram
]);
$this
->
command_stub
=
$this
->
getMockForAbstractClass
(
$this
->
command_namespace
,
[
$this
->
telegram
]);
//Create separate command object that contain a command config
//Create separate command object that contain a command config
$this
->
telegram_with_config
=
new
Telegram
(
'apikey'
,
'
botname
'
);
$this
->
telegram_with_config
=
new
Telegram
(
'apikey'
,
'
testbot
'
);
$this
->
telegram_with_config
->
setCommandConfig
(
'command_name'
,
[
'config_key'
=>
'config_value'
]);
$this
->
telegram_with_config
->
setCommandConfig
(
'command_name'
,
[
'config_key'
=>
'config_value'
]);
$this
->
command_stub_with_config
=
$this
->
getMockBuilder
(
$this
->
command_namespace
)
$this
->
command_stub_with_config
=
$this
->
getMockBuilder
(
$this
->
command_namespace
)
->
disableOriginalConstructor
()
->
disableOriginalConstructor
()
...
...
tests/Unit/Commands/CommandTestCase.php
View file @
9a66af0d
...
@@ -37,7 +37,7 @@ class CommandTestCase extends TestCase
...
@@ -37,7 +37,7 @@ class CommandTestCase extends TestCase
*/
*/
public
function
setUp
()
public
function
setUp
()
{
{
$this
->
telegram
=
new
Telegram
(
'apikey'
,
'
botname
'
);
$this
->
telegram
=
new
Telegram
(
'apikey'
,
'
testbot
'
);
$this
->
telegram
->
addCommandsPath
(
BASE_COMMANDS_PATH
.
'/UserCommands'
);
$this
->
telegram
->
addCommandsPath
(
BASE_COMMANDS_PATH
.
'/UserCommands'
);
$this
->
telegram
->
getCommandsList
();
$this
->
telegram
->
getCommandsList
();
}
}
...
...
tests/Unit/Commands/UserCommands/HelpCommandTest.php
View file @
9a66af0d
...
@@ -47,7 +47,7 @@ class HelpCommandTest extends CommandTestCase
...
@@ -47,7 +47,7 @@ class HelpCommandTest extends CommandTestCase
->
getResult
()
->
getResult
()
->
getText
();
->
getText
();
$this
->
assertContains
(
$this
->
assertContains
(
"botname v. "
.
$this
->
telegram
->
getVersion
()
.
"
\n\n
Commands List:"
,
'testbot v. '
.
$this
->
telegram
->
getVersion
()
.
"
\n\n
Commands List:"
,
$text
$text
);
);
}
}
...
...
tests/Unit/ConversationTest.php
View file @
9a66af0d
...
@@ -40,7 +40,7 @@ class ConversationTest extends TestCase
...
@@ -40,7 +40,7 @@ class ConversationTest extends TestCase
'password'
=>
PHPUNIT_DB_PASS
,
'password'
=>
PHPUNIT_DB_PASS
,
];
];
$this
->
telegram
=
new
Telegram
(
'
testapikey'
,
'testbotname
'
);
$this
->
telegram
=
new
Telegram
(
'
apikey'
,
'testbot
'
);
$this
->
telegram
->
enableMySql
(
$credentials
);
$this
->
telegram
->
enableMySql
(
$credentials
);
//Make sure we start with an empty DB for each test.
//Make sure we start with an empty DB for each test.
...
...
tests/Unit/TelegramTest.php
View file @
9a66af0d
...
@@ -40,7 +40,7 @@ class TelegramTest extends TestCase
...
@@ -40,7 +40,7 @@ class TelegramTest extends TestCase
*/
*/
protected
function
setUp
()
protected
function
setUp
()
{
{
$this
->
telegram
=
new
Telegram
(
'
testapikey'
,
'testbotname
'
);
$this
->
telegram
=
new
Telegram
(
'
apikey'
,
'testbot
'
);
// Create a few custom commands paths.
// Create a few custom commands paths.
foreach
(
$this
->
custom_commands_paths
as
$custom_path
)
{
foreach
(
$this
->
custom_commands_paths
as
$custom_path
)
{
...
@@ -64,7 +64,7 @@ class TelegramTest extends TestCase
...
@@ -64,7 +64,7 @@ class TelegramTest extends TestCase
*/
*/
public
function
testNewInstanceWithoutApiKeyParam
()
public
function
testNewInstanceWithoutApiKeyParam
()
{
{
new
Telegram
(
null
,
'testbot
name
'
);
new
Telegram
(
null
,
'testbot'
);
}
}
/**
/**
...
@@ -72,17 +72,17 @@ class TelegramTest extends TestCase
...
@@ -72,17 +72,17 @@ class TelegramTest extends TestCase
*/
*/
public
function
testNewInstanceWithoutBotNameParam
()
public
function
testNewInstanceWithoutBotNameParam
()
{
{
new
Telegram
(
'
test
apikey'
,
null
);
new
Telegram
(
'apikey'
,
null
);
}
}
public
function
testGetApiKey
()
public
function
testGetApiKey
()
{
{
$this
->
assertEquals
(
'
test
apikey'
,
$this
->
telegram
->
getApiKey
());
$this
->
assertEquals
(
'apikey'
,
$this
->
telegram
->
getApiKey
());
}
}
public
function
testGetBotName
()
public
function
testGetBotName
()
{
{
$this
->
assertEquals
(
'testbot
name
'
,
$this
->
telegram
->
getBotName
());
$this
->
assertEquals
(
'testbot'
,
$this
->
telegram
->
getBotName
());
}
}
public
function
testEnableAdmins
()
public
function
testEnableAdmins
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment