function BoxesSpacesTestCase::runTest in Boxes 6
Same name and namespace in other branches
- 7 tests/boxes_spaces.test \BoxesSpacesTestCase::runTest()
2 calls to BoxesSpacesTestCase::runTest()
File
- tests/
boxes.test, line 187
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;
}