- Se agregó 'getPaymentMethodIdByName' para buscar automáticamente el ID de "Transferencia bancaria" por nombre, asegurando portabilidad entre servidores UISP. - Se implementó el manejo del webhook 'customer_cash_balance_transaction.created' para el registro automático de pagos fondeados. - Fix: Se corrigió error 422 en la API de UCRM forzando el cast de 'clientId' a integer y 'methodId' a string (GUID). - Se actualizó la documentación (README/CHANGELOG) con instrucciones de configuración de webhooks.
47 lines
1.2 KiB
PHP
Executable File
47 lines
1.2 KiB
PHP
Executable File
<?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;
|
|
|
|
class PluginLogManagerTest extends \PHPUnit\Framework\TestCase
|
|
{
|
|
public static function setUpBeforeClass(): void
|
|
{
|
|
parent::setUpBeforeClass();
|
|
|
|
@unlink(__DIR__ . '/../../files_enabled/data/plugin.log');
|
|
}
|
|
|
|
public function testLogOperations(): void
|
|
{
|
|
$pluginLogManager = PluginLogManager::create(__DIR__ . '/../../files_enabled');
|
|
self::assertSame('', $pluginLogManager->getLog());
|
|
|
|
$pluginLogManager->appendLog('This is first test message.');
|
|
$pluginLogManager->appendLog('This is second test message.');
|
|
|
|
self::assertSame(
|
|
implode(
|
|
'',
|
|
[
|
|
'This is first test message.' . PHP_EOL,
|
|
'This is second test message.' . PHP_EOL,
|
|
]
|
|
),
|
|
$pluginLogManager->getLog()
|
|
);
|
|
|
|
$pluginLogManager->clearLog();
|
|
self::assertSame('', $pluginLogManager->getLog());
|
|
}
|
|
}
|