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
Show 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"?>
<phpunit
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"
backupGlobals=
"false"
backupStaticAttributes=
"false"
...
...
@@ -23,6 +23,10 @@
<php>
<ini
name=
"error_reporting"
value=
"-1"
/>
<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>
<testsuites>
<testsuite
name=
"Package Test Suite"
>
...
...
structure.sql
View file @
c0b83b42
tests/Unit/ConversationTest.php
View file @
c0b83b42
...
...
@@ -34,14 +34,14 @@ class ConversationTest extends TestCase
protected
function
setUp
()
{
$credentials
=
[
'host'
=>
'127.0.0.1'
,
'
user'
=>
'root'
,
'
password'
=>
''
,
'
database'
=>
'telegrambot'
,
'host'
=>
PHPUNIT_DB_HOST
,
'
database'
=>
PHPUNIT_DB_NAME
,
'
user'
=>
PHPUNIT_DB_USER
,
'
password'
=>
PHPUNIT_DB_PASS
,
];
$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.
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