1
0
mirror of synced 2025-01-18 11:21:41 +03:00

Default .env.dist values for tests

This commit is contained in:
Pavel 2019-06-19 12:03:37 +03:00
parent d43846d1e3
commit dc8bb8c0ed
3 changed files with 56 additions and 1 deletions

View File

@ -1,3 +1,3 @@
MG_BOT_URL=""
MG_BOT_URL="https://mg-test.retailcrm.pro/"
MG_BOT_KEY=""
MG_BOT_DBG=""

View File

@ -10,6 +10,10 @@ deps:
test:
@echo "==> Running tests"
@cd $(ROOT_DIR)
ifeq ($(wildcard .env), )
@echo "==> Creating .env file for testing purposes..."
@cp .env.dist .env
endif
@php -d memory_limit=-1 $(BIN_DIR)/phpunit -c phpunit.xml.dist --log-junit $(ROOT_DIR)/test-report.xml
@echo "==> Testing complete"

51
test-report.xml Normal file
View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="RetailCrm" tests="14" assertions="18" errors="2" failures="1" skipped="1" time="0.916477">
<testsuite name="RetailCrm\Mg\Bot\Tests\ClientListTest" file="/home/pavel/mg-bots/mg-bot-api-client-php/tests/Bot/Tests/ClientListTest.php" tests="9" assertions="16" errors="0" failures="0" skipped="0" time="0.205605">
<testcase name="testChannels" class="RetailCrm\Mg\Bot\Tests\ClientListTest" classname="RetailCrm.Mg.Bot.Tests.ClientListTest" file="/home/pavel/mg-bots/mg-bot-api-client-php/tests/Bot/Tests/ClientListTest.php" line="45" assertions="2" time="0.038679"/>
<testcase name="testChats" class="RetailCrm\Mg\Bot\Tests\ClientListTest" classname="RetailCrm.Mg.Bot.Tests.ClientListTest" file="/home/pavel/mg-bots/mg-bot-api-client-php/tests/Bot/Tests/ClientListTest.php" line="68" assertions="2" time="0.021166"/>
<testcase name="testMembers" class="RetailCrm\Mg\Bot\Tests\ClientListTest" classname="RetailCrm.Mg.Bot.Tests.ClientListTest" file="/home/pavel/mg-bots/mg-bot-api-client-php/tests/Bot/Tests/ClientListTest.php" line="90" assertions="2" time="0.020040"/>
<testcase name="testMessages" class="RetailCrm\Mg\Bot\Tests\ClientListTest" classname="RetailCrm.Mg.Bot.Tests.ClientListTest" file="/home/pavel/mg-bots/mg-bot-api-client-php/tests/Bot/Tests/ClientListTest.php" line="110" assertions="2" time="0.024282"/>
<testcase name="testCommands" class="RetailCrm\Mg\Bot\Tests\ClientListTest" classname="RetailCrm.Mg.Bot.Tests.ClientListTest" file="/home/pavel/mg-bots/mg-bot-api-client-php/tests/Bot/Tests/ClientListTest.php" line="133" assertions="1" time="0.019772"/>
<testcase name="testBots" class="RetailCrm\Mg\Bot\Tests\ClientListTest" classname="RetailCrm.Mg.Bot.Tests.ClientListTest" file="/home/pavel/mg-bots/mg-bot-api-client-php/tests/Bot/Tests/ClientListTest.php" line="152" assertions="1" time="0.020315"/>
<testcase name="testUsers" class="RetailCrm\Mg\Bot\Tests\ClientListTest" classname="RetailCrm.Mg.Bot.Tests.ClientListTest" file="/home/pavel/mg-bots/mg-bot-api-client-php/tests/Bot/Tests/ClientListTest.php" line="174" assertions="2" time="0.020474"/>
<testcase name="testDialogs" class="RetailCrm\Mg\Bot\Tests\ClientListTest" classname="RetailCrm.Mg.Bot.Tests.ClientListTest" file="/home/pavel/mg-bots/mg-bot-api-client-php/tests/Bot/Tests/ClientListTest.php" line="197" assertions="2" time="0.021292"/>
<testcase name="testCustomers" class="RetailCrm\Mg\Bot\Tests\ClientListTest" classname="RetailCrm.Mg.Bot.Tests.ClientListTest" file="/home/pavel/mg-bots/mg-bot-api-client-php/tests/Bot/Tests/ClientListTest.php" line="220" assertions="2" time="0.019585"/>
</testsuite>
<testsuite name="RetailCrm\Mg\Bot\Tests\CommandsTest" file="/home/pavel/mg-bots/mg-bot-api-client-php/tests/Bot/Tests/CommandsTest.php" tests="4" assertions="2" errors="1" failures="1" skipped="1" time="0.538687">
<testcase name="testCommandEditException" class="RetailCrm\Mg\Bot\Tests\CommandsTest" classname="RetailCrm.Mg.Bot.Tests.CommandsTest" file="/home/pavel/mg-bots/mg-bot-api-client-php/tests/Bot/Tests/CommandsTest.php" line="37" assertions="1" time="0.182476">
<failure type="PHPUnit\Framework\ExpectationFailedException">RetailCrm\Mg\Bot\Tests\CommandsTest::testCommandEditException
Failed asserting that exception of type "Exception" matches expected exception "InvalidArgumentException". Message was: "Method not found " at
/home/pavel/mg-bots/mg-bot-api-client-php/src/Bot/HttpClient.php:169
/home/pavel/mg-bots/mg-bot-api-client-php/src/Bot/Client.php:88
/home/pavel/mg-bots/mg-bot-api-client-php/src/Bot/Client.php:254
/home/pavel/mg-bots/mg-bot-api-client-php/tests/Bot/Tests/CommandsTest.php:46
.
</failure>
</testcase>
<testcase name="testCommandDeleteException" class="RetailCrm\Mg\Bot\Tests\CommandsTest" classname="RetailCrm.Mg.Bot.Tests.CommandsTest" file="/home/pavel/mg-bots/mg-bot-api-client-php/tests/Bot/Tests/CommandsTest.php" line="53" assertions="1" time="0.155145"/>
<testcase name="testCommandEdit" class="RetailCrm\Mg\Bot\Tests\CommandsTest" classname="RetailCrm.Mg.Bot.Tests.CommandsTest" file="/home/pavel/mg-bots/mg-bot-api-client-php/tests/Bot/Tests/CommandsTest.php" line="68" assertions="0" time="0.201066">
<error type="LazyJsonMapper\Exception\LazyJsonMapperException">RetailCrm\Mg\Bot\Tests\CommandsTest::testCommandEdit
LazyJsonMapper\Exception\LazyJsonMapperException: Unknown function "isSuccessful".
/home/pavel/mg-bots/mg-bot-api-client-php/vendor/lazyjsonmapper/lazyjsonmapper/src/LazyJsonMapper.php:2156
/home/pavel/mg-bots/mg-bot-api-client-php/tests/Bot/Tests/CommandsTest.php:79
</error>
</testcase>
<testcase name="testCommandDelete" class="RetailCrm\Mg\Bot\Tests\CommandsTest" classname="RetailCrm.Mg.Bot.Tests.CommandsTest" file="/home/pavel/mg-bots/mg-bot-api-client-php/tests/Bot/Tests/CommandsTest.php" line="87" assertions="0" time="0.000000">
<skipped/>
</testcase>
</testsuite>
<testsuite name="RetailCrm\Mg\Bot\Tests\MessagesTest" file="/home/pavel/mg-bots/mg-bot-api-client-php/tests/Bot/Tests/MessagesTest.php" tests="1" assertions="0" errors="1" failures="0" skipped="0" time="0.172185">
<testcase name="testMessageSend" class="RetailCrm\Mg\Bot\Tests\MessagesTest" classname="RetailCrm.Mg.Bot.Tests.MessagesTest" file="/home/pavel/mg-bots/mg-bot-api-client-php/tests/Bot/Tests/MessagesTest.php" line="36" assertions="0" time="0.172185">
<error type="LazyJsonMapper\Exception\LazyJsonMapperException">RetailCrm\Mg\Bot\Tests\MessagesTest::testMessageSend
LazyJsonMapper\Exception\LazyJsonMapperException: Unknown function "getStatusCode".
/home/pavel/mg-bots/mg-bot-api-client-php/vendor/lazyjsonmapper/lazyjsonmapper/src/LazyJsonMapper.php:2156
/home/pavel/mg-bots/mg-bot-api-client-php/tests/Bot/Tests/MessagesTest.php:47
</error>
</testcase>
</testsuite>
</testsuite>
</testsuites>