// XXX: we should probably have some common source for this stuff
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
-define('STATUSNET', true);
+define('GNUSOCIAL', true);
+define('STATUSNET', true); // compatibility
require_once INSTALLDIR . '/lib/common.php';
{
parent::__construct();
- $authorNick1 = 'activitygenerationtestsuser' . common_good_rand(4);
- $authorNick2 = 'activitygenerationtestsuser' . common_good_rand(4);
+ $authorNick1 = 'activitygenerationtestsuser' . common_random_hexstr(4);
+ $authorNick2 = 'activitygenerationtestsuser' . common_random_hexstr(4);
- $targetNick1 = 'activitygenerationteststarget' . common_good_rand(4);
- $targetNick2 = 'activitygenerationteststarget' . common_good_rand(4);
+ $targetNick1 = 'activitygenerationteststarget' . common_random_hexstr(4);
+ $targetNick2 = 'activitygenerationteststarget' . common_random_hexstr(4);
- $groupNick1 = 'activitygenerationtestsgroup' . common_good_rand(4);
- $groupNick2 = 'activitygenerationtestsgroup' . common_good_rand(4);
+ $groupNick1 = 'activitygenerationtestsgroup' . common_random_hexstr(4);
+ $groupNick2 = 'activitygenerationtestsgroup' . common_random_hexstr(4);
$this->author1 = User::register(array('nickname' => $authorNick1,
'email' => $authorNick1 . '@example.net',
{
$orig = $this->_fakeNotice($this->targetUser1);
- $text = "@" . $this->targetUser1->nickname . " reply text " . common_good_rand(4);
+ $text = "@" . $this->targetUser1->nickname . " reply text " . common_random_hexstr(4);
$reply = Notice::saveNew($this->author1->id, $text, 'test', array('uri' => null, 'reply_to' => $orig->id));
{
$orig = $this->_fakeNotice($this->targetUser1);
- $text = "@" . $this->targetUser1->nickname . " reply text " . common_good_rand(4);
+ $text = "@" . $this->targetUser1->nickname . " reply text " . common_random_hexstr(4);
$reply = Notice::saveNew($this->author1->id, $text, 'test', array('uri' => null, 'reply_to' => $orig->id));
{
$orig = $this->_fakeNotice($this->targetUser1);
- $text = "@" . $this->targetUser1->nickname . " reply text " . common_good_rand(4);
+ $text = "@" . $this->targetUser1->nickname . " reply text " . common_random_hexstr(4);
$reply = Notice::saveNew($this->targetUser2->id, $text, 'test', array('uri' => null, 'reply_to' => $orig->id));
- $text = "@" . $this->targetUser1->nickname . " @" . $this->targetUser2->nickname . " reply text " . common_good_rand(4);
+ $text = "@" . $this->targetUser1->nickname . " @" . $this->targetUser2->nickname . " reply text " . common_random_hexstr(4);
$reply2 = Notice::saveNew($this->author1->id, $text, 'test', array('uri' => null, 'reply_to' => $reply->id));
public function testGroupPostAttention()
{
- $text = "!" . $this->targetGroup1->nickname . " reply text " . common_good_rand(4);
+ $text = "!" . $this->targetGroup1->nickname . " reply text " . common_random_hexstr(4);
$notice = Notice::saveNew($this->author1->id, $text, 'test', array('uri' => null));
public function testMultipleGroupPostAttention()
{
- $text = "!" . $this->targetGroup1->nickname . " !" . $this->targetGroup2->nickname . " reply text " . common_good_rand(4);
+ $text = "!" . $this->targetGroup1->nickname . " !" . $this->targetGroup2->nickname . " reply text " . common_random_hexstr(4);
$notice = Notice::saveNew($this->author1->id, $text, 'test', array('uri' => null));
public function testTag()
{
- $tag1 = common_good_rand(4);
+ $tag1 = common_random_hexstr(4);
$notice = $this->_fakeNotice($this->author1, '#' . $tag1);
public function testMultiTag()
{
- $tag1 = common_good_rand(4);
- $tag2 = common_good_rand(4);
+ $tag1 = common_random_hexstr(4);
+ $tag2 = common_random_hexstr(4);
$notice = $this->_fakeNotice($this->author1, '#' . $tag1 . ' #' . $tag2);
public function testGeotaggedActivity()
{
- $notice = Notice::saveNew($this->author1->id, common_good_rand(4), 'test', array('uri' => null, 'lat' => 45.5, 'lon' => -73.6));
+ $notice = Notice::saveNew($this->author1->id, common_random_hexstr(4), 'test', array('uri' => null, 'lat' => 45.5, 'lon' => -73.6));
$entry = $notice->asAtomEntry();
{
$orig = $this->_fakeNotice($this->targetUser1);
- $text = "@" . $this->targetUser1->nickname . " reply text " . common_good_rand(4);
+ $text = "@" . $this->targetUser1->nickname . " reply text " . common_random_hexstr(4);
$reply = Notice::saveNew($this->author1->id, $text, 'test', array('uri' => null, 'reply_to' => $orig->id));
- $conv = Conversation::staticGet('id', $reply->conversation);
+ $conv = Conversation::getKV('id', $reply->conversation);
$entry = $reply->asAtomEntry();
}
if (empty($text)) {
- $text = "fake-o text-o " . common_good_rand(32);
+ $text = "fake-o text-o " . common_random_hexstr(32);
}
return Notice::saveNew($user->id, $text, 'test', array('uri' => null));