Merge branch 'testing' of gitorious.org:statusnet/mainline into testing

This commit is contained in:
Evan Prodromou 2010-12-30 16:21:45 -08:00
commit 7793d3b7ad
2 changed files with 21 additions and 2 deletions
plugins/Bookmark
tests

View File

@ -2,6 +2,13 @@ $(document).ready(
function() {
var form = $('#form_new_bookmark');
form.append('<input type="hidden" name="ajax" value="1"/>');
function doClose() {
self.close();
// If in popup blocker situation, we'll have to redirect back.
setTimeout(function() {
window.location = $('#url').val();
}, 100);
}
form.ajaxForm({dataType: 'xml',
timeout: '60000',
beforeSend: function(formData) {
@ -11,12 +18,12 @@ $(document).ready(
error: function (xhr, textStatus, errorThrown) {
form.removeClass('processing');
form.find('#submit').removeClass('disabled');
self.close();
doClose();
},
success: function(data, textStatus) {
form.removeClass('processing');
form.find('#submit').removeClass('disabled');
self.close();
doClose();
}});
}

View File

@ -21,5 +21,17 @@ class UUIDTest extends PHPUnit_Framework_TestCase
$this->assertEquals(0x4000, hexdec(substr($result, 14, 4)) & 0xF000);
$this->assertEquals(0x8000, hexdec(substr($result, 19, 4)) & 0xC000);
}
public function testUnique()
{
$reps = 100;
$ids = array();
for ($i = 0; $i < $reps; $i++) {
$ids[] = UUID::gen();
}
$this->assertEquals(count($ids), count(array_unique($ids)), "UUIDs must be unique");
}
}