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
c0b83b42
Unverified
Commit
c0b83b42
authored
Jul 05, 2016
by
Armando Lüscher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test database credentials to phpunit config to allow local overriding.
parent
98f13b08
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
+11
-7
phpunit.xml.dist
phpunit.xml.dist
+5
-1
structure.sql
structure.sql
+1
-1
ConversationTest.php
tests/Unit/ConversationTest.php
+5
-5
No files found.
phpunit.xml.dist
View file @
c0b83b42
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
<phpunit
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"http://schema.phpunit.de/4.
6
/phpunit.xsd"
xsi:noNamespaceSchemaLocation=
"http://schema.phpunit.de/4.
8
/phpunit.xsd"
bootstrap=
"./tests/Bootstrap.php"
bootstrap=
"./tests/Bootstrap.php"
backupGlobals=
"false"
backupGlobals=
"false"
backupStaticAttributes=
"false"
backupStaticAttributes=
"false"
...
@@ -23,6 +23,10 @@
...
@@ -23,6 +23,10 @@
<php>
<php>
<ini
name=
"error_reporting"
value=
"-1"
/>
<ini
name=
"error_reporting"
value=
"-1"
/>
<const
name=
"PHPUNIT_TESTSUITE"
value=
"true"
/>
<const
name=
"PHPUNIT_TESTSUITE"
value=
"true"
/>
<const
name=
"PHPUNIT_DB_HOST"
value=
"127.0.0.1"
/>
<const
name=
"PHPUNIT_DB_NAME"
value=
"telegrambot"
/>
<const
name=
"PHPUNIT_DB_USER"
value=
"root"
/>
<const
name=
"PHPUNIT_DB_PASS"
value=
""
/>
</php>
</php>
<testsuites>
<testsuites>
<testsuite
name=
"Package Test Suite"
>
<testsuite
name=
"Package Test Suite"
>
...
...
structure.sql
View file @
c0b83b42
...
@@ -22,7 +22,7 @@ CREATE TABLE IF NOT EXISTS `chat` (
...
@@ -22,7 +22,7 @@ CREATE TABLE IF NOT EXISTS `chat` (
KEY
`old_id`
(
`old_id`
)
KEY
`old_id`
(
`old_id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_unicode_520_ci
;
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_unicode_520_ci
;
CREATE
TABLE
IF
NOT
EXISTS
`user_chat`
(
CREATE
TABLE
IF
NOT
EXISTS
`user_chat`
(
`user_id`
bigint
COMMENT
'Unique user identifier'
,
`user_id`
bigint
COMMENT
'Unique user identifier'
,
`chat_id`
bigint
COMMENT
'Unique user or chat identifier'
,
`chat_id`
bigint
COMMENT
'Unique user or chat identifier'
,
...
...
tests/Unit/ConversationTest.php
View file @
c0b83b42
...
@@ -34,14 +34,14 @@ class ConversationTest extends TestCase
...
@@ -34,14 +34,14 @@ class ConversationTest extends TestCase
protected
function
setUp
()
protected
function
setUp
()
{
{
$credentials
=
[
$credentials
=
[
'host'
=>
'127.0.0.1'
,
'host'
=>
PHPUNIT_DB_HOST
,
'
user'
=>
'root'
,
'
database'
=>
PHPUNIT_DB_NAME
,
'
password'
=>
''
,
'
user'
=>
PHPUNIT_DB_USER
,
'
database'
=>
'telegrambot'
,
'
password'
=>
PHPUNIT_DB_PASS
,
];
];
$this
->
telegram
=
new
Telegram
(
'testapikey'
,
'testbotname'
);
$this
->
telegram
=
new
Telegram
(
'testapikey'
,
'testbotname'
);
$this
->
telegram
->
enableMyS
QL
(
$credentials
);
$this
->
telegram
->
enableMyS
ql
(
$credentials
);
//Make sure we start with an empty DB for each test.
//Make sure we start with an empty DB for each test.
TestHelpers
::
emptyDB
(
$credentials
);
TestHelpers
::
emptyDB
(
$credentials
);
...
...
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