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
166b883c
Unverified
Commit
166b883c
authored
Apr 21, 2018
by
Avtandil Kikabidze
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more tests
parent
1fe2c5db
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
14 deletions
+18
-14
Response.php
src/Http/Response.php
+0
-14
TelegramTest.php
tests/unit/TelegramTest.php
+18
-0
No files found.
src/Http/Response.php
View file @
166b883c
...
@@ -227,18 +227,4 @@ class Response
...
@@ -227,18 +227,4 @@ class Response
return
$results
;
return
$results
;
}
}
/**
* Return an empty Server Response
*
* No request to telegram are sent, this function is used in commands that
* don't need to fire a message after execution
*
* @return \Longman\TelegramBot\Http\Response
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public
static
function
createEmpty
()
{
return
new
static
([
'ok'
=>
true
,
'result'
=>
true
]);
}
}
}
tests/unit/TelegramTest.php
View file @
166b883c
...
@@ -152,6 +152,24 @@ class TelegramTest extends TestCase
...
@@ -152,6 +152,24 @@ class TelegramTest extends TestCase
$this
->
assertInstanceOf
(
\Illuminate\Container\Container
::
class
,
$telegram
->
getContainer
());
$this
->
assertInstanceOf
(
\Illuminate\Container\Container
::
class
,
$telegram
->
getContainer
());
}
}
public
function
testHandleResponse
()
{
$telegram
=
new
Telegram
(
self
::
$dummy_api_key
,
'testbot'
);
$response
=
$telegram
->
handle
();
$this
->
assertInstanceOf
(
\Longman\TelegramBot\Http\Response
::
class
,
$response
);
}
public
function
testHandleUpdatedResponse
()
{
$telegram
=
new
Telegram
(
self
::
$dummy_api_key
,
'testbot'
);
$response
=
$telegram
->
handleGetUpdates
();
$this
->
assertInstanceOf
(
\Longman\TelegramBot\Http\Response
::
class
,
$response
);
}
public
function
testCustom
()
public
function
testCustom
()
{
{
$telegram
=
new
Telegram
(
self
::
$dummy_api_key
,
'testbot'
);
$telegram
=
new
Telegram
(
self
::
$dummy_api_key
,
'testbot'
);
...
...
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