Asumming you have enable BasicAuth in your MAutic server and ...
Make sure you have the correct MauticApiTestCase
that has:
protected function getAuth()
{
$this->config = include __DIR__.'/../local.config.php';
$authMethod = isset($this->config['AuthMethod']) ? $this->config['AuthMethod'] : 'OAuth';
$apiAuth = new ApiAuth();