/** * {@inheritDoc} */ public function tearDown() { parent::tearDown(); // clear session and database $_SESSION['cart']->reset(true); $_SESSION['cart']->restore_contents(); }
/** * Tear down. */ public function tearDown() { parent::tearDown(); $adminUserRoleService = $this->get('adminUserRoleService'); ZMRuntime::getDatabase()->executeUpdate('TRUNCATE TABLE %table.admin_roles%'); ZMRuntime::getDatabase()->executeUpdate('TRUNCATE TABLE %table.admins_to_roles%'); $adminUserRoleService->addRole('admin'); $adminUserRoleService->addRole('demo'); ZMRuntime::getDatabase()->executeUpdate('INSERT INTO %table.admins_to_roles% VALUES(1, 1)'); }
/** * Clean up. */ public function tearDown() { $sql = 'SELECT customers_id FROM %table.customers% WHERE customers_lastname = \'doe\''; $results = ZMRuntime::getDatabase()->fetchAll($sql, array(), 'customers'); $ids = array(); foreach ($results as $result) { $ids[] = $result['accountId']; } if (0 == count($ids)) { // nothing to do return; } $sql = 'DELETE FROM %table.customers_info% WHERE customers_info_id IN (:accountId)'; $results = ZMRuntime::getDatabase()->updateObj($sql, array('accountId' => $ids), 'customers_info'); $sql = 'DELETE FROM %table.customers% WHERE customers_id IN (:accountId)'; $results = ZMRuntime::getDatabase()->updateObj($sql, array('accountId' => $ids), 'customers'); parent::tearDown(); }
/** * {@inheritDoc} */ public function tearDown() { $couponTables = array('coupons', 'coupons_description', 'coupon_email_track', 'coupon_redeem_track', 'coupon_restrict'); $accountTables = array('coupon_gv_customer', 'coupon_gv_queue'); foreach ($couponTables as $table) { $idName = 'coupons' == $table ? 'id' : 'couponId'; $sql = "DELETE FROM %table." . $table . "%\n WHERE coupon_id = :" . $idName; foreach ($this->createdCouponIds as $couponId) { \ZMRuntime::getDatabase()->updateObj($sql, array($idName => $couponId), $table); } } foreach ($accountTables as $table) { $sql = "DELETE FROM %table." . $table . "%\n WHERE customer_id = :accountId"; foreach ($this->accountIds as $accountId) { \ZMRuntime::getDatabase()->updateObj($sql, array('accountId' => $accountId), $table); } } parent::tearDown(); }
/** * Set up. */ public function setUp() { parent::setUp(); // all tests assume this Runtime::getSettings()->set('zenmagick.mvc.resultlist.defaultPagination', 10); }
/** * Set up. */ public function setUp() { parent::setUp(); }
/** * {@inheritDoc} */ public function tearDown() { parent::tearDown(); ZMRuntime::getDatabase()->executeUpdate('DROP TABLE IF EXISTS %table.create_update_tests%;'); ZMRuntime::getDatabase()->getMapper()->removeMappingForTable('create_update_tests'); }