random number for unit testing if ($seedRandom) { mt_srand(0); } $beaconTokens = array( 's' => 'News', 't' => ($this->getBeaconToken() ?: 0), 'i' => ($this->getAssetId() ?: 0), 'p' => ($this->getSectionId() ?: 0), 'a' => ($this->getEdition() ?: 0), 'u' => ($this->getAsseturi() ?: 0), 'r' => 0, // http_referrer 'q' => 0, // query_string 'z' => mt_rand(1, 10000)); foreach ($beaconTokens as $key => $value) { $this->beacon .= sprintf('~RS~%s~RS~%s', $key, $value); } return $this->beacon . '~RS~'; }