ing.html
My initial code was like this:
<?php

namespace ApplicationTest\Controller;

use Zend\Http\Request;
use Zend\Http\Response;
use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase;

class IndexControllerTest extends AbstractHttpControllerTestCase {

    protected $controller;
    protected $request;
    protected $response;
    protected $routeMatch;
    protected $event;
    protected $traceError = true;

    public function setUp() {

        $this->setApplicationConfig(
            include '../../../config/application.config.php'
        );
        parent::setUp();
    }

    public function testIndexActionCanBeAccessed() {

        $this->dispatch('/');
        $this->assertResponseStatusCode(200);

    }
}

And when I ran phpunit, I got the following error message:
PHPUnit 3.7.21 by Sebastian Bergmann.
Configuration read from /usr/share/php/tool/module/Application/test/phpunit.xml
onDispatch called.
E
Time: 1 second, Memory: 14.50Mb
There was 1 error:
1) ApplicationTest\Controller\IndexControllerTest::testIndexActionCanBeAccessed
Zend\ServiceManager\Exception\ServiceNotFoundException: Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for Zend\Db\Adapter\Adapter
Then I followed the second set of instructions to configure the service manager.
public function testIndexActionCanBeAccessed() {

    $albumTableMock = $this->getMockBuilder('User\Model\UserData')
        ->disableOriginalConstructor()
        ->getMock();

    $albumTableMock->expects($this->once())
        ->method('getUserSessionArray')
        ->will($this->returnValue(array()));

    $serviceManager = $this->getApplicationServiceLocator();
    $serviceManager->setAllowOverride(true);
    $serviceManager->setService('User\Model\UserData', $albumTableMock);

    $this->dispatch('/');
    $this->assertResponseStatusCode(200);

}

And this time, I got the following error:
PHPUnit 3.7.21 by Sebastian Bergmann.
Configuration read from /usr/share/php/tool/module/Application/test/phpunit.xml
onDispatch ca