From 26b686295545abbdf2c8a5802bd9e0d6736282f9 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Thu, 8 May 2025 17:17:24 -0400 Subject: [PATCH] FIX: prueba Servicio Customer --- .../Service/MediosPago/Toku/CustomerTest.php | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/app/tests/unit/src/Service/MediosPago/Toku/CustomerTest.php b/app/tests/unit/src/Service/MediosPago/Toku/CustomerTest.php index 8b31ff8..b369da6 100644 --- a/app/tests/unit/src/Service/MediosPago/Toku/CustomerTest.php +++ b/app/tests/unit/src/Service/MediosPago/Toku/CustomerTest.php @@ -44,15 +44,24 @@ class CustomerTest extends TestCase $persona->apellidoPaterno = $faker->lastName(); $persona->apellidoMaterno = $faker->lastName(); $persona->method('datos')->willReturn($datos); + $persona->method('nombreCompleto')->willReturn(implode(' ', [ + $persona->nombres, + $persona->apellidoPaterno, + $persona->apellidoMaterno + ])); $this->customer = $this->getMockBuilder(Model\MediosPago\Toku\Customer::class) ->disableOriginalConstructor()->getMock(); $this->customer->id = $faker->randomNumber(); $this->customer->persona = $persona; $this->customer->toku_id = $faker->ean13(); + $this->customer->method('rut')->willReturn(implode('', [ + $persona->rut, + strtoupper($persona->digito) + ])); $this->customer->method('jsonSerialize')->willReturn([ 'id' => $this->customer->id, - 'rut' => implode('', [$persona->rut, $persona->digito]), + 'rut' => $this->customer->rut(), 'toku_id' => $this->customer->toku_id ]); @@ -63,10 +72,10 @@ class CustomerTest extends TestCase $this->getData = [ 'id' => $this->customer->id, - 'external_id' => implode('', [$persona->rut, $persona->digito]), - 'government_id' => implode('', [$persona->rut, $persona->digito]), + 'external_id' => $this->customer->rut(), + 'government_id' => $this->customer->rut(), 'email' => $persona->datos()->email, - 'name' => implode(' ', [$persona->nombres, $persona->apellidoPaterno, $persona->apellidoMaterno]), + 'name' => $persona->nombreCompleto(), 'phone_number' => $persona->datos()->telefono, 'silenced_until' => null, 'default_agent' => null, @@ -92,10 +101,10 @@ class CustomerTest extends TestCase $this->postData = [ 'id' => $this->customer->id, - 'external_id' => implode('', [$persona->rut, $persona->digito]), - 'government_id' => implode('', [$persona->rut, $persona->digito]), + 'external_id' => $this->customer->rut(), + 'government_id' => $this->customer->rut(), 'email' => $persona->datos()->email, - 'name' => implode(' ', [$persona->nombres, $persona->apellidoPaterno, $persona->apellidoMaterno]), + 'name' => $persona->nombreCompleto(), 'phone_number' => $persona->datos()->telefono, 'silenced_until' => null, 'default_agent' => null,