Test block library search.
function testBlockLibrarySearch() {
// Check that the block plugin is valid.
$this
->drupalPost('admin/structure/block/list/block_plugin_ui:stark/add', array(
'block' => 'invalid_block',
), t('Next'));
$this
->assertText('You must select a valid block.');
// Check that the block search form redirects to the correct block form.
$this
->drupalPost('admin/structure/block/list/block_plugin_ui:stark/add', array(
'block' => 'system_main_block',
), t('Next'));
$this
->assertUrl('admin/structure/block/add/system_main_block/stark');
}