File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424use modOXID ;
2525use modOxUtilsDate ;
2626
27+ use oxDatabaseHelper ;
2728use OxidEsales \Eshop \Core \DatabaseProvider ;
2829use OxidEsales \EshopCommunity \Core \Database \Adapter \DatabaseInterface ;
2930use OxidEsales \EshopCommunity \Core \Database ;
3839use ReflectionClass ;
3940use Exception ;
4041
42+ require_once TEST_LIBRARY_HELPERS_PATH . 'oxDatabaseHelper.php ' ;
4143require_once TEST_LIBRARY_HELPERS_PATH . 'modOxUtilsDate.php ' ;
4244
4345/**
Original file line number Diff line number Diff line change 11<?php
2-
32/**
43 * This file is part of OXID eSales Testing Library.
54 *
@@ -81,6 +80,21 @@ public function existsView($tableName)
8180 return $ tableNameView === $ this ->database ->getOne ($ sql );
8281 }
8382
83+ /**
84+ * @param string $tableName The name of the table we want to assure to exist.
85+ *
86+ * @return bool Does the database table with the given name exists?
87+ */
88+ public function existsTable ($ tableName )
89+ {
90+ $ database = DatabaseProvider::getDb ();
91+ $ sql = "SELECT COUNT(TABLE_NAME) FROM information_schema.TABLES WHERE TABLE_NAME = ' $ tableName' " ;
92+
93+ $ count = $ database ->getOne ($ sql );
94+
95+ return $ count > 0 ;
96+ }
97+
8498 public function adjustTemplateBlocksOxModuleColumn ()
8599 {
86100 $ sql = "ALTER TABLE `oxtplblocks`
You can’t perform that action at this time.
0 commit comments