/** * Test that getState does not return double-underscore-prefixed keys * * @covers Mixpanel\DataStorage\Cookie::getState * @covers Mixpanel\DataStorage\Cookie::getStorageKey * @covers Mixpanel\DataStorage\Cookie::generateStorageKey * @covers Mixpanel\DataStorage\Cookie::filterState */ public function testGetStateReturnsFilteredArrayFromCookie() { $data = array('foo' => 'bar', '__alias' => 'somealias', '__mtp' => 'sure', 'distinct_id' => 'some-uuid'); $_COOKIE[$this->cookieName] = json_encode($data); $this->assertSame(array('foo' => 'bar', 'distinct_id' => 'some-uuid'), $this->cookie->getState()); }