How do I debug a the output errors on SimpleTest when I'm not sure where in the script the error occurred?
Part of why your test is failing is pretty easy to see.  Your code is relying on node 1 existing:

function insertMockData($data = array(), $submitted_datetime = REQUEST_TIME) {

        $node_web = node_load(1);
        $submission = (object) array(
        'nid' =&gt; $node_web-&gt;nid,
        //'uid' =&gt; $user-&gt;uid,
        'submitted' =&gt; $submitted_datetime,
        'remote_addr' =&gt; ip_address(),
        'is_draft' =&gt; FALSE,
        'data' =&gt; $data,
            'serial' =&gt; $this-&gt;serial_value++,
        );
  //lots of stuff omitted here...
}


The code assumes that there's a node in your DB for you to load.  Sadly, no :-)

When SimpleTest runs, it creates a whole empty DB that's just installed.  If you need a node, you have to create one, like this:

$settings = [
  'title' =&gt; 'My Test Content',
  'body'  =&gt; 'and what a body it is',
  'status' =&gt; 1,
  'type' =&gt; 'article',
];

$test_node = $this-&gt;drupalCreateNode($settings);
$this-&gt;assertNotNull($test_node, "Make sure our settings work");


See core/modules/simpletest/src/WebTestBase.php for some of the methods you can use to create nodes and users and other useful test data.  But in general: your test or the test's superclasses need to create everything you need either in setUp() or in your test itself.