Пример #1
0
 static function go()
 {
     /** Everything is relative to the application root now. */
     chdir(__DIR__);
     /** Setup autoloading */
     require 'init_autoloader.php';
     /** bootstrap ZF2 */
     $config = (require 'config/application.config.php');
     Zend\Mvc\Application::init($config);
     $serviceManager = new ServiceManager(new ServiceManagerConfig());
     $serviceManager->setService('ApplicationConfig', $config);
     $serviceManager->get('ModuleManager')->loadModules();
     self::$serviceManager = $serviceManager;
     /** Reset the DB */
     `mysql --user=root -e "drop database IF EXISTS metator_tests"`;
     `mysql --user=root -e "create database metator_tests"`;
     `mysql --user=root metator_tests < install.sql`;
 }
Пример #2
0
 function setUp()
 {
     $this->db = \phpunit_bootstrap::getServiceManager()->get('Zend\\Db\\Adapter\\Adapter');
     $this->db->getDriver()->getConnection()->beginTransaction();
     $this->dataMapper = new DataMapper($this->db);
 }
Пример #3
0
 function setUp()
 {
     $this->db = phpunit_bootstrap::getServiceManager()->get('Zend\\Db\\Adapter\\Adapter');
     $this->emptyTables();
 }