public function getContentToSign() { $params = $this->getParamsToSign(); if ($this->encodePolicy == self::ENCODE_POLICY_QUERY) { return urldecode(http_build_query($params)); } elseif ($this->encodePolicy == self::ENCODE_POLICY_JSON) { return json_encode($params); } else { return null; } }
public function testGetContentToSign() { $params1 = ['bbb' => '2222', 'ccc' => '3333', 'aaa' => '111', 's' => '"."', 'e' => '', 'apple' => 'jobs']; $signer = new Signer($params1); $signer->setIgnores(['apple']); $content = $signer->getContentToSign(); $this->assertEquals('aaa=111&bbb=2222&ccc=3333&s="."', $content); }