$this->assertNotEqual($build_id_from_cache_initial,$build_id_from_cache_first_ajax,'Build id is changed in the simpletest-DOM on first AJAX submission');
$this->assertNotEqual($build_id_first_ajax,$build_id_from_cache_first_ajax,'Build id from first user is not reused');
$expected=array(
'command'=>'updateBuildId',
'old'=>$build_id_from_cache_initial,
'new'=>$build_id_from_cache_first_ajax,
);
$this->assertCommand($commands,$expected,'Build id change command issued on first AJAX submission');
$this->assertEqual($original['form']['#build_id_old'],$build_id,'Original build_id was recorded');
$this->assertNotEqual($original['form']['#build_id'],$build_id,'New build_id was generated');
// Assert that a watchdog message was logged by form_set_cache.
$status=(bool)db_query_range('SELECT 1 FROM {watchdog} WHERE message = :message',0,1,array(':message'=>'Form build-id mismatch detected while attempting to store a form in the cache.'));
$this->assert($status,'A watchdog message was logged by form_set_cache');
// Ensure that the form state was not poisoned by the preceeding call.
$this->assertEqual($build_id_from_cache_first_validation,$build_id_from_cache_second_validation,'Build id remains the same when form validation fails subsequently');
}
/**
* Build-id is regenerated when rebuilding cached form.