Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
b0963d91
Commit
b0963d91
authored
Mar 31, 2010
by
guilhermeblanco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0][DDC-274] Moved Sql to SQL loggers. Also implemented some todos.
parent
c4a9ce1c
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
118 additions
and
45 deletions
+118
-45
Configuration.php
lib/Doctrine/DBAL/Configuration.php
+4
-6
DebugStack.php
lib/Doctrine/DBAL/Logging/DebugStack.php
+19
-2
EchoSqlLogger.php
lib/Doctrine/DBAL/Logging/EchoSqlLogger.php
+35
-7
SqlLogger.php
lib/Doctrine/DBAL/Logging/SqlLogger.php
+35
-5
BasicFunctionalTest.php
tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php
+7
-7
ClassTableInheritanceTest.php
...ctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php
+1
-1
FlushEventTest.php
tests/Doctrine/Tests/ORM/Functional/FlushEventTest.php
+1
-1
LifecycleCallbackTest.php
...s/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php
+1
-1
ManyToManyBidirectionalAssociationTest.php
...ORM/Functional/ManyToManyBidirectionalAssociationTest.php
+2
-2
OneToManyBidirectionalAssociationTest.php
.../ORM/Functional/OneToManyBidirectionalAssociationTest.php
+2
-2
SingleTableInheritanceTest.php
...trine/Tests/ORM/Functional/SingleTableInheritanceTest.php
+1
-1
DDC144Test.php
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC144Test.php
+1
-1
DDC168Test.php
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC168Test.php
+1
-1
DDC211Test.php
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC211Test.php
+1
-1
DDC258Test.php
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC258Test.php
+1
-1
DDC345Test.php
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php
+1
-1
DDC371Test.php
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC371Test.php
+1
-1
DDC422Test.php
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC422Test.php
+1
-1
DDC425Test.php
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC425Test.php
+1
-1
DDC444Test.php
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC444Test.php
+1
-1
OrmFunctionalTestCase.php
tests/Doctrine/Tests/OrmFunctionalTestCase.php
+1
-1
No files found.
lib/Doctrine/DBAL/Configuration.php
View file @
b0963d91
...
...
@@ -59,10 +59,9 @@ class Configuration
/**
* Sets the SQL logger to use. Defaults to NULL which means SQL logging is disabled.
*
* @param SqlLogger $logger
* @todo Rename to setSQLLogger()
* @param SQLLogger $logger
*/
public
function
setS
ql
Logger
(
$logger
)
public
function
setS
QL
Logger
(
$logger
)
{
$this
->
_attributes
[
'sqlLogger'
]
=
$logger
;
}
...
...
@@ -70,10 +69,9 @@ class Configuration
/**
* Gets the SQL logger that is used.
*
* @return SqlLogger
* @todo Rename to getSQLLogger()
* @return SQLLogger
*/
public
function
getS
ql
Logger
()
public
function
getS
QL
Logger
()
{
return
$this
->
_attributes
[
'sqlLogger'
];
}
...
...
lib/Doctrine/DBAL/Logging/DebugStack.php
View file @
b0963d91
...
...
@@ -21,13 +21,30 @@
namespace
Doctrine\DBAL\Logging
;
class
DebugStack
implements
SqlLogger
/**
* Includes executed SQLs in a Debug Stack
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @author Benjamin Eberlei <kontakt@beberlei.de>
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
DebugStack
implements
SQLLogger
{
/** @var array $queries Executed SQL queries. */
public
$queries
=
array
();
/** @var boolean $enabled If Debug Stack is enabled (log queries) or not. */
public
$enabled
=
true
;
public
function
logSql
(
$sql
,
array
$params
=
null
)
/**
* {@inheritdoc}
*/
public
function
logSQL
(
$sql
,
array
$params
=
null
)
{
if
(
$this
->
enabled
)
{
$this
->
queries
[]
=
array
(
'sql'
=>
$sql
,
'params'
=>
$params
);
...
...
lib/Doctrine/DBAL/Logging/EchoSqlLogger.php
View file @
b0963d91
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\DBAL\Logging
;
/**
* A SQL logger that logs to the standard output using echo/var_dump.
*
* @author Roman Borschel <roman@code-factory.org>
* @since 2.0
* @todo Rename: EchoSQLLogger
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @author Benjamin Eberlei <kontakt@beberlei.de>
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
EchoS
qlLogger
implements
Sql
Logger
class
EchoS
QLLogger
implements
SQL
Logger
{
public
function
logSql
(
$sql
,
array
$params
=
null
)
/**
* {@inheritdoc}
*/
public
function
logSQL
(
$sql
,
array
$params
=
null
)
{
echo
$sql
.
PHP_EOL
;
if
(
$params
)
{
var_dump
(
$params
);
if
(
$params
)
{
var_dump
(
$params
);
}
}
}
\ No newline at end of file
lib/Doctrine/DBAL/Logging/SqlLogger.php
View file @
b0963d91
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\DBAL\Logging
;
/**
* Interface for SQL loggers.
*
* @author Roman Borschel <roman@code-factory.org>
* @since 2.0
* @todo Rename: SQLLogger
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @author Benjamin Eberlei <kontakt@beberlei.de>
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
interface
S
ql
Logger
interface
S
QL
Logger
{
function
logSql
(
$sql
,
array
$params
=
null
);
/**
* Logs a SQL statement somewhere.
*
* @param string $sql The SQL to be executed.
* @param array $params The SQL parameters.
*/
function
logSQL
(
$sql
,
array
$params
=
null
);
}
\ No newline at end of file
tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php
View file @
b0963d91
...
...
@@ -578,7 +578,7 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this
->
_em
->
persist
(
$article
);
$this
->
_em
->
persist
(
$user
);
//$this->_em->getConnection()->getConfiguration()->setS
qlLogger(new \Doctrine\DBAL\Logging\EchoSql
Logger);
//$this->_em->getConnection()->getConfiguration()->setS
QLLogger(new \Doctrine\DBAL\Logging\EchoSQL
Logger);
$this
->
_em
->
flush
();
$this
->
_em
->
clear
();
...
...
@@ -589,14 +589,14 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this
->
assertEquals
(
1
,
count
(
$user2
->
articles
));
$this
->
assertTrue
(
$user2
->
address
instanceof
CmsAddress
);
$oldLogger
=
$this
->
_em
->
getConnection
()
->
getConfiguration
()
->
getS
ql
Logger
();
$oldLogger
=
$this
->
_em
->
getConnection
()
->
getConfiguration
()
->
getS
QL
Logger
();
$debugStack
=
new
\Doctrine\DBAL\Logging\DebugStack
;
$this
->
_em
->
getConnection
()
->
getConfiguration
()
->
setS
ql
Logger
(
$debugStack
);
$this
->
_em
->
getConnection
()
->
getConfiguration
()
->
setS
QL
Logger
(
$debugStack
);
$this
->
_em
->
flush
();
$this
->
assertEquals
(
0
,
count
(
$debugStack
->
queries
));
$this
->
_em
->
getConnection
()
->
getConfiguration
()
->
setS
ql
Logger
(
$oldLogger
);
$this
->
_em
->
getConnection
()
->
getConfiguration
()
->
setS
QL
Logger
(
$oldLogger
);
}
public
function
testRemoveEntityByReference
()
...
...
@@ -606,7 +606,7 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
$user
->
username
=
'gblanco'
;
$user
->
status
=
'developer'
;
//$this->_em->getConnection()->getConfiguration()->setS
qlLogger(new \Doctrine\DBAL\Logging\EchoSql
Logger);
//$this->_em->getConnection()->getConfiguration()->setS
QLLogger(new \Doctrine\DBAL\Logging\EchoSQL
Logger);
$this
->
_em
->
persist
(
$user
);
$this
->
_em
->
flush
();
...
...
@@ -619,7 +619,7 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this
->
assertEquals
(
0
,
$this
->
_em
->
getConnection
()
->
fetchColumn
(
"select count(*) from cms_users"
));
//$this->_em->getConnection()->getConfiguration()->setS
ql
Logger(null);
//$this->_em->getConnection()->getConfiguration()->setS
QL
Logger(null);
}
/**
...
...
@@ -643,7 +643,7 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this
->
_em
->
flush
();
$this
->
_em
->
clear
();
//$this->_em->getConnection()->getConfiguration()->setS
qlLogger(new \Doctrine\DBAL\Logging\EchoSql
Logger);
//$this->_em->getConnection()->getConfiguration()->setS
QLLogger(new \Doctrine\DBAL\Logging\EchoSQL
Logger);
$userRef
=
$this
->
_em
->
getReference
(
'Doctrine\Tests\Models\CMS\CmsUser'
,
$user
->
getId
());
$address2
=
$this
->
_em
->
createQuery
(
'select a from Doctrine\Tests\Models\CMS\CmsAddress a where a.user = :user'
)
...
...
tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php
View file @
b0963d91
...
...
@@ -23,7 +23,7 @@ class ClassTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase
protected
function
setUp
()
{
$this
->
useModelSet
(
'company'
);
parent
::
setUp
();
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoS
ql
Logger);
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoS
QL
Logger);
}
public
function
testCRUD
()
...
...
tests/Doctrine/Tests/ORM/Functional/FlushEventTest.php
View file @
b0963d91
...
...
@@ -23,7 +23,7 @@ class FlushEventTest extends \Doctrine\Tests\OrmFunctionalTestCase
public
function
testPersistNewEntitiesOnPreFlush
()
{
//$this->_em->getConnection()->getConfiguration()->setS
qlLogger(new \Doctrine\DBAL\Logging\EchoSql
Logger);
//$this->_em->getConnection()->getConfiguration()->setS
QLLogger(new \Doctrine\DBAL\Logging\EchoSQL
Logger);
$this
->
_em
->
getEventManager
()
->
addEventListener
(
Events
::
onFlush
,
new
OnFlushListener
);
$user
=
new
CmsUser
;
...
...
tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php
View file @
b0963d91
...
...
@@ -87,7 +87,7 @@ class LifecycleCallbackTest extends \Doctrine\Tests\OrmFunctionalTestCase
*/
public
function
testCascadedEntitiesCallsPrePersist
()
{
//$this->_em->getConnection()->getConfiguration()->setS
qlLogger(new \Doctrine\DBAL\Logging\EchoSql
Logger);
//$this->_em->getConnection()->getConfiguration()->setS
QLLogger(new \Doctrine\DBAL\Logging\EchoSQL
Logger);
$e1
=
new
LifecycleCallbackTestEntity
;
$e2
=
new
LifecycleCallbackTestEntity
;
...
...
tests/Doctrine/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php
View file @
b0963d91
...
...
@@ -68,7 +68,7 @@ class ManyToManyBidirectionalAssociationTest extends AbstractManyToManyAssociati
public
function
testEagerLoadFromInverseSideAndLazyLoadFromOwningSide
()
{
//$this->_em->getConnection()->getConfiguration()->setS
qlLogger(new \Doctrine\DBAL\Logging\EchoSql
Logger);
//$this->_em->getConnection()->getConfiguration()->setS
QLLogger(new \Doctrine\DBAL\Logging\EchoSQL
Logger);
$this
->
_createLoadingFixture
();
$categories
=
$this
->
_findCategories
();
$this
->
assertLazyLoadFromOwningSide
(
$categories
);
...
...
@@ -76,7 +76,7 @@ class ManyToManyBidirectionalAssociationTest extends AbstractManyToManyAssociati
public
function
testEagerLoadFromOwningSideAndLazyLoadFromInverseSide
()
{
//$this->_em->getConnection()->getConfiguration()->setS
qlLogger(new \Doctrine\DBAL\Logging\EchoSql
Logger);
//$this->_em->getConnection()->getConfiguration()->setS
QLLogger(new \Doctrine\DBAL\Logging\EchoSQL
Logger);
$this
->
_createLoadingFixture
();
$products
=
$this
->
_findProducts
();
$this
->
assertLazyLoadFromInverseSide
(
$products
);
...
...
tests/Doctrine/Tests/ORM/Functional/OneToManyBidirectionalAssociationTest.php
View file @
b0963d91
...
...
@@ -123,7 +123,7 @@ class OneToManyBidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctiona
public
function
testLazyLoadsObjectsOnTheInverseSide2
()
{
//$this->_em->getConnection()->getConfiguration()->setS
qlLogger(new \Doctrine\DBAL\Logging\EchoSql
Logger);
//$this->_em->getConnection()->getConfiguration()->setS
QLLogger(new \Doctrine\DBAL\Logging\EchoSQL
Logger);
$this
->
_createFixture
();
$query
=
$this
->
_em
->
createQuery
(
'select f,p from Doctrine\Tests\Models\ECommerce\ECommerceFeature f join f.product p'
);
...
...
@@ -141,7 +141,7 @@ class OneToManyBidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctiona
//$this->assertTrue($product->getFeatures()->contains($features[0]));
//$this->assertTrue($product->getFeatures()->contains($features[1]));
//$this->_em->getConnection()->getConfiguration()->setS
ql
Logger(null);
//$this->_em->getConnection()->getConfiguration()->setS
QL
Logger(null);
}
public
function
testJoinFromOwningSide
()
...
...
tests/Doctrine/Tests/ORM/Functional/SingleTableInheritanceTest.php
View file @
b0963d91
...
...
@@ -167,7 +167,7 @@ class SingleTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase
$parentRelated
->
setParent
(
$child2
);
$this
->
_em
->
persist
(
$parentRelated
);
//$this->_em->getConnection()->getConfiguration()->setS
qlLogger(new \Doctrine\DBAL\Logging\EchoSql
Logger);
//$this->_em->getConnection()->getConfiguration()->setS
QLLogger(new \Doctrine\DBAL\Logging\EchoSQL
Logger);
$this
->
_em
->
flush
();
$this
->
_em
->
clear
();
...
...
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC144Test.php
View file @
b0963d91
...
...
@@ -9,7 +9,7 @@ class DDC144Test extends \Doctrine\Tests\OrmFunctionalTestCase
protected
function
setUp
()
{
parent
::
setUp
();
//$this->_em->getConnection()->getConfiguration()->setS
qlLogger(new \Doctrine\DBAL\Logging\EchoSql
Logger);
//$this->_em->getConnection()->getConfiguration()->setS
QLLogger(new \Doctrine\DBAL\Logging\EchoSQL
Logger);
$this
->
_schemaTool
->
createSchema
(
array
(
$this
->
_em
->
getClassMetadata
(
__NAMESPACE__
.
'\DDC144FlowElement'
),
...
...
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC168Test.php
View file @
b0963d91
...
...
@@ -18,7 +18,7 @@ class DDC168Test extends \Doctrine\Tests\OrmFunctionalTestCase
*/
public
function
testJoinedSubclassPersisterRequiresSpecificOrderOfMetadataReflFieldsArray
()
{
//$this->_em->getConnection()->getConfiguration()->setS
qlLogger(new \Doctrine\DBAL\Logging\EchoSql
Logger);
//$this->_em->getConnection()->getConfiguration()->setS
QLLogger(new \Doctrine\DBAL\Logging\EchoSQL
Logger);
$metadata
=
$this
->
_em
->
getClassMetadata
(
'Doctrine\Tests\Models\Company\CompanyEmployee'
);
ksort
(
$metadata
->
reflFields
);
...
...
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC211Test.php
View file @
b0963d91
...
...
@@ -17,7 +17,7 @@ class DDC211Test extends \Doctrine\Tests\OrmFunctionalTestCase
public
function
testIssue
()
{
//$this->_em->getConnection()->getConfiguration()->setS
qlLogger(new \Doctrine\DBAL\Logging\EchoSql
Logger);
//$this->_em->getConnection()->getConfiguration()->setS
QLLogger(new \Doctrine\DBAL\Logging\EchoSQL
Logger);
$user
=
new
DDC211User
;
$user
->
setName
(
'John Doe'
);
...
...
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC258Test.php
View file @
b0963d91
...
...
@@ -21,7 +21,7 @@ class DDC258Test extends \Doctrine\Tests\OrmFunctionalTestCase
*/
public
function
testIssue
()
{
//$this->_em->getConnection()->getConfiguration()->setS
qlLogger(new \Doctrine\DBAL\Logging\EchoSql
Logger);
//$this->_em->getConnection()->getConfiguration()->setS
QLLogger(new \Doctrine\DBAL\Logging\EchoSQL
Logger);
$c1
=
new
DDC258Class1
();
$c1
->
title
=
"Foo"
;
...
...
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php
View file @
b0963d91
...
...
@@ -9,7 +9,7 @@ class DDC345Test extends \Doctrine\Tests\OrmFunctionalTestCase
protected
function
setUp
()
{
parent
::
setUp
();
//$this->_em->getConnection()->getConfiguration()->setS
qlLogger(new \Doctrine\DBAL\Logging\EchoSql
Logger);
//$this->_em->getConnection()->getConfiguration()->setS
QLLogger(new \Doctrine\DBAL\Logging\EchoSQL
Logger);
$this
->
_schemaTool
->
createSchema
(
array
(
$this
->
_em
->
getClassMetadata
(
__NAMESPACE__
.
'\DDC345User'
),
$this
->
_em
->
getClassMetadata
(
__NAMESPACE__
.
'\DDC345Group'
),
...
...
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC371Test.php
View file @
b0963d91
...
...
@@ -10,7 +10,7 @@ class DDC371Test extends \Doctrine\Tests\OrmFunctionalTestCase
protected
function
setUp
()
{
parent
::
setUp
();
//$this->_em->getConnection()->getConfiguration()->setS
qlLogger(new \Doctrine\DBAL\Logging\EchoSql
Logger);
//$this->_em->getConnection()->getConfiguration()->setS
QLLogger(new \Doctrine\DBAL\Logging\EchoSQL
Logger);
$this
->
_schemaTool
->
createSchema
(
array
(
$this
->
_em
->
getClassMetadata
(
__NAMESPACE__
.
'\DDC371Parent'
),
$this
->
_em
->
getClassMetadata
(
__NAMESPACE__
.
'\DDC371Child'
)
...
...
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC422Test.php
View file @
b0963d91
...
...
@@ -8,7 +8,7 @@ class DDC422Test extends \Doctrine\Tests\OrmFunctionalTestCase
protected
function
setUp
()
{
parent
::
setUp
();
//$this->_em->getConnection()->getConfiguration()->setS
qlLogger(new \Doctrine\DBAL\Logging\EchoSql
Logger);
//$this->_em->getConnection()->getConfiguration()->setS
QLLogger(new \Doctrine\DBAL\Logging\EchoSQL
Logger);
$this
->
_schemaTool
->
createSchema
(
array
(
$this
->
_em
->
getClassMetadata
(
__NAMESPACE__
.
'\DDC422Guest'
),
$this
->
_em
->
getClassMetadata
(
__NAMESPACE__
.
'\DDC422Customer'
),
...
...
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC425Test.php
View file @
b0963d91
...
...
@@ -21,7 +21,7 @@ class DDC425Test extends \Doctrine\Tests\OrmFunctionalTestCase
*/
public
function
testIssue
()
{
//$this->_em->getConnection()->getConfiguration()->setS
qlLogger(new \Doctrine\DBAL\Logging\EchoSql
Logger);
//$this->_em->getConnection()->getConfiguration()->setS
QLLogger(new \Doctrine\DBAL\Logging\EchoSQL
Logger);
$num
=
$this
->
_em
->
createQuery
(
'DELETE '
.
__NAMESPACE__
.
'\DDC425Entity e WHERE e.someDatetimeField > ?1'
)
->
setParameter
(
1
,
new
DateTime
,
Type
::
DATETIME
)
...
...
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC444Test.php
View file @
b0963d91
...
...
@@ -9,7 +9,7 @@ class DDC444Test extends \Doctrine\Tests\OrmFunctionalTestCase
public
function
setUp
()
{
parent
::
setUp
();
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoS
ql
Logger);
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoS
QL
Logger);
$this
->
_schemaTool
->
createSchema
(
array
(
$this
->
_em
->
getClassMetadata
(
__NAMESPACE__
.
'\DDC444User'
),
));
...
...
tests/Doctrine/Tests/OrmFunctionalTestCase.php
View file @
b0963d91
...
...
@@ -222,7 +222,7 @@ abstract class OrmFunctionalTestCase extends OrmTestCase
$config
->
setProxyNamespace
(
'Doctrine\Tests\Proxies'
);
$conn
=
$this
->
sharedFixture
[
'conn'
];
$conn
->
getConfiguration
()
->
setS
ql
Logger
(
$this
->
_sqlLoggerStack
);
$conn
->
getConfiguration
()
->
setS
QL
Logger
(
$this
->
_sqlLoggerStack
);
return
\Doctrine\ORM\EntityManager
::
create
(
$conn
,
$config
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment