public function testFrom() { $phantomJsCookie = '[General] cookies="@Variant(\\0\\0\\0\\x7f\\0\\0\\0\\x16QList<QNetworkCookie>\\0\\0\\0\\0\\x1\\0\\0\\0\\x2\\0\\0\\0SPHPSESSID=asdf123465; expires=Sat, 25-Jan-14 16:57:33 GMT; domain=.test1.ru; path=/\\0\\0\\0QtestName=testValue; expires=Sat, 25-Jan-14 16:57:33 GMT; domain=.test1.ru; path=/)" '; $cookies = PhantomJsCookie::from($phantomJsCookie); $this->assertArrayHasKey('testName', $cookies); $this->assertArrayHasKey('value', $cookies['testName']); $this->assertEquals('testValue', $cookies['testName']['value']); $this->assertArrayHasKey('PHPSESSID', $cookies); $this->assertArrayHasKey('value', $cookies['PHPSESSID']); $this->assertEquals('asdf123465', $cookies['PHPSESSID']['value']); }