/** * @dataProvider requests */ public function testPreresponse(array $request, $response) { $server = new Server(__DIR__ . '/apps'); $GLOBALS['encrypt'] = true; $response = ['responses' => $response]; do_encrypt($response); $this->assertEquals($response, $server->handle($request)->getResponses()); }
function checkCookies() { if (isset($_COOKIE)) { if (isset($_COOKIE['user'])) { $_SESSION['login'] = true; $_SESSION['id'] = do_encrypt($_COOKIE['user']); } } }
function make($data) { $data = json_encode($data); return do_encrypt($data, '!@#12354678019.'); }
function saveData($d) { setcookie("data", do_encrypt($d)); }