siip-stripe-payment_intents/vendor/ubnt/ucrm-plugin-sdk/tests/UcrmPluginSdk/Service/PluginConfigManagerTest.php
DANYDHSV c43bb924d7 feat: lanzamiento inicial del plugin Generador de Payment Intents
- Implementado servicio backend [PaymentIntentService](cci:2://file:///home/unms/data/ucrm/ucrm/data/plugins/siip-stripe-payment_intents/src/PaymentIntentService.php:8:0-152:1) para manejar interacciones con API de UCRM y Stripe.
- Creado frontend moderno y responsivo en HTML/JS dentro de [public.php](cci:7://file:///home/unms/data/ucrm/ucrm/data/plugins/siip-stripe-payment_intents/public.php:0:0-0:0).
- Agregada búsqueda con autocompletado para clientes.
- Agregada validación para Stripe Customer ID y monto mínimo.
- Integrada la creación de Payment Intents de Stripe para fondos tipo `customer_balance`.
- Agregada documentación (README.md, CHANGELOG.md) y limpieza de archivos legado.
2025-12-16 13:56:31 -06:00

49 lines
1.3 KiB
PHP

<?php
/*
* This file is part of UCRM Plugin SDK.
*
* Copyright (c) 2019 Ubiquiti Inc.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Ubnt\UcrmPluginSdk\Service;
use Ubnt\UcrmPluginSdk\Exception\InvalidPluginRootPathException;
class PluginConfigManagerTest extends \PHPUnit\Framework\TestCase
{
public function testLoadConfig(): void
{
$expectedOptions = [
'token' => 'dummyTokenForTests',
'startDate' => '1.1.2018',
'paymentMatchAttribute' => 'invoiceNumber',
'importUnattached' => '1',
'lastProcessedPayment' => null,
'lastProcessedTimestamp' => null,
];
$pluginOptionsManager = PluginConfigManager::create(__DIR__ . '/../../files_enabled');
$config = $pluginOptionsManager->loadConfig();
self::assertSame($expectedOptions, $config);
}
public function testFileNotFound(): void
{
$exception = null;
try {
$pluginOptionsManager = PluginConfigManager::create(__DIR__);
$pluginOptionsManager->loadConfig();
} catch (InvalidPluginRootPathException $exception) {
}
self::assertInstanceOf(InvalidPluginRootPathException::class, $exception);
}
}