function BoxesSpacesTestCase::runTest in Boxes 7
Same name and namespace in other branches
- 6 tests/boxes.test \BoxesSpacesTestCase::runTest()
2 calls to BoxesSpacesTestCase::runTest()
File
- tests/
boxes_spaces.test, line 32
Class
Code
function runTest($path) {
$this
->ajaxLoadBoxesBlock('boxes_add__simple', $path);
$this
->assertResponse('200', 'Response code 200');
$this
->assertText(t('Add custom box'), 'Found box add form');
$edit = array(
'description' => $this
->randomName(),
'title' => $this
->randomName(),
'body' => $this
->randomName(32),
);
$this
->drupalPost(NULL, $edit, t('Save'));
$response = $this
->parseJSON();
$delta = NULL;
foreach ($response as $command) {
if ($command->command == 'getBlock') {
$delta = $command->delta;
break;
}
}
if (!$delta) {
$this
->fail('AJAX block submission failed');
}
$this
->ajaxLoadBoxesBlock($delta, $path);
$this
->assertResponse('200', 'Response code 200');
$this
->assertText($edit['title'], 'Found box');
$this
->ajaxLoadBoxesBlock($delta, 'node');
$this
->assertNoText($edit['title'], "Block not available outside spaces.");
return $delta;
}