Commit 52096a53 authored by Tyler Sommer's avatar Tyler Sommer

Renamed AbstractAsset#isQuoted to #isIdentifierQuoted. Added new public method...

Renamed AbstractAsset#isQuoted to #isIdentifierQuoted. Added new public method isQuoted that returns AbstractAsset
parent 11a2244d
...@@ -58,7 +58,7 @@ abstract class AbstractAsset ...@@ -58,7 +58,7 @@ abstract class AbstractAsset
*/ */
protected function _setName($name) protected function _setName($name)
{ {
if ($this->isQuoted($name)) { if ($this->isIdentifierQuoted($name)) {
$this->_quoted = true; $this->_quoted = true;
$name = $this->trimQuotes($name); $name = $this->trimQuotes($name);
} }
...@@ -129,13 +129,23 @@ abstract class AbstractAsset ...@@ -129,13 +129,23 @@ abstract class AbstractAsset
return strtolower($name); return strtolower($name);
} }
/**
* Check if this asset's name is quoted
*
* @return bool
*/
public function isQuoted()
{
return $this->_quoted;
}
/** /**
* Check if this identifier is quoted. * Check if this identifier is quoted.
* *
* @param string $identifier * @param string $identifier
* @return bool * @return bool
*/ */
protected function isQuoted($identifier) protected function isIdentifierQuoted($identifier)
{ {
return (isset($identifier[0]) && ($identifier[0] == '`' || $identifier[0] == '"')); return (isset($identifier[0]) && ($identifier[0] == '`' || $identifier[0] == '"'));
} }
......
...@@ -155,7 +155,7 @@ class Schema extends AbstractAsset ...@@ -155,7 +155,7 @@ class Schema extends AbstractAsset
*/ */
private function getFullQualifiedAssetName($name) private function getFullQualifiedAssetName($name)
{ {
if ($this->isQuoted($name)) { if ($this->isIdentifierQuoted($name)) {
$name = $this->trimQuotes($name); $name = $this->trimQuotes($name);
} }
if (strpos($name, ".") === false) { if (strpos($name, ".") === false) {
......
<?xml version="1.0" encoding="utf-8"?>
<!--
Use this configuration file as a template to run the tests against any dbms.
Procedure:
1) Save a copy of this file with a name of your chosing. It doesn't matter
where you place it as long as you know where it is.
i.e. "mysqlconf.xml" (It needs the ending .xml).
2) Edit the file and fill in your settings (database name, type, username, etc.)
Just change the "value"s, not the names of the var elements.
3) To run the tests against the database type the following from within the
tests/ folder: phpunit -c <filename> ...
Example: phpunit -c mysqlconf.xml
-->
<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="./tests/Doctrine/Tests/TestInit.php"
>
<php>
<!-- "Real" test database -->
<!-- Uncomment, otherwise SQLite runs
<var name="db_type" value="pdo_mysql"/>
<var name="db_host" value="localhost" />
<var name="db_username" value="root" />
<var name="db_password" value="" />
<var name="db_name" value="doctrine_tests" />
<var name="db_port" value="3306"/>
-->
<!--<var name="db_event_subscribers" value="Doctrine\DBAL\Event\Listeners\OracleSessionInit">-->
<!-- Database for temporary connections (i.e. to drop/create the main database) -->
<var name="tmpdb_type" value="pdo_mysql"/>
<var name="tmpdb_host" value="127.0.0.1" />
<var name="tmpdb_username" value="root" />
<var name="tmpdb_password" value="" />
<var name="tmpdb_name" value="doctrine_tests_tmp" />
<var name="tmpdb_port" value="3306"/>
</php>
<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>./tests/Doctrine/Tests/DBAL</directory>
</testsuite>
</testsuites>
</phpunit>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment