forked from LiveCarta/PayPal-PHP-SDK
Enabled EC Parameters support
- Updated Api to enabled EC Parameters - Updated Tests - Updated Logging Manager - Added a feature to do validation on accessors.
This commit is contained in:
@@ -2,25 +2,27 @@
|
||||
|
||||
use PayPal\Common\PPUserAgent;
|
||||
|
||||
class UserAgentTest extends PHPUnit_Framework_TestCase {
|
||||
|
||||
public function testGetValue() {
|
||||
$ua = PPUserAgent::getValue("name", "version");
|
||||
list($id, $version, $features) = sscanf($ua, "PayPalSDK/%s %s (%s)");
|
||||
|
||||
// Check that we pass the useragent in the expected format
|
||||
$this->assertNotNull($id);
|
||||
$this->assertNotNull($version);
|
||||
$this->assertNotNull($features);
|
||||
|
||||
$this->assertEquals("name", $id);
|
||||
$this->assertEquals("version", $version);
|
||||
|
||||
// Check that we pass in these mininal features
|
||||
$this->assertThat($features, $this->stringContains("OS="));
|
||||
$this->assertThat($features, $this->stringContains("Bit="));
|
||||
$this->assertThat($features, $this->stringContains("Lang="));
|
||||
$this->assertThat($features, $this->stringContains("V="));
|
||||
$this->assertGreaterThan(5, count(explode(';', $features)));
|
||||
}
|
||||
class UserAgentTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
public function testGetValue()
|
||||
{
|
||||
$ua = PPUserAgent::getValue("name", "version");
|
||||
list($id, $version, $features) = sscanf($ua, "PayPalSDK/%s %s (%s)");
|
||||
|
||||
// Check that we pass the useragent in the expected format
|
||||
$this->assertNotNull($id);
|
||||
$this->assertNotNull($version);
|
||||
$this->assertNotNull($features);
|
||||
|
||||
$this->assertEquals("name", $id);
|
||||
$this->assertEquals("version", $version);
|
||||
|
||||
// Check that we pass in these mininal features
|
||||
$this->assertThat($features, $this->stringContains("OS="));
|
||||
$this->assertThat($features, $this->stringContains("Bit="));
|
||||
$this->assertThat($features, $this->stringContains("Lang="));
|
||||
$this->assertThat($features, $this->stringContains("V="));
|
||||
$this->assertGreaterThan(5, count(explode(';', $features)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user