2 use PayPal\Auth\Openid\PPOpenIdUserinfo;
4 * Test class for PPOpenIdUserinfo.
7 class PPOpenIdUserinfoTest extends \PHPUnit_Framework_TestCase {
11 * Sets up the fixture, for example, opens a network connection.
12 * This method is called before a test is executed.
14 protected function setUp()
19 * Tears down the fixture, for example, closes a network connection.
20 * This method is called after a test is executed.
22 protected function tearDown()
30 public function testSerializationDeserialization() {
31 $user = new PPOpenIdUserinfo();
32 $user->setAccountType("PERSONAL")->setAgeRange("20-30")->setBirthday("1970-01-01")
33 ->setEmail("me@email.com")->setEmailVerified(true)
34 ->setFamilyName("Doe")->setMiddleName("A")->setGivenName("John")
35 ->setLocale("en-US")->setGender("male")->setName("John A Doe")
36 ->setPayerId("A-XZASASA")->setPhoneNumber("1-408-111-1111")
37 ->setPicture("http://gravatar.com/me.jpg")
38 ->setSub("me@email.com")->setUserId("userId")
39 ->setVerifiedAccount(true)->setZoneinfo("America/PST");
41 $userCopy = new PPOpenIdUserinfo();
42 $userCopy->fromJson($user->toJSON());
44 $this->assertEquals($user, $userCopy);