Skip to content

Commit

Permalink
test: add test for APAP parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusantguerrero committed Jan 2, 2025
1 parent fcea850 commit 25abef0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 73 deletions.
73 changes: 0 additions & 73 deletions tests/Feature/CreditCard/CreditCardTest.php

This file was deleted.

23 changes: 23 additions & 0 deletions tests/Unit/ApapParsingTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Tests\Unit;

use Illuminate\Support\Str;
use PHPUnit\Framework\TestCase;

class ApapParsingTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testShouldParseProductName()
{
$productLine = "Tu tarjeta de Crédito titular-Visa GoldAPAP terminada en 7106 presenta una transacción, con el siguiente detalle:";
$visaPos = strpos($productLine, 'Visa');

$product = Str::substr($productLine, $visaPos - 1, strpos($productLine, 'terminada') - $visaPos - 1);
$this->assertEquals($product, "Visa GoldAPAP");
}
}
3 changes: 3 additions & 0 deletions tests/Unit/ExampleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ public function test_example()
{
$this->assertTrue(true);
}



}

0 comments on commit 25abef0

Please sign in to comment.