Co-authored-by: Juan Pablo Vial <jpvialb@incoviba.cl>
Reviewed-on: #45
This commit is contained in:
2025-10-04 11:40:52 -03:00
parent 6ddc48ec60
commit 742de657c5
815 changed files with 62089 additions and 3287 deletions

View File

@ -0,0 +1,49 @@
<?php
namespace Tests\Unit\Model\Venta\MediosPago\Toku;
use Faker;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Incoviba\Model;
class SubscriptionTest extends TestCase
{
public static function dataProperties(): array
{
return [
['id'],
['venta'],
['toku_id'],
];
}
#[DataProvider('dataProperties')]
public function testProperties(string $propertyName): void
{
$subscription = new Model\Venta\MediosPago\Toku\Subscription();
$this->assertObjectHasProperty($propertyName, $subscription);
}
public function testJson(): void
{
$faker = Faker\Factory::create();
$venta = $this->getMockBuilder(Model\Venta::class)->disableOriginalConstructor()->getMock();
$venta->id = $faker->randomNumber();
$toku_id = $faker->ean13();
$id = $faker->randomNumber();
$subscription = new Model\Venta\MediosPago\Toku\Subscription();
$subscription->id = $id;
$subscription->venta = $venta;
$subscription->toku_id = $toku_id;
$expected = json_encode([
'id' => $id,
'venta_id' => $venta->id,
'toku_id' => $toku_id,
]);
$this->assertEquals($expected, json_encode($subscription));
}
}