for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Tests\Classes;
use Ipag\Classes\Endpoint;
use PHPUnit\Framework\TestCase;
class EndpointTest extends TestCase
{
public function testCreateAndSetEndpoint()
$endpoint = new Endpoint(Endpoint::SANDBOX);
$this->assertEquals($endpoint->getUrl(), Endpoint::SANDBOX);
$endpoint->setUrl(Endpoint::PRODUCTION);
$this->assertEquals($endpoint->getUrl(), Endpoint::PRODUCTION);
}
public function testGetPaymentEndpointUrl()
$this->assertEquals($endpoint->payment(), Endpoint::SANDBOX.Endpoint::PAYMENT);
public function testGetConsultEndpointUrl()
$this->assertEquals($endpoint->consult(), Endpoint::SANDBOX.Endpoint::CONSULT);
public function testGetCancelEndpointUrl()
$this->assertEquals($endpoint->cancel(), Endpoint::SANDBOX.Endpoint::CANCEL);
public function testGetCaptureEndpointUrl()
$this->assertEquals($endpoint->CAPTURE(), Endpoint::SANDBOX.Endpoint::CAPTURE);