This repository has been archived on 2026-04-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
PayPal-PHP-SDK/tests/PayPal/Test/Api/FlowConfigTest.php
Jay Patel aabcf9c2aa Formatting Fixes
- Fixed Imports
- Fixed Formatting
- Added Missing Documentation
2015-06-30 12:08:56 -05:00

68 lines
1.6 KiB
PHP

<?php
namespace PayPal\Test\Api;
use PayPal\Api\FlowConfig;
/**
* Class FlowConfig
*
* @package PayPal\Test\Api
*/
class FlowConfigTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object FlowConfig
* @return string
*/
public static function getJson()
{
return '{"landing_page_type":"TestSample","bank_txn_pending_url":"http://www.google.com"}';
}
/**
* Gets Object Instance with Json data filled in
* @return FlowConfig
*/
public static function getObject()
{
return new FlowConfig(self::getJson());
}
/**
* Tests for Serialization and Deserialization Issues
* @return FlowConfig
*/
public function testSerializationDeserialization()
{
$obj = new FlowConfig(self::getJson());
$this->assertNotNull($obj);
$this->assertNotNull($obj->getLandingPageType());
$this->assertNotNull($obj->getBankTxnPendingUrl());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
}
/**
* @depends testSerializationDeserialization
* @param FlowConfig $obj
*/
public function testGetters($obj)
{
$this->assertEquals($obj->getLandingPageType(), "TestSample");
$this->assertEquals($obj->getBankTxnPendingUrl(), "http://www.google.com");
}
/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage BankTxnPendingUrl is not a fully qualified URL
*/
public function testUrlValidationForBankTxnPendingUrl()
{
$obj = new FlowConfig();
$obj->setBankTxnPendingUrl(null);
}
}