Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vítězslav Dvořák
committed
Sep 14, 2023
1 parent
bbe8657
commit 483cf3b
Showing
16 changed files
with
119 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<?php | ||
|
||
namespace Test\AbraFlexi; | ||
|
||
use AbraFlexi\Banka; | ||
|
||
/** | ||
* Generated by PHPUnit_SkeletonGenerator on 2016-06-10 at 12:31:59. | ||
*/ | ||
class BankaTest extends RWTest { | ||
|
||
/** | ||
* @var Banka | ||
*/ | ||
protected $object; | ||
|
||
/** | ||
* Prepare testing payment | ||
* | ||
* @param array $initialData | ||
* | ||
* @return \AbraFlexi\Banka | ||
*/ | ||
public static function makeTestPayment($initialData = [], $dayBack = 1) { | ||
$yesterday = new \DateTime(); | ||
$yesterday->modify('-' . $dayBack . ' day'); | ||
|
||
$testCode = 'PAY_' . \Ease\Functions::randomString(); | ||
|
||
$payment = new \AbraFlexi\Banka($initialData); | ||
|
||
$payment->takeData(array_merge([ | ||
'kod' => $testCode, | ||
'banka' => 'code:HLAVNI', | ||
'typPohybuK' => 'typPohybu.prijem', | ||
'popis' => 'AbraFlexi Test bank record', | ||
'varSym' => \Ease\Functions::randomNumber(1111, 9999), | ||
'specSym' => \Ease\Functions::randomNumber(111, 999), | ||
'bezPolozek' => true, | ||
'datVyst' => \AbraFlexi\RO::dateToFlexiDate($yesterday), | ||
'typDokl' => \AbraFlexi\RO::code('STANDARD') | ||
], $initialData)); | ||
if ($payment->sync()) { | ||
$payment->addStatusMessage($payment->getApiURL() . ' ' . \AbraFlexi\RO::uncode($payment->getDataValue('typPohybuK')) . ' ' . \AbraFlexi\RO::uncode($payment->getRecordIdent()) . ' ' . \AbraFlexi\RO::uncode($payment->getDataValue('sumCelkem')) . ' ' . \AbraFlexi\RO::uncode($payment->getDataValue('mena')), | ||
'success'); | ||
} else { | ||
$payment->addStatusMessage(json_encode($payment->getData()), 'debug'); | ||
} | ||
return $payment; | ||
} | ||
|
||
/** | ||
* Sets up the fixture, for example, opens a network connection. | ||
* This method is called before a test is executed. | ||
*/ | ||
protected function setUp(): void { | ||
$this->object = new Banka(); | ||
} | ||
|
||
/** | ||
* Tears down the fixture, for example, closes a network connection. | ||
* This method is called after a test is executed. | ||
*/ | ||
protected function tearDown(): void { | ||
|
||
} | ||
|
||
/** | ||
* Gives You data able to insert into current evidence | ||
* | ||
* @param string $code custom record code | ||
* | ||
* @return array | ||
*/ | ||
public function getDataForInsert($code = 'UnitTest') { | ||
$dataForInsert = parent::getDataForInsert($code); | ||
$loader = new \AbraFlexi\RO(null, | ||
['evidence' => 'bankovni-ucet']); | ||
$bankCodeRaw = $loader->getColumnsFromAbraFlexi([ | ||
'kod'], ['limit' => 1]); | ||
$dataForInsert['banka'] = \AbraFlexi\RO::code($bankCodeRaw[0]['kod']); | ||
$dataForInsert['typPohybuK'] = 'typPohybu.prijem'; | ||
return $dataForInsert; | ||
} | ||
|
||
/** | ||
* @covers AbraFlexi\Banka::stahnoutVypisyOnline | ||
*/ | ||
public function testStahnoutVypisyOnline() { | ||
$this->assertInternalType('boolean', | ||
$this->object->stahnoutVypisyOnline()); | ||
} | ||
|
||
/** | ||
* @covers AbraFlexi\Banka::automatickeParovani | ||
*/ | ||
public function testAutomatickeParovani() { | ||
$this->assertInternalType('boolean', | ||
$this->object->automatickeParovani()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters