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/Common/UserAgentTest.php
japatel 9c0827643b Renaming Namespaces and Organizing Classes
- Updated OpenId classes to be in API namespace
- Updated PP Naming Convention to PayPal Naming Convention
- FormatConverter Class got its own namespace
- Handlers are grouped in Handler namespace
- Samples and Tests Updated Accordingly
2014-12-18 14:16:41 -06:00

29 lines
965 B
PHP

<?php
use PayPal\Common\PayPalUserAgent;
class UserAgentTest extends PHPUnit_Framework_TestCase
{
public function testGetValue()
{
$ua = PayPalUserAgent::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)));
}
}