forked from joomla/joomla-platform
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test classes for Postgresql's exporter.
- Loading branch information
Showing
2 changed files
with
750 additions
and
0 deletions.
There are no files selected for viewing
130 changes: 130 additions & 0 deletions
130
tests/suite/joomla/database/database/JDatabaseExporterPostgresqlInspector.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
<?php | ||
/** | ||
* @version $Id: JDatabaseExporterPostgreSQLInspector.php gpongelli $ | ||
* @package Joomla.UnitTest | ||
* | ||
* @copyright Copyright (C) 2005 - 2012 Open Source Matters. All rights reserved. | ||
* @license GNU General Public License | ||
*/ | ||
|
||
require_once JPATH_PLATFORM . '/joomla/database/exporter/postgresql.php'; | ||
|
||
/** | ||
* Class to expose protected properties and methods in JDatabasePostgresqlExporter for testing purposes | ||
* | ||
* @package Joomla.UnitTest | ||
* @subpackage Database | ||
* | ||
* @since 12.1 | ||
*/ | ||
class JDatabaseExporterPostgresqlInspector extends JDatabaseExporterPostgresql | ||
{ | ||
/** | ||
* Gets any property from the class. | ||
* | ||
* @param string $property The name of the class property. | ||
* | ||
* @return mixed The value of the class property. | ||
* | ||
* @since 12.1 | ||
*/ | ||
public function __get($property) | ||
{ | ||
return $this->$property; | ||
} | ||
|
||
/** | ||
* Exposes the protected buildXml method. | ||
* | ||
* @return string An XML string | ||
* | ||
* @throws Exception if an error occurs. | ||
* @since 12.1 | ||
*/ | ||
public function buildXml() | ||
{ | ||
return parent::buildXml(); | ||
} | ||
|
||
/** | ||
* Exposes the protected buildXmlStructure method. | ||
* | ||
* @return array An array of XML lines (strings). | ||
* | ||
* @throws Exception if an error occurs. | ||
* @since 12.1 | ||
*/ | ||
public function buildXmlStructure() | ||
{ | ||
return parent::buildXmlStructure(); | ||
} | ||
|
||
/** | ||
* Exposes the protected check method. | ||
* | ||
* @return void | ||
* | ||
* @since 12.1 | ||
*/ | ||
public function check() | ||
{ | ||
return parent::check(); | ||
} | ||
|
||
/** | ||
* Exposes the protected getColumns method. | ||
* | ||
* @param mixed $table The name of a table or an array of table names. | ||
* | ||
* @return array An array of column definitions. | ||
* | ||
* @since 12.1 | ||
*/ | ||
public function getColumns($table) | ||
{ | ||
return parent::getColumns($table); | ||
} | ||
|
||
/** | ||
* Exposes the protected getGenericTableName method. | ||
* | ||
* @param string $table The name of a table. | ||
* | ||
* @return string The name of the table with the database prefix replaced with #__. | ||
* | ||
* @since 12.1 | ||
*/ | ||
public function getGenericTableName($table) | ||
{ | ||
return parent::getGenericTableName($table); | ||
} | ||
|
||
/** | ||
* Exposes the protected getKeys method. | ||
* | ||
* @param mixed $table The name of a table or an array of table names. | ||
* | ||
* @return array An array of key definitions. | ||
* | ||
* @since 12.1 | ||
*/ | ||
public function getKeys($table) | ||
{ | ||
return parent::getKeys($table); | ||
} | ||
|
||
/** | ||
* Exposes the protected withStructure method. | ||
* | ||
* @param boolean $setting True to export the structure, false to not. | ||
* | ||
* @return void | ||
* | ||
* @since 12.1 | ||
*/ | ||
public function withStructure($setting = true) | ||
{ | ||
return parent::withStructure($setting); | ||
} | ||
|
||
} |
Oops, something went wrong.