Example #1
0
 public function testSetUserProperties()
 {
     $userProps = ['dob' => 'tomorrow', 'gender' => 'f'];
     $event = new Event();
     $event->setUserProperties($userProps);
     $this->assertSame(['user_properties' => $userProps], $event->toArray(), 'Should set user properties in user_properties');
     $userProps2 = ['dob' => 'yesterday', 'name' => 'Baby'];
     $expected = ['dob' => 'yesterday', 'gender' => 'f', 'name' => 'Baby'];
     $event->setUserProperties($userProps2);
     $this->assertSame(['user_properties' => $expected], $event->toArray(), 'Second call to setUserProperties should update properties, not remove existing');
 }