404

[ Avaa Bypassed ]




Upload:

Command:

botdev@18.118.160.203: ~ $
<?php


use PHPUnit\Framework\TestCase;
// exclude "./../src/"

final class DictionaryDatabaseHandlerTest extends TestCase
{
    private DictionaryDatabaseHandler $dictionaryDatabaseHandler;
    private $translate_bot;
    function setUp(): void
    {
        $BOT_USER= '@TranslateGerman_bot';
        $BOT_TOKEN=  '816983194:AAH1pPCba__pNRFK7h6fFMoy-9twUuxJ-n8';
        $uriParts = explode("?",$_SERVER['REQUEST_URI']);
        $actual_link = "https://$_SERVER[HTTP_HOST]".$uriParts[0];
        $WEBHOOK_URL= "$actual_link";
        $SIGN ="پوشش خبری شهر های آلمان ".PHP_EOL."@TranslateGerman_bot";
        $this->translate_bot = new TranslateGerman($BOT_USER,$BOT_TOKEN,$WEBHOOK_URL, $SIGN);
        $bot = $this->getMockBuilder('Bot')
        ->setConstructorArgs(array($BOT_USER,$BOT_TOKEN,$WEBHOOK_URL, $SIGN))
        ->getMock();
        $this->dictionaryDatabaseHandler = new DictionaryDatabaseHandler($this->translate_bot);

    }
    function getTG(): TranslateGerman
    {
        return $this->translate_bot;
    }
    function reset()
    {
        $this->getTG()->params = null;
        $this->getTG()->method = null;
    }
    /**
     * @group failing
     */

   function testInsertUserAcitivity(){
    $this->dictionaryDatabaseHandler->removeAllUserActivites();
    $this->dictionaryDatabaseHandler->insertUserActivity("1234567","nothing","10");
    $this->dictionaryDatabaseHandler->insertUserActivity("1234567","nothing","10");
    $expectedActivties = $this->dictionaryDatabaseHandler->getNumberOfActivityWithIntentId("1234567","10");
    $this->assertSame($expectedActivties,2);
   }
}

Filemanager

Name Type Size Permission Actions
DictionaryDatabaseHandlerTest.php File 1.63 KB 0755