Skip to content
Browse files

Making the tests work for MySQL and MySQLi drivers independent of the

overall suite(s).
  • Loading branch information...
1 parent 39ee45c commit ec1b6982c985c9b80b1f09dbe0b47501c4ada0c1 @LouisLandry LouisLandry committed
View
32 phpunit.xml.dist
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
-<phpunit
- bootstrap="tests/bootstrap.php"
- colors="true">
+<phpunit bootstrap="tests/bootstrap.php" colors="false">
+
+ <!-- <php>
+ <const name="JTEST_DATABASE_MYSQL_DSN" value="host=localhost;dbname=joomla_ut;user=utuser;pass=ut1234" />
+ <const name="JTEST_DATABASE_MYSQLI_DSN" value="host=localhost;dbname=joomla_ut;user=utuser;pass=ut1234" />
+ </php> -->
<testsuite name="AllTests">
<directory>tests/suites</directory>
@@ -10,18 +13,19 @@
<logging>
<log type="coverage-html" target="build/coverage" title="Joomla-Platform"
- charset="UTF-8" yui="true" highlight="true"
- lowUpperBound="35" highLowerBound="70"/>
- <log type="coverage-clover" target="build/logs/clover.xml"/>
- <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
+ charset="UTF-8" yui="true" highlight="true" lowUpperBound="35"
+ highLowerBound="70" />
+ <log type="coverage-clover" target="build/logs/clover.xml" />
+ <log type="junit" target="build/logs/junit.xml"
+ logIncompleteSkipped="false" />
</logging>
<filter>
- <whitelist addUncoveredFilesFromWhitelist="false">
- <directory suffix=".php">libraries/joomla</directory>
- <directory suffix=".php">libraries/legacy</directory>
- <file>libraries/import.php</file>
- <file>libraries/loader.php</file>
- <file>libraries/platform.php</file>
- </whitelist>
+ <whitelist addUncoveredFilesFromWhitelist="false">
+ <directory suffix=".php">libraries/joomla</directory>
+ <directory suffix=".php">libraries/legacy</directory>
+ <file>libraries/import.php</file>
+ <file>libraries/loader.php</file>
+ <file>libraries/platform.php</file>
+ </whitelist>
</filter>
</phpunit>
View
2 tests/core/case/database.php
@@ -472,7 +472,7 @@ protected function setErrorCallback($testName)
*/
protected function setUp()
{
- if (empty(self::$driver))
+ if (empty(static::$driver))
{
$this->markTestSkipped('There is no database driver.');
}
View
22 tests/core/case/database/mysql.php
@@ -48,6 +48,10 @@ public static function setUpBeforeClass()
{
$dsn = defined('JTEST_DATABASE_MYSQL_DSN') ? JTEST_DATABASE_MYSQL_DSN : getenv('JTEST_DATABASE_MYSQL_DSN');
}
+ else
+ {
+ return;
+ }
// First let's trim the mysql: part off the front of the DSN if it exists.
if (strpos($dsn, 'mysql:') === 0)
@@ -131,22 +135,4 @@ protected function getConnection()
return $this->createDefaultDBConnection($pdo, self::$_options['database']);
}
-
- /**
- * Sets up the fixture, for example, opens a network connection.
- * This method is called before a test is executed.
- *
- * @return void
- *
- * @since 12.1
- */
- protected function setUp()
- {
- if (empty(self::$driver))
- {
- $this->markTestSkipped('There is no configured MySQL database.');
- }
-
- parent::setUp();
- }
}
View
22 tests/core/case/database/mysqli.php
@@ -48,6 +48,10 @@ public static function setUpBeforeClass()
{
$dsn = defined('JTEST_DATABASE_MYSQLI_DSN') ? JTEST_DATABASE_MYSQLI_DSN : getenv('JTEST_DATABASE_MYSQLI_DSN');
}
+ else
+ {
+ return;
+ }
// First let's trim the mysql: part off the front of the DSN if it exists.
if (strpos($dsn, 'mysql:') === 0)
@@ -131,22 +135,4 @@ protected function getConnection()
return $this->createDefaultDBConnection($pdo, self::$_options['database']);
}
-
- /**
- * Sets up the fixture, for example, opens a network connection.
- * This method is called before a test is executed.
- *
- * @return void
- *
- * @since 12.1
- */
- protected function setUp()
- {
- if (empty(self::$driver))
- {
- $this->markTestSkipped('There is no configured MySQLi database.');
- }
-
- parent::setUp();
- }
}
View
22 tests/core/case/database/oracle.php
@@ -48,6 +48,10 @@ public static function setUpBeforeClass()
{
$dsn = defined('JTEST_DATABASE_ORACLE_DSN') ? JTEST_DATABASE_ORACLE_DSN : getenv('JTEST_DATABASE_ORACLE_DSN');
}
+ else
+ {
+ return;
+ }
// First let's trim the oci: part off the front of the DSN if it exists.
if (strpos($dsn, 'oci:') === 0)
@@ -139,22 +143,4 @@ protected function getConnection()
return $this->createDefaultDBConnection($pdo, self::$_options['database']);
}
-
- /**
- * Sets up the fixture, for example, opens a network connection.
- * This method is called before a test is executed.
- *
- * @return void
- *
- * @since 12.1
- */
- protected function setUp()
- {
- if (empty(self::$driver))
- {
- $this->markTestSkipped('There is no configured Oracle database.');
- }
-
- parent::setUp();
- }
}
View
22 tests/core/case/database/postgresql.php
@@ -48,6 +48,10 @@ public static function setUpBeforeClass()
{
$dsn = defined('JTEST_DATABASE_POSTGRESQL_DSN') ? JTEST_DATABASE_POSTGRESQL_DSN : getenv('JTEST_DATABASE_POSTGRESQL_DSN');
}
+ else
+ {
+ return;
+ }
// First let's trim the pgsql: part off the front of the DSN if it exists.
if (strpos($dsn, 'pgsql:') === 0)
@@ -134,22 +138,4 @@ protected function getConnection()
return $this->createDefaultDBConnection($pdo, self::$_options['database']);
}
-
- /**
- * Sets up the fixture, for example, opens a network connection.
- * This method is called before a test is executed.
- *
- * @return void
- *
- * @since 12.1
- */
- protected function setUp()
- {
- if (empty(self::$driver))
- {
- $this->markTestSkipped('There is no configured PostgreSQL database.');
- }
-
- parent::setUp();
- }
}
View
258 .../database/database/JDatabaseMySQLTest.php → ...abase/driver/mysql/JDatabaseMySQLTest.php
@@ -7,26 +7,15 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/
-require_once JPATH_PLATFORM.'/joomla/log/log.php';
-require_once JPATH_PLATFORM.'/joomla/database/database.php';
-require_once JPATH_PLATFORM.'/joomla/database/database/mysql.php';
-require_once JPATH_PLATFORM.'/joomla/database/query.php';
-require_once JPATH_PLATFORM.'/joomla/database/query/mysql.php';
-
/**
* Test class for JDatabaseMysql.
*
* @package Joomla.UnitTest
* @subpackage Database
*/
-class JDatabaseMysqlTest extends TestCaseDatabase
+class JDatabaseMysqlTest extends TestCaseDatabaseMysql
{
/**
- * @var JDatabaseMysql
- */
- protected $object;
-
- /**
* Data for the testEscape test.
*
* @return array
@@ -37,7 +26,7 @@ public function dataTestEscape()
{
return array(
array("'%_abc123", false, '\\\'%_abc123'),
- array("'%_abc123", true, '\\\'\\%\_abc123'),
+ array("'%_abc123", true, '\\\'\\%\_abc123')
);
}
@@ -50,36 +39,7 @@ public function dataTestEscape()
*/
protected function getDataSet()
{
- return $this->createXMLDataSet(__DIR__.'/stubs/database.xml');
- }
-
- /**
- * Sets up the fixture, for example, opens a network connection.
- * This method is called before a test is executed.
- *
- * @return void
- *
- * @since 11.1
- */
- protected function setUp()
- {
- @include_once JPATH_TESTS . '/config_mysql.php';
- if (class_exists('JMySQLTestConfig')) {
- $config = new JMySQLTestConfig;
- } else {
- $this->markTestSkipped('There is no Mysql test config file present.');
- }
- $this->object = JDatabase::getInstance(
- array(
- 'driver' => $config->dbtype,
- 'database' => $config->db,
- 'host' => $config->host,
- 'user' => $config->user,
- 'password' => $config->password
- )
- );
-
- parent::setUp();
+ return $this->createXMLDataSet(__DIR__ . '/stubs/database.xml');
}
/**
@@ -109,11 +69,7 @@ public function testConnected()
*/
public function testDropTable()
{
- $this->assertThat(
- $this->object->dropTable('#__bar', true),
- $this->isInstanceOf('JDatabaseDriverMysql'),
- 'The table is dropped if present.'
- );
+ $this->assertThat(self::$driver->dropTable('#__bar', true), $this->isInstanceOf('JDatabaseDriverMysql'), 'The table is dropped if present.');
}
/**
@@ -129,11 +85,7 @@ public function testDropTable()
*/
public function testEscape($text, $extra, $result)
{
- $this->assertThat(
- $this->object->escape($text, $extra),
- $this->equalTo($result),
- 'The string was not escaped properly'
- );
+ $this->assertThat(self::$driver->escape($text, $extra), $this->equalTo($result), 'The string was not escaped properly');
}
/**
@@ -145,18 +97,14 @@ public function testEscape($text, $extra, $result)
*/
public function testGetAffectedRows()
{
- $query = $this->object->getQuery(true);
+ $query = self::$driver->getQuery(true);
$query->delete();
$query->from('jos_dbtest');
- $this->object->setQuery($query);
+ self::$driver->setQuery($query);
- $result = $this->object->execute();
+ $result = self::$driver->execute();
- $this->assertThat(
- $this->object->getAffectedRows(),
- $this->equalTo(4),
- __LINE__
- );
+ $this->assertThat(self::$driver->getAffectedRows(), $this->equalTo(4), __LINE__);
}
/**
@@ -177,11 +125,8 @@ public function testGetCollation()
*/
public function testGetExporter()
{
- $this->assertThat(
- $this->object->getExporter(),
- $this->isInstanceOf('JDatabaseExporterMysql'),
- 'Line:'.__LINE__.' The getExporter method should return the correct exporter.'
- );
+ $this->assertThat(self::$driver->getExporter(), $this->isInstanceOf('JDatabaseExporterMysql'),
+ 'Line:' . __LINE__ . ' The getExporter method should return the correct exporter.');
}
/**
@@ -193,11 +138,8 @@ public function testGetExporter()
*/
public function testGetImporter()
{
- $this->assertThat(
- $this->object->getImporter(),
- $this->isInstanceOf('JDatabaseImporterMysql'),
- 'Line:'.__LINE__.' The getImporter method should return the correct importer.'
- );
+ $this->assertThat(self::$driver->getImporter(), $this->isInstanceOf('JDatabaseImporterMysql'),
+ 'Line:' . __LINE__ . ' The getImporter method should return the correct importer.');
}
/**
@@ -218,11 +160,8 @@ public function testGetNumRows()
*/
public function testGetTableCreate()
{
- $this->assertThat(
- $this->object->getTableCreate('#__dbtest'),
- $this->isType('array'),
- 'The statement to create the table is returned in an array.'
- );
+ $this->assertThat(self::$driver->getTableCreate('#__dbtest'), $this->isType('array'),
+ 'The statement to create the table is returned in an array.');
}
/**
@@ -243,11 +182,7 @@ public function testGetTableColumns()
*/
public function testGetTableKeys()
{
- $this->assertThat(
- $this->object->getTableKeys('#__dbtest'),
- $this->isType('array'),
- 'The list of keys for the table is returned in an array.'
- );
+ $this->assertThat(self::$driver->getTableKeys('#__dbtest'), $this->isType('array'), 'The list of keys for the table is returned in an array.');
}
/**
@@ -259,11 +194,7 @@ public function testGetTableKeys()
*/
public function testGetTableList()
{
- $this->assertThat(
- $this->object->getTableList(),
- $this->isType('array'),
- 'The list of tables for the database is returned in an array.'
- );
+ $this->assertThat(self::$driver->getTableList(), $this->isType('array'), 'The list of tables for the database is returned in an array.');
}
/**
@@ -275,11 +206,8 @@ public function testGetTableList()
*/
public function testGetVersion()
{
- $this->assertThat(
- strlen($this->object->getVersion()),
- $this->greaterThan(0),
- 'Line:'.__LINE__.' The getVersion method should return something without error.'
- );
+ $this->assertThat(strlen(self::$driver->getVersion()), $this->greaterThan(0),
+ 'Line:' . __LINE__ . ' The getVersion method should return something without error.');
}
/**
@@ -300,17 +228,13 @@ public function testInsertid()
*/
public function testLoadAssoc()
{
- $query = $this->object->getQuery(true);
+ $query = self::$driver->getQuery(true);
$query->select('title');
$query->from('jos_dbtest');
- $this->object->setQuery($query);
- $result = $this->object->loadAssoc();
+ self::$driver->setQuery($query);
+ $result = self::$driver->loadAssoc();
- $this->assertThat(
- $result,
- $this->equalTo(array('title' => 'Testing')),
- __LINE__
- );
+ $this->assertThat($result, $this->equalTo(array('title' => 'Testing')), __LINE__);
}
/**
@@ -322,22 +246,15 @@ public function testLoadAssoc()
*/
public function testLoadAssocList()
{
- $query = $this->object->getQuery(true);
+ $query = self::$driver->getQuery(true);
$query->select('title');
$query->from('jos_dbtest');
- $this->object->setQuery($query);
- $result = $this->object->loadAssocList();
-
- $this->assertThat(
- $result,
- $this->equalTo(array(
- array('title' => 'Testing'),
- array('title' => 'Testing2'),
- array('title' => 'Testing3'),
- array('title' => 'Testing4'),
- )),
- __LINE__
- );
+ self::$driver->setQuery($query);
+ $result = self::$driver->loadAssocList();
+
+ $this->assertThat($result,
+ $this->equalTo(
+ array(array('title' => 'Testing'), array('title' => 'Testing2'), array('title' => 'Testing3'), array('title' => 'Testing4'))), __LINE__);
}
/**
@@ -349,17 +266,13 @@ public function testLoadAssocList()
*/
public function testLoadColumn()
{
- $query = $this->object->getQuery(true);
+ $query = self::$driver->getQuery(true);
$query->select('title');
$query->from('jos_dbtest');
- $this->object->setQuery($query);
- $result = $this->object->loadColumn();
+ self::$driver->setQuery($query);
+ $result = self::$driver->loadColumn();
- $this->assertThat(
- $result,
- $this->equalTo(array('Testing', 'Testing2', 'Testing3', 'Testing4')),
- __LINE__
- );
+ $this->assertThat($result, $this->equalTo(array('Testing', 'Testing2', 'Testing3', 'Testing4')), __LINE__);
}
/**
@@ -389,24 +302,20 @@ public function testLoadNextRow()
*/
public function testLoadObject()
{
- $query = $this->object->getQuery(true);
+ $query = self::$driver->getQuery(true);
$query->select('*');
$query->from('jos_dbtest');
- $query->where('description='.$this->object->quote('three'));
- $this->object->setQuery($query);
- $result = $this->object->loadObject();
+ $query->where('description=' . self::$driver->quote('three'));
+ self::$driver->setQuery($query);
+ $result = self::$driver->loadObject();
- $objCompare = new stdClass;
+ $objCompare = new stdClass();
$objCompare->id = 3;
$objCompare->title = 'Testing3';
$objCompare->start_date = '1980-04-18 00:00:00';
$objCompare->description = 'three';
- $this->assertThat(
- $result,
- $this->equalTo($objCompare),
- __LINE__
- );
+ $this->assertThat($result, $this->equalTo($objCompare), __LINE__);
}
/**
@@ -418,16 +327,16 @@ public function testLoadObject()
*/
public function testLoadObjectList()
{
- $query = $this->object->getQuery(true);
+ $query = self::$driver->getQuery(true);
$query->select('*');
$query->from('jos_dbtest');
$query->order('id');
- $this->object->setQuery($query);
- $result = $this->object->loadObjectList();
+ self::$driver->setQuery($query);
+ $result = self::$driver->loadObjectList();
$expected = array();
- $objCompare = new stdClass;
+ $objCompare = new stdClass();
$objCompare->id = 1;
$objCompare->title = 'Testing';
$objCompare->start_date = '1980-04-18 00:00:00';
@@ -435,7 +344,7 @@ public function testLoadObjectList()
$expected[] = clone $objCompare;
- $objCompare = new stdClass;
+ $objCompare = new stdClass();
$objCompare->id = 2;
$objCompare->title = 'Testing2';
$objCompare->start_date = '1980-04-18 00:00:00';
@@ -443,7 +352,7 @@ public function testLoadObjectList()
$expected[] = clone $objCompare;
- $objCompare = new stdClass;
+ $objCompare = new stdClass();
$objCompare->id = 3;
$objCompare->title = 'Testing3';
$objCompare->start_date = '1980-04-18 00:00:00';
@@ -451,7 +360,7 @@ public function testLoadObjectList()
$expected[] = clone $objCompare;
- $objCompare = new stdClass;
+ $objCompare = new stdClass();
$objCompare->id = 4;
$objCompare->title = 'Testing4';
$objCompare->start_date = '1980-04-18 00:00:00';
@@ -459,11 +368,7 @@ public function testLoadObjectList()
$expected[] = clone $objCompare;
- $this->assertThat(
- $result,
- $this->equalTo($expected),
- __LINE__
- );
+ $this->assertThat($result, $this->equalTo($expected), __LINE__);
}
/**
@@ -475,19 +380,15 @@ public function testLoadObjectList()
*/
public function testLoadResult()
{
- $query = $this->object->getQuery(true);
+ $query = self::$driver->getQuery(true);
$query->select('id');
$query->from('jos_dbtest');
- $query->where('title='.$this->object->quote('Testing2'));
+ $query->where('title=' . self::$driver->quote('Testing2'));
- $this->object->setQuery($query);
- $result = $this->object->loadResult();
+ self::$driver->setQuery($query);
+ $result = self::$driver->loadResult();
- $this->assertThat(
- $result,
- $this->equalTo(2),
- __LINE__
- );
+ $this->assertThat($result, $this->equalTo(2), __LINE__);
}
@@ -500,20 +401,16 @@ public function testLoadResult()
*/
public function testLoadRow()
{
- $query = $this->object->getQuery(true);
+ $query = self::$driver->getQuery(true);
$query->select('*');
$query->from('jos_dbtest');
- $query->where('description='.$this->object->quote('three'));
- $this->object->setQuery($query);
- $result = $this->object->loadRow();
+ $query->where('description=' . self::$driver->quote('three'));
+ self::$driver->setQuery($query);
+ $result = self::$driver->loadRow();
$expected = array(3, 'Testing3', '1980-04-18 00:00:00', 'three');
- $this->assertThat(
- $result,
- $this->equalTo($expected),
- __LINE__
- );
+ $this->assertThat($result, $this->equalTo($expected), __LINE__);
}
/**
@@ -525,23 +422,16 @@ public function testLoadRow()
*/
public function testLoadRowList()
{
- $query = $this->object->getQuery(true);
+ $query = self::$driver->getQuery(true);
$query->select('*');
$query->from('jos_dbtest');
- $query->where('description='.$this->object->quote('one'));
- $this->object->setQuery($query);
- $result = $this->object->loadRowList();
+ $query->where('description=' . self::$driver->quote('one'));
+ self::$driver->setQuery($query);
+ $result = self::$driver->loadRowList();
- $expected = array(
- array(1, 'Testing', '1980-04-18 00:00:00', 'one'),
- array(2, 'Testing2', '1980-04-18 00:00:00', 'one')
- );
+ $expected = array(array(1, 'Testing', '1980-04-18 00:00:00', 'one'), array(2, 'Testing2', '1980-04-18 00:00:00', 'one'));
- $this->assertThat(
- $result,
- $this->equalTo($expected),
- __LINE__
- );
+ $this->assertThat($result, $this->equalTo($expected), __LINE__);
}
/**
@@ -553,19 +443,11 @@ public function testLoadRowList()
*/
public function testQuery()
{
- $this->object->setQuery("REPLACE INTO `jos_dbtest` SET `id` = 5, `title` = 'testTitle'");
+ self::$driver->setQuery("REPLACE INTO `jos_dbtest` SET `id` = 5, `title` = 'testTitle'");
- $this->assertThat(
- $this->object->execute(),
- $this->isTrue(),
- __LINE__
- );
+ $this->assertThat(self::$driver->execute(), $this->isTrue(), __LINE__);
- $this->assertThat(
- $this->object->insertid(),
- $this->equalTo(5),
- __LINE__
- );
+ $this->assertThat(self::$driver->insertid(), $this->equalTo(5), __LINE__);
}
@@ -593,11 +475,7 @@ public function testSetUTF()
*/
public function testIsSupported()
{
- $this->assertThat(
- JDatabaseMysql::isSupported(),
- $this->isTrue(),
- __LINE__
- );
+ $this->assertThat(JDatabaseDriverMysql::isSupported(), $this->isTrue(), __LINE__);
}
/**
View
0 ...omla/database/database/stubs/database.xml → .../database/driver/mysql/stubs/database.xml
File renamed without changes.
View
258 ...database/database/JDatabaseMySQLiTest.php → ...ase/driver/mysqli/JDatabaseMySQLiTest.php
@@ -7,26 +7,15 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/
-require_once JPATH_PLATFORM.'/joomla/log/log.php';
-require_once JPATH_PLATFORM.'/joomla/database/database.php';
-require_once JPATH_PLATFORM.'/joomla/database/database/mysqli.php';
-require_once JPATH_PLATFORM.'/joomla/database/query.php';
-require_once JPATH_PLATFORM.'/joomla/database/query/mysqli.php';
-
/**
* Test class for JDatabaseMySQL.
*
* @package Joomla.UnitTest
* @subpackage Database
*/
-class JDatabaseMysqliTest extends TestCaseDatabase
+class JDatabaseMysqliTest extends TestCaseDatabaseMysqli
{
/**
- * @var JDatabaseDriverMysqli
- */
- protected $object;
-
- /**
* Data for the testEscape test.
*
* @return array
@@ -37,7 +26,7 @@ public function dataTestEscape()
{
return array(
array("'%_abc123", false, '\\\'%_abc123'),
- array("'%_abc123", true, '\\\'\\%\_abc123'),
+ array("'%_abc123", true, '\\\'\\%\_abc123')
);
}
@@ -50,36 +39,7 @@ public function dataTestEscape()
*/
protected function getDataSet()
{
- return $this->createXMLDataSet(__DIR__.'/stubs/database.xml');
- }
-
- /**
- * Sets up the fixture, for example, opens a network connection.
- * This method is called before a test is executed.
- *
- * @return void
- *
- * @since 11.4
- */
- protected function setUp()
- {
- @include_once JPATH_TESTS . '/config_mysqli.php';
- if (class_exists('JMySQLiTestConfig')) {
- $config = new JMySQLiTestConfig;
- } else {
- $this->markTestSkipped('There is no Mysqli test config file present.');
- }
- $this->object = JDatabase::getInstance(
- array(
- 'driver' => $config->dbtype,
- 'database' => $config->db,
- 'host' => $config->host,
- 'user' => $config->user,
- 'password' => $config->password
- )
- );
-
- parent::setUp();
+ return $this->createXMLDataSet(__DIR__ . '/stubs/database.xml');
}
/**
@@ -109,11 +69,7 @@ public function testConnected()
*/
public function testDropTable()
{
- $this->assertThat(
- $this->object->dropTable('#__bar', true),
- $this->isInstanceOf('JDatabaseDriverMysqli'),
- 'The table is dropped if present.'
- );
+ $this->assertThat(self::$driver->dropTable('#__bar', true), $this->isInstanceOf('JDatabaseDriverMysqli'), 'The table is dropped if present.');
}
/**
@@ -129,11 +85,7 @@ public function testDropTable()
*/
public function testEscape($text, $extra, $result)
{
- $this->assertThat(
- $this->object->escape($text, $extra),
- $this->equalTo($result),
- 'The string was not escaped properly'
- );
+ $this->assertThat(self::$driver->escape($text, $extra), $this->equalTo($result), 'The string was not escaped properly');
}
/**
@@ -145,18 +97,14 @@ public function testEscape($text, $extra, $result)
*/
public function testGetAffectedRows()
{
- $query = $this->object->getQuery(true);
+ $query = self::$driver->getQuery(true);
$query->delete();
$query->from('jos_dbtest');
- $this->object->setQuery($query);
+ self::$driver->setQuery($query);
- $result = $this->object->execute();
+ $result = self::$driver->execute();
- $this->assertThat(
- $this->object->getAffectedRows(),
- $this->equalTo(4),
- __LINE__
- );
+ $this->assertThat(self::$driver->getAffectedRows(), $this->equalTo(4), __LINE__);
}
/**
@@ -168,11 +116,8 @@ public function testGetAffectedRows()
*/
public function testGetExporter()
{
- $this->assertThat(
- $this->object->getExporter(),
- $this->isInstanceOf('JDatabaseExporterMysqli'),
- 'Line:'.__LINE__.' The getExporter method should return the correct exporter.'
- );
+ $this->assertThat(self::$driver->getExporter(), $this->isInstanceOf('JDatabaseExporterMysqli'),
+ 'Line:' . __LINE__ . ' The getExporter method should return the correct exporter.');
}
/**
@@ -184,11 +129,8 @@ public function testGetExporter()
*/
public function testGetImporter()
{
- $this->assertThat(
- $this->object->getImporter(),
- $this->isInstanceOf('JDatabaseImporterMysqli'),
- 'Line:'.__LINE__.' The getImporter method should return the correct importer.'
- );
+ $this->assertThat(self::$driver->getImporter(), $this->isInstanceOf('JDatabaseImporterMysqli'),
+ 'Line:' . __LINE__ . ' The getImporter method should return the correct importer.');
}
/**
@@ -209,11 +151,8 @@ public function testGetNumRows()
*/
public function testGetTableCreate()
{
- $this->assertThat(
- $this->object->getTableCreate('#__dbtest'),
- $this->isType('array'),
- 'The statement to create the table is returned in an array.'
- );
+ $this->assertThat(self::$driver->getTableCreate('#__dbtest'), $this->isType('array'),
+ 'The statement to create the table is returned in an array.');
}
/**
@@ -225,11 +164,7 @@ public function testGetTableCreate()
*/
public function testGetTableKeys()
{
- $this->assertThat(
- $this->object->getTableKeys('#__dbtest'),
- $this->isType('array'),
- 'The list of keys for the table is returned in an array.'
- );
+ $this->assertThat(self::$driver->getTableKeys('#__dbtest'), $this->isType('array'), 'The list of keys for the table is returned in an array.');
}
/**
@@ -241,11 +176,7 @@ public function testGetTableKeys()
*/
public function testGetTableList()
{
- $this->assertThat(
- $this->object->getTableList(),
- $this->isType('array'),
- 'The list of tables for the database is returned in an array.'
- );
+ $this->assertThat(self::$driver->getTableList(), $this->isType('array'), 'The list of tables for the database is returned in an array.');
}
/**
@@ -257,11 +188,8 @@ public function testGetTableList()
*/
public function testGetVersion()
{
- $this->assertThat(
- strlen($this->object->getVersion()),
- $this->greaterThan(0),
- 'Line:'.__LINE__.' The getVersion method should return something without error.'
- );
+ $this->assertThat(strlen(self::$driver->getVersion()), $this->greaterThan(0),
+ 'Line:' . __LINE__ . ' The getVersion method should return something without error.');
}
/**
@@ -291,17 +219,13 @@ public function testInsertObject()
*/
public function testLoadAssoc()
{
- $query = $this->object->getQuery(true);
+ $query = self::$driver->getQuery(true);
$query->select('title');
$query->from('jos_dbtest');
- $this->object->setQuery($query);
- $result = $this->object->loadAssoc();
+ self::$driver->setQuery($query);
+ $result = self::$driver->loadAssoc();
- $this->assertThat(
- $result,
- $this->equalTo(array('title' => 'Testing')),
- __LINE__
- );
+ $this->assertThat($result, $this->equalTo(array('title' => 'Testing')), __LINE__);
}
/**
@@ -313,22 +237,15 @@ public function testLoadAssoc()
*/
public function testLoadAssocList()
{
- $query = $this->object->getQuery(true);
+ $query = self::$driver->getQuery(true);
$query->select('title');
$query->from('jos_dbtest');
- $this->object->setQuery($query);
- $result = $this->object->loadAssocList();
-
- $this->assertThat(
- $result,
- $this->equalTo(array(
- array('title' => 'Testing'),
- array('title' => 'Testing2'),
- array('title' => 'Testing3'),
- array('title' => 'Testing4'),
- )),
- __LINE__
- );
+ self::$driver->setQuery($query);
+ $result = self::$driver->loadAssocList();
+
+ $this->assertThat($result,
+ $this->equalTo(
+ array(array('title' => 'Testing'), array('title' => 'Testing2'), array('title' => 'Testing3'), array('title' => 'Testing4'))), __LINE__);
}
/**
@@ -340,17 +257,13 @@ public function testLoadAssocList()
*/
public function testLoadColumn()
{
- $query = $this->object->getQuery(true);
+ $query = self::$driver->getQuery(true);
$query->select('title');
$query->from('jos_dbtest');
- $this->object->setQuery($query);
- $result = $this->object->loadColumn();
+ self::$driver->setQuery($query);
+ $result = self::$driver->loadColumn();
- $this->assertThat(
- $result,
- $this->equalTo(array('Testing', 'Testing2', 'Testing3', 'Testing4')),
- __LINE__
- );
+ $this->assertThat($result, $this->equalTo(array('Testing', 'Testing2', 'Testing3', 'Testing4')), __LINE__);
}
/**
@@ -380,24 +293,20 @@ public function testLoadNextRow()
*/
public function testLoadObject()
{
- $query = $this->object->getQuery(true);
+ $query = self::$driver->getQuery(true);
$query->select('*');
$query->from('jos_dbtest');
- $query->where('description='.$this->object->quote('three'));
- $this->object->setQuery($query);
- $result = $this->object->loadObject();
+ $query->where('description=' . self::$driver->quote('three'));
+ self::$driver->setQuery($query);
+ $result = self::$driver->loadObject();
- $objCompare = new stdClass;
+ $objCompare = new stdClass();
$objCompare->id = 3;
$objCompare->title = 'Testing3';
$objCompare->start_date = '1980-04-18 00:00:00';
$objCompare->description = 'three';
- $this->assertThat(
- $result,
- $this->equalTo($objCompare),
- __LINE__
- );
+ $this->assertThat($result, $this->equalTo($objCompare), __LINE__);
}
/**
@@ -409,16 +318,16 @@ public function testLoadObject()
*/
public function testLoadObjectList()
{
- $query = $this->object->getQuery(true);
+ $query = self::$driver->getQuery(true);
$query->select('*');
$query->from('jos_dbtest');
$query->order('id');
- $this->object->setQuery($query);
- $result = $this->object->loadObjectList();
+ self::$driver->setQuery($query);
+ $result = self::$driver->loadObjectList();
$expected = array();
- $objCompare = new stdClass;
+ $objCompare = new stdClass();
$objCompare->id = 1;
$objCompare->title = 'Testing';
$objCompare->start_date = '1980-04-18 00:00:00';
@@ -426,7 +335,7 @@ public function testLoadObjectList()
$expected[] = clone $objCompare;
- $objCompare = new stdClass;
+ $objCompare = new stdClass();
$objCompare->id = 2;
$objCompare->title = 'Testing2';
$objCompare->start_date = '1980-04-18 00:00:00';
@@ -434,7 +343,7 @@ public function testLoadObjectList()
$expected[] = clone $objCompare;
- $objCompare = new stdClass;
+ $objCompare = new stdClass();
$objCompare->id = 3;
$objCompare->title = 'Testing3';
$objCompare->start_date = '1980-04-18 00:00:00';
@@ -442,7 +351,7 @@ public function testLoadObjectList()
$expected[] = clone $objCompare;
- $objCompare = new stdClass;
+ $objCompare = new stdClass();
$objCompare->id = 4;
$objCompare->title = 'Testing4';
$objCompare->start_date = '1980-04-18 00:00:00';
@@ -450,11 +359,7 @@ public function testLoadObjectList()
$expected[] = clone $objCompare;
- $this->assertThat(
- $result,
- $this->equalTo($expected),
- __LINE__
- );
+ $this->assertThat($result, $this->equalTo($expected), __LINE__);
}
/**
@@ -466,19 +371,15 @@ public function testLoadObjectList()
*/
public function testLoadResult()
{
- $query = $this->object->getQuery(true);
+ $query = self::$driver->getQuery(true);
$query->select('id');
$query->from('jos_dbtest');
- $query->where('title='.$this->object->quote('Testing2'));
+ $query->where('title=' . self::$driver->quote('Testing2'));
- $this->object->setQuery($query);
- $result = $this->object->loadResult();
+ self::$driver->setQuery($query);
+ $result = self::$driver->loadResult();
- $this->assertThat(
- $result,
- $this->equalTo(2),
- __LINE__
- );
+ $this->assertThat($result, $this->equalTo(2), __LINE__);
}
@@ -491,20 +392,16 @@ public function testLoadResult()
*/
public function testLoadRow()
{
- $query = $this->object->getQuery(true);
+ $query = self::$driver->getQuery(true);
$query->select('*');
$query->from('jos_dbtest');
- $query->where('description='.$this->object->quote('three'));
- $this->object->setQuery($query);
- $result = $this->object->loadRow();
+ $query->where('description=' . self::$driver->quote('three'));
+ self::$driver->setQuery($query);
+ $result = self::$driver->loadRow();
$expected = array(3, 'Testing3', '1980-04-18 00:00:00', 'three');
- $this->assertThat(
- $result,
- $this->equalTo($expected),
- __LINE__
- );
+ $this->assertThat($result, $this->equalTo($expected), __LINE__);
}
/**
@@ -516,23 +413,16 @@ public function testLoadRow()
*/
public function testLoadRowList()
{
- $query = $this->object->getQuery(true);
+ $query = self::$driver->getQuery(true);
$query->select('*');
$query->from('jos_dbtest');
- $query->where('description='.$this->object->quote('one'));
- $this->object->setQuery($query);
- $result = $this->object->loadRowList();
+ $query->where('description=' . self::$driver->quote('one'));
+ self::$driver->setQuery($query);
+ $result = self::$driver->loadRowList();
- $expected = array(
- array(1, 'Testing', '1980-04-18 00:00:00', 'one'),
- array(2, 'Testing2', '1980-04-18 00:00:00', 'one')
- );
+ $expected = array(array(1, 'Testing', '1980-04-18 00:00:00', 'one'), array(2, 'Testing2', '1980-04-18 00:00:00', 'one'));
- $this->assertThat(
- $result,
- $this->equalTo($expected),
- __LINE__
- );
+ $this->assertThat($result, $this->equalTo($expected), __LINE__);
}
/**
@@ -544,19 +434,11 @@ public function testLoadRowList()
*/
public function testQuery()
{
- $this->object->setQuery("REPLACE INTO `jos_dbtest` SET `id` = 5, `title` = 'testTitle'");
+ self::$driver->setQuery("REPLACE INTO `jos_dbtest` SET `id` = 5, `title` = 'testTitle'");
- $this->assertThat(
- $this->object->execute(),
- $this->isTrue(),
- __LINE__
- );
+ $this->assertThat(self::$driver->execute(), $this->isTrue(), __LINE__);
- $this->assertThat(
- $this->object->insertid(),
- $this->equalTo(5),
- __LINE__
- );
+ $this->assertThat(self::$driver->insertid(), $this->equalTo(5), __LINE__);
}
@@ -584,11 +466,7 @@ public function testSetUTF()
*/
public function testIsSupported()
{
- $this->assertThat(
- JDatabaseDriverMysqli::isSupported(),
- $this->isTrue(),
- __LINE__
- );
+ $this->assertThat(JDatabaseDriverMysqli::isSupported(), $this->isTrue(), __LINE__);
}
/**
View
33 tests/suites/database/driver/mysqli/stubs/database.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="jos_dbtest">
+ <column>id</column>
+ <column>title</column>
+ <column>start_date</column>
+ <column>description</column>
+ <row>
+ <value>1</value>
+ <value>Testing</value>
+ <value>1980-04-18 00:00:00</value>
+ <value>one</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>Testing2</value>
+ <value>1980-04-18 00:00:00</value>
+ <value>one</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>Testing3</value>
+ <value>1980-04-18 00:00:00</value>
+ <value>three</value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>Testing4</value>
+ <value>1980-04-18 00:00:00</value>
+ <value>four</value>
+ </row>
+ </table>
+</dataset>
View
506 tests/suites/database/stubs/mysql.sql
@@ -1,504 +1,30 @@
--- phpMyAdmin SQL Dump
--- version 3.3.7deb5build0.10.10.1
--- http://www.phpmyadmin.net
---
--- Host: localhost
--- Generation Time: Apr 15, 2011 at 12:52 AM
--- Server version: 5.1.49
--- PHP Version: 5.3.3-1ubuntu9.3
-
-SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
-
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
---
--- Database: `joomla_ut`
---
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_assets`
---
-
-CREATE TABLE IF NOT EXISTS `jos_assets` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary Key',
- `parent_id` int(11) NOT NULL DEFAULT '0' COMMENT 'Nested set parent.',
- `lft` int(11) NOT NULL DEFAULT '0' COMMENT 'Nested set lft.',
- `rgt` int(11) NOT NULL DEFAULT '0' COMMENT 'Nested set rgt.',
- `level` int(10) unsigned NOT NULL COMMENT 'The cached level in the nested tree.',
- `name` varchar(50) NOT NULL COMMENT 'The unique name for the asset.\n',
- `title` varchar(100) NOT NULL COMMENT 'The descriptive title for the asset.',
- `rules` varchar(5120) NOT NULL COMMENT 'JSON encoded access control.',
- PRIMARY KEY (`id`),
- UNIQUE KEY `idx_asset_name` (`name`),
- KEY `idx_lft_rgt` (`lft`,`rgt`),
- KEY `idx_parent_id` (`parent_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--- --------------------------------------------------------
+# Dump of table jos_dbtest
+# ------------------------------------------------------------
---
--- Table structure for table `jos_categories`
---
+DROP TABLE IF EXISTS `jos_dbtest`;
-CREATE TABLE IF NOT EXISTS `jos_categories` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `asset_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'FK to the #__assets table.',
- `parent_id` int(10) unsigned NOT NULL DEFAULT '0',
- `lft` int(11) NOT NULL DEFAULT '0',
- `rgt` int(11) NOT NULL DEFAULT '0',
- `level` int(10) unsigned NOT NULL DEFAULT '0',
- `path` varchar(255) NOT NULL DEFAULT '',
- `extension` varchar(50) NOT NULL DEFAULT '',
- `title` varchar(255) NOT NULL,
- `alias` varchar(255) NOT NULL DEFAULT '',
- `note` varchar(255) NOT NULL DEFAULT '',
- `description` varchar(5120) NOT NULL DEFAULT '',
- `published` tinyint(1) NOT NULL DEFAULT '0',
- `checked_out` int(11) unsigned NOT NULL DEFAULT '0',
- `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `access` tinyint(3) unsigned NOT NULL DEFAULT '0',
- `params` text NOT NULL,
- `metadesc` varchar(1024) NOT NULL COMMENT 'The meta description for the page.',
- `metakey` varchar(1024) NOT NULL COMMENT 'The meta keywords for the page.',
- `metadata` varchar(2048) NOT NULL COMMENT 'JSON encoded metadata properties.',
- `created_user_id` int(10) unsigned NOT NULL DEFAULT '0',
- `created_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `modified_user_id` int(10) unsigned NOT NULL DEFAULT '0',
- `modified_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `hits` int(10) unsigned NOT NULL DEFAULT '0',
- `language` char(7) NOT NULL,
- PRIMARY KEY (`id`),
- KEY `cat_idx` (`extension`,`published`,`access`),
- KEY `idx_access` (`access`),
- KEY `idx_checkout` (`checked_out`),
- KEY `idx_path` (`path`),
- KEY `idx_left_right` (`lft`,`rgt`),
- KEY `idx_alias` (`alias`),
- KEY `idx_language` (`language`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_content`
---
-
-CREATE TABLE IF NOT EXISTS `jos_content` (
+CREATE TABLE `jos_dbtest` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `asset_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'FK to the #__assets table.',
- `title` varchar(255) NOT NULL DEFAULT '',
- `alias` varchar(255) NOT NULL DEFAULT '',
- `title_alias` varchar(255) NOT NULL DEFAULT '',
- `introtext` mediumtext NOT NULL,
- `fulltext` mediumtext NOT NULL,
- `state` tinyint(3) NOT NULL DEFAULT '0',
- `sectionid` int(10) unsigned NOT NULL DEFAULT '0',
- `mask` int(10) unsigned NOT NULL DEFAULT '0',
- `catid` int(10) unsigned NOT NULL DEFAULT '0',
- `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `created_by` int(10) unsigned NOT NULL DEFAULT '0',
- `created_by_alias` varchar(255) NOT NULL DEFAULT '',
- `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `modified_by` int(10) unsigned NOT NULL DEFAULT '0',
- `checked_out` int(10) unsigned NOT NULL DEFAULT '0',
- `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `publish_up` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `publish_down` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `images` text NOT NULL,
- `urls` text NOT NULL,
- `attribs` varchar(5120) NOT NULL,
- `version` int(10) unsigned NOT NULL DEFAULT '1',
- `parentid` int(10) unsigned NOT NULL DEFAULT '0',
- `ordering` int(11) NOT NULL DEFAULT '0',
- `metakey` text NOT NULL,
- `metadesc` text NOT NULL,
- `access` int(10) unsigned NOT NULL DEFAULT '0',
- `hits` int(10) unsigned NOT NULL DEFAULT '0',
- `metadata` text NOT NULL,
- `featured` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Set if article is featured.',
- `language` char(7) NOT NULL COMMENT 'The language code for the article.',
- `xreference` varchar(50) NOT NULL COMMENT 'A reference to enable linkages to external data sets.',
- PRIMARY KEY (`id`),
- KEY `idx_access` (`access`),
- KEY `idx_checkout` (`checked_out`),
- KEY `idx_state` (`state`),
- KEY `idx_catid` (`catid`),
- KEY `idx_createdby` (`created_by`),
- KEY `idx_featured_catid` (`featured`,`catid`),
- KEY `idx_language` (`language`),
- KEY `idx_xreference` (`xreference`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_core_log_searches`
---
-
-CREATE TABLE IF NOT EXISTS `jos_core_log_searches` (
- `search_term` varchar(128) NOT NULL DEFAULT '',
- `hits` int(10) unsigned NOT NULL DEFAULT '0'
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_extensions`
---
-
-CREATE TABLE IF NOT EXISTS `jos_extensions` (
- `extension_id` int(11) NOT NULL AUTO_INCREMENT,
- `name` varchar(100) NOT NULL,
- `type` varchar(20) NOT NULL,
- `element` varchar(100) NOT NULL,
- `folder` varchar(100) NOT NULL,
- `client_id` tinyint(3) NOT NULL,
- `enabled` tinyint(3) NOT NULL DEFAULT '1',
- `access` tinyint(3) unsigned NOT NULL DEFAULT '1',
- `protected` tinyint(3) NOT NULL DEFAULT '0',
- `manifest_cache` text NOT NULL,
- `params` text NOT NULL,
- `custom_data` text NOT NULL,
- `system_data` text NOT NULL,
- `checked_out` int(10) unsigned NOT NULL DEFAULT '0',
- `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `ordering` int(11) DEFAULT '0',
- `state` int(11) DEFAULT '0',
- PRIMARY KEY (`extension_id`),
- KEY `element_clientid` (`element`,`client_id`),
- KEY `element_folder_clientid` (`element`,`folder`,`client_id`),
- KEY `extension` (`type`,`element`,`folder`,`client_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_languages`
---
-
-CREATE TABLE IF NOT EXISTS `jos_languages` (
- `lang_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `lang_code` char(7) NOT NULL,
`title` varchar(50) NOT NULL,
- `title_native` varchar(50) NOT NULL,
- `sef` varchar(50) NOT NULL,
- `image` varchar(50) NOT NULL,
- `description` varchar(512) NOT NULL,
- `metakey` text NOT NULL,
- `metadesc` text NOT NULL,
- `published` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`lang_id`),
- UNIQUE KEY `idx_sef` (`sef`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_log_entries`
---
-
-CREATE TABLE IF NOT EXISTS `jos_log_entries` (
- `priority` int(11) DEFAULT NULL,
- `message` varchar(512) DEFAULT NULL,
- `date` datetime DEFAULT NULL,
- `category` varchar(255) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_menu`
---
-
-CREATE TABLE IF NOT EXISTS `jos_menu` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `menutype` varchar(24) NOT NULL COMMENT 'The type of menu this item belongs to. FK to #__menu_types.menutype',
- `title` varchar(255) NOT NULL COMMENT 'The display title of the menu item.',
- `alias` varchar(255) NOT NULL COMMENT 'The SEF alias of the menu item.',
- `note` varchar(255) NOT NULL DEFAULT '',
- `path` varchar(1024) NOT NULL COMMENT 'The computed path of the menu item based on the alias field.',
- `link` varchar(1024) NOT NULL COMMENT 'The actually link the menu item refers to.',
- `type` varchar(16) NOT NULL COMMENT 'The type of link: Component, URL, Alias, Separator',
- `published` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'The published state of the menu link.',
- `parent_id` int(10) unsigned NOT NULL DEFAULT '1' COMMENT 'The parent menu item in the menu tree.',
- `level` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'The relative level in the tree.',
- `component_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'FK to #__extensions.id',
- `ordering` int(11) NOT NULL DEFAULT '0' COMMENT 'The relative ordering of the menu item in the tree.',
- `checked_out` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'FK to #__users.id',
- `checked_out_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'The time the menu item was checked out.',
- `browserNav` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'The click behaviour of the link.',
- `access` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'The access level required to view the menu item.',
- `img` varchar(255) NOT NULL COMMENT 'The image of the menu item.',
- `template_style_id` int(10) unsigned NOT NULL DEFAULT '0',
- `params` text NOT NULL COMMENT 'JSON encoded data for the menu item.',
- `lft` int(11) NOT NULL DEFAULT '0' COMMENT 'Nested set lft.',
- `rgt` int(11) NOT NULL DEFAULT '0' COMMENT 'Nested set rgt.',
- `home` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Indicates if this menu item is the home or default page.',
- `language` char(7) NOT NULL DEFAULT '',
- `client_id` tinyint(4) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- UNIQUE KEY `idx_client_id_parent_id_alias` (`client_id`,`parent_id`,`alias`),
- KEY `idx_componentid` (`component_id`,`menutype`,`published`,`access`),
- KEY `idx_menutype` (`menutype`),
- KEY `idx_left_right` (`lft`,`rgt`),
- KEY `idx_alias` (`alias`),
- KEY `idx_path` (`path`(333)),
- KEY `idx_language` (`language`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_menu_types`
---
-
-CREATE TABLE IF NOT EXISTS `jos_menu_types` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `menutype` varchar(24) NOT NULL,
- `title` varchar(48) NOT NULL,
- `description` varchar(255) NOT NULL DEFAULT '',
- PRIMARY KEY (`id`),
- UNIQUE KEY `idx_menutype` (`menutype`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_modules`
---
-
-CREATE TABLE IF NOT EXISTS `jos_modules` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `title` varchar(100) NOT NULL DEFAULT '',
- `note` varchar(255) NOT NULL DEFAULT '',
- `content` text NOT NULL,
- `ordering` int(11) NOT NULL DEFAULT '0',
- `position` varchar(50) DEFAULT NULL,
- `checked_out` int(10) unsigned NOT NULL DEFAULT '0',
- `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `publish_up` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `publish_down` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `published` tinyint(1) NOT NULL DEFAULT '0',
- `module` varchar(50) DEFAULT NULL,
- `access` tinyint(3) unsigned NOT NULL DEFAULT '0',
- `showtitle` tinyint(3) unsigned NOT NULL DEFAULT '1',
- `params` text NOT NULL,
- `client_id` tinyint(4) NOT NULL DEFAULT '0',
- `language` char(7) NOT NULL,
- PRIMARY KEY (`id`),
- KEY `published` (`published`,`access`),
- KEY `newsfeeds` (`module`,`published`),
- KEY `idx_language` (`language`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_modules_menu`
---
-
-CREATE TABLE IF NOT EXISTS `jos_modules_menu` (
- `moduleid` int(11) NOT NULL DEFAULT '0',
- `menuid` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`moduleid`,`menuid`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_schemas`
---
-
-CREATE TABLE IF NOT EXISTS `jos_schemas` (
- `extension_id` int(11) NOT NULL,
- `version_id` varchar(20) NOT NULL,
- PRIMARY KEY (`extension_id`,`version_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_session`
---
-
-CREATE TABLE IF NOT EXISTS `jos_session` (
- `session_id` varchar(32) NOT NULL DEFAULT '',
- `client_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
- `guest` tinyint(4) unsigned DEFAULT '1',
- `time` varchar(14) DEFAULT '',
- `data` varchar(20480) DEFAULT NULL,
- `userid` int(11) DEFAULT '0',
- `username` varchar(150) DEFAULT '',
- `usertype` varchar(50) DEFAULT '',
- PRIMARY KEY (`session_id`),
- KEY `whosonline` (`guest`,`usertype`),
- KEY `userid` (`userid`),
- KEY `time` (`time`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_updates`
---
-
-CREATE TABLE IF NOT EXISTS `jos_updates` (
- `update_id` int(11) NOT NULL AUTO_INCREMENT,
- `update_site_id` int(11) DEFAULT '0',
- `extension_id` int(11) DEFAULT '0',
- `categoryid` int(11) DEFAULT '0',
- `name` varchar(100) DEFAULT '',
- `description` text NOT NULL,
- `element` varchar(100) DEFAULT '',
- `type` varchar(20) DEFAULT '',
- `folder` varchar(20) DEFAULT '',
- `client_id` tinyint(3) DEFAULT '0',
- `version` varchar(10) DEFAULT '',
- `data` text NOT NULL,
- `detailsurl` text NOT NULL,
- PRIMARY KEY (`update_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Available Updates';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_update_categories`
---
-
-CREATE TABLE IF NOT EXISTS `jos_update_categories` (
- `categoryid` int(11) NOT NULL AUTO_INCREMENT,
- `name` varchar(20) DEFAULT '',
+ `start_date` datetime NOT NULL,
`description` text NOT NULL,
- `parent` int(11) DEFAULT '0',
- `updatesite` int(11) DEFAULT '0',
- PRIMARY KEY (`categoryid`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Update Categories';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_update_sites`
---
-
-CREATE TABLE IF NOT EXISTS `jos_update_sites` (
- `update_site_id` int(11) NOT NULL AUTO_INCREMENT,
- `name` varchar(100) DEFAULT '',
- `type` varchar(20) DEFAULT '',
- `location` text NOT NULL,
- `enabled` int(11) DEFAULT '0',
- PRIMARY KEY (`update_site_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Update Sites';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_update_sites_extensions`
---
-
-CREATE TABLE IF NOT EXISTS `jos_update_sites_extensions` (
- `update_site_id` int(11) NOT NULL DEFAULT '0',
- `extension_id` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`update_site_id`,`extension_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Links extensions to update sites';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_usergroups`
---
-
-CREATE TABLE IF NOT EXISTS `jos_usergroups` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary Key',
- `parent_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Adjacency List Reference Id',
- `lft` int(11) NOT NULL DEFAULT '0' COMMENT 'Nested set lft.',
- `rgt` int(11) NOT NULL DEFAULT '0' COMMENT 'Nested set rgt.',
- `title` varchar(100) NOT NULL DEFAULT '',
- PRIMARY KEY (`id`),
- UNIQUE KEY `idx_usergroup_parent_title_lookup` (`parent_id`,`title`),
- KEY `idx_usergroup_title_lookup` (`title`),
- KEY `idx_usergroup_adjacency_lookup` (`parent_id`),
- KEY `idx_usergroup_nested_set_lookup` (`lft`,`rgt`) USING BTREE
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_users`
---
-
-CREATE TABLE IF NOT EXISTS `jos_users` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `name` varchar(255) NOT NULL DEFAULT '',
- `username` varchar(150) NOT NULL DEFAULT '',
- `email` varchar(100) NOT NULL DEFAULT '',
- `password` varchar(100) NOT NULL DEFAULT '',
- `usertype` varchar(25) NOT NULL DEFAULT '',
- `block` tinyint(4) NOT NULL DEFAULT '0',
- `sendEmail` tinyint(4) DEFAULT '0',
- `registerDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `lastvisitDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `activation` varchar(100) NOT NULL DEFAULT '',
- `params` text NOT NULL,
- PRIMARY KEY (`id`),
- KEY `usertype` (`usertype`),
- KEY `idx_name` (`name`),
- KEY `idx_block` (`block`),
- KEY `username` (`username`),
- KEY `email` (`email`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_user_profiles`
---
-
-CREATE TABLE IF NOT EXISTS `jos_user_profiles` (
- `user_id` int(11) NOT NULL,
- `profile_key` varchar(100) NOT NULL,
- `profile_value` varchar(255) NOT NULL,
- `ordering` int(11) NOT NULL DEFAULT '0',
- UNIQUE KEY `idx_user_id_profile_key` (`user_id`,`profile_key`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Simple user profile storage table';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_user_usergroup_map`
---
-
-CREATE TABLE IF NOT EXISTS `jos_user_usergroup_map` (
- `user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Foreign Key to #__users.id',
- `group_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Foreign Key to #__usergroups.id',
- PRIMARY KEY (`user_id`,`group_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jos_viewlevels`
---
-
-CREATE TABLE IF NOT EXISTS `jos_viewlevels` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary Key',
- `title` varchar(100) NOT NULL DEFAULT '',
- `ordering` int(11) NOT NULL DEFAULT '0',
- `rules` varchar(5120) NOT NULL COMMENT 'JSON encoded access control.',
- PRIMARY KEY (`id`),
- UNIQUE KEY `idx_assetgroup_title_lookup` (`title`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-CREATE TABLE IF NOT EXISTS `jos_dbtest` (
-`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
-`title` VARCHAR( 50 ) NOT NULL ,
-`start_date` DATETIME NOT NULL ,
-`description` TEXT NOT NULL
-) DEFAULT CHARSET=utf8;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
View
2 tests/suites/unit/joomla/database/database/JDatabaseExporterMySqlTest.php
@@ -38,7 +38,7 @@ public function setup()
// Set up the database object mock.
$this->dbo = $this->getMock(
- 'JDatabaseMysql',
+ 'JDatabaseDriverMysql',
array(
'getErrorNum',
'getPrefix',
View
2 tests/suites/unit/joomla/database/database/JDatabaseExporterMySqliTest.php
@@ -32,7 +32,7 @@ public function setup()
// Set up the database object mock.
$this->dbo = $this->getMock(
- 'JDatabaseMysqli',
+ 'JDatabaseDriverMysqli',
array(),
array(),
'',
View
2 tests/suites/unit/joomla/database/database/JDatabaseImporterMySqlTest.php
@@ -48,7 +48,7 @@ public function setup()
// Set up the database object mock.
$this->dbo = $this->getMock(
- 'JDatabaseMySql',
+ 'JDatabaseDriverMysql',
array(
'getErrorNum',
'getPrefix',
View
2 tests/suites/unit/joomla/database/database/JDatabaseImporterMySqliTest.php
@@ -32,7 +32,7 @@ public function setup()
// Set up the database object mock.
$this->dbo = $this->getMock(
- 'JDatabaseMysqli',
+ 'JDatabaseDriverMysqli',
array(),
array(),
'',

0 comments on commit ec1b698

Please sign in to comment.
Something went wrong with that request. Please try again.