Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00%
0 / 1
0.00%
0 / 1
CRAP
0.00%
0 / 12
MsSql
0.00%
0 / 1
0.00%
0 / 1
2
0.00%
0 / 12
 cleanup()
0.00%
0 / 1
2
0.00%
0 / 12
<?php
namespace Codeception\Util\Driver;
class MsSql extends Db
{
public function cleanup() {
$this->dbh->exec("DECLARE tables_cursor CURSOR FOR SELECT name FROM sysobjects WHERE type = 'U'");
$this->dbh->exec("OPEN tables_cursor DECLARE @tablename sysname");
$this->dbh->exec("FETCH NEXT FROM tables_cursor INTO @tablename
WHILE (@@FETCH_STATUS <> -1)
BEGIN
EXEC ('DROP TABLE ' + @tablename)
FETCH NEXT FROM tables_cursor INTO @tablename
END
");
$this->dbh->exec('DEALLOCATE tables_cursor');
}
}