library/Bootstrap/BootstrapBase.php
protected function registerResetDbAfterSuite()
    {
        $serviceCaller = new ServiceCaller($this->getTestConfig());
        $serviceCaller->setParameter('dumpDB', true);
        $serviceCaller->setParameter('dump-prefix', 'orig_db_dump');
        try {
            $serviceCaller->callService('ShopPreparation', 1);
        } catch (\Exception $e) {
            define('RESTORE_SHOP_AFTER_TEST_SUITE_ERROR', true);
        }

        register_shutdown_function(function () {
            if (!defined('RESTORE_SHOP_AFTER_TEST_SUITE_ERROR')) {
                $serviceCaller = new ServiceCaller();
                $serviceCaller->setParameter('restoreDB', true);
                $serviceCaller->setParameter('dump-prefix', 'orig_db_dump');
                $serviceCaller->callService('ShopPreparation', 1);
            }
        });
    }
protected function registerResetDbAfterSuite()
    {
        $serviceCaller = new ServiceCaller($this->getTestConfig());
        $serviceCaller->setParameter('dumpDB', true);
        $serviceCaller->setParameter('dump-prefix', 'orig_db_dump');
        try {
            $serviceCaller->callService('ShopPreparation', 1);
        } catch (\Exception $e) {
            define('RESTORE_SHOP_AFTER_TEST_SUITE_ERROR', true);
        }

        register_shutdown_function(function () {
            if (!defined('RESTORE_SHOP_AFTER_TEST_SUITE_ERROR')) {
                $serviceCaller = new ServiceCaller();
                $serviceCaller->setParameter('restoreDB', true);
                $serviceCaller->setParameter('dump-prefix', 'orig_db_dump');
                $serviceCaller->callService('ShopPreparation', 1);
            }
        });
    }
protected function registerResetDbAfterSuite ( ) { $ serviceCaller = new ServiceCaller ( $ this -> getTestConfig ( ) ) ; $ serviceCaller -> setParameter ( 'dumpDB' , true ) ; $ serviceCaller -> setParameter ( 'dump-prefix' , 'orig_db_dump' ) ; try { $ serviceCaller -> callService ( 'ShopPreparation' , 1 ) ; } catch ( \ Exception $ e ) { define ( 'RESTORE_SHOP_AFTER_TEST_SUITE_ERROR' , true ) ; } register_shutdown_function ( function ( ) { if ( ! defined ( 'RESTORE_SHOP_AFTER_TEST_SUITE_ERROR' ) ) { $ serviceCaller = new ServiceCaller ( ) ; $ serviceCaller -> setParameter ( 'restoreDB' , true ) ; $ serviceCaller -> setParameter ( 'dump-prefix' , 'orig_db_dump' ) ; $ serviceCaller -> callService ( 'ShopPreparation' , 1 ) ; } } ) ; }
Creates original database dump and registers database restoration
after the tests suite.
Creates original database dump and registers database restoration after the tests suite .