<?php
$_SERVER['SERVER_NAME']="unittest";
$_SERVER['REQUEST_URI']="testuri.com";
$_SERVER['HTTP_HOST']="testuri.com";
use PHPUnit\Framework\TestCase;
require_once __DIR__."./../../src/bots/loader.php";
require "ocr.data.php";
final class OcrTest extends TestCase
{
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();
$member["status"]="member";
// $bot->method("apiRequest")->willReturn($member);
$this->translate_bot->bot = $bot;
$this->translate_bot->getDB()->removeAllUserActivites();
}
function getTG(): TranslateGerman{
return $this->translate_bot;
}
/**
* @group failing
* @group bug
*/
public function testOcr(): void
{
$debugUserID = 44903244;
global $update_ocr_data;
// $this->translate_bot->process($update_ocr_data);
$this->assertSame("mustbedone", "mustbedone");
}
function tearDown(): void
{
try {
// $this->getTG()->getDB()->disconnect();
}
catch(Exception $ex){
}
}
}