for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace ApiTest\Controller;
use PDO;
use Api\Model\DistributionReportTransactionScript;
use Zend\Stdlib\ArrayUtils;
use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase;
use PHPUnit\DbUnit\TestCaseTrait;
class DistributionReportTransactionScriptTest extends AbstractHttpControllerTestCase
{
use TestCaseTrait;
private static $pdo = null;
private $conn = null;
public function setUp()
$configOverrides = [];
$this->setApplicationConfig(ArrayUtils::merge(
include __DIR__ . '/../../../../config/application.config.php',
$configOverrides
));
$services = $this->getApplicationServiceLocator();
$config = $services->get('config');
unset($config['db']);
$services->setAllowOverride(true);
$services->setService('config', $config);
$services->setAllowOverride(false);
parent::setUp();
}
final public function getConnection()
if ($this->conn === null) {
if (self::$pdo == null) {
self::$pdo = new PDO('sqlite::memory:');
$this->conn = $this->createDefaultDBConnection(self::$pdo, ':memory:');
return $this->conn;
protected function getDataSet()
return $this->createXMLDataSet(__DIR__ . '/../fixtures/database.xml');