Skip to content

Commit

Permalink
feat: cria classe para os dados de Debito
Browse files Browse the repository at this point in the history
  • Loading branch information
valdeir2000 committed Aug 19, 2020
1 parent 3c06ec9 commit 43671ff
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace ValdeirPsr\PagSeguro\Domains\PaymentMethod;

class DebitCard extends AbstractPaymentMethod
{
/** @var string Link de pagamento (somente leitura) */
private $paymentLink;

public function __construct()
{
parent::__construct('eft');
}

/**
* @return string
*/
public function getPaymentLink(): string
{
return $this->paymentLink;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use PHPUnit\Framework\TestCase;
use ValdeirPsr\PagSeguro\Domains\PaymentMethod\Boleto;
use ValdeirPsr\PagSeguro\Domains\PaymentMethod\AbstractPaymentMethod;

class BoletoTest extends TestCase
{
Expand All @@ -12,6 +13,7 @@ public function newInstance()
{
$instance = new Boleto();
$this->assertInstanceOf(Boleto::class, $instance);
$this->assertInstanceOf(AbstractPaymentMethod::class, $instance);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

use PHPUnit\Framework\TestCase;
use ValdeirPsr\PagSeguro\Domains\PaymentMethod\AbstractPaymentMethod;
use ValdeirPsr\PagSeguro\Domains\PaymentMethod\DebitCard;

class DebitCardTest extends TestCase
{
/**
* @test
*/
public function newInstance()
{
$instance = new DebitCard();
$this->assertInstanceOf(DebitCard::class, $instance);
$this->assertInstanceOf(AbstractPaymentMethod::class, $instance);
}

/**
* @test
*/
public function getMethodShouldReturnEFT()
{
$instance = new DebitCard();
$this->assertEquals('eft', $instance->getMethod());
}
}

0 comments on commit 43671ff

Please sign in to comment.