From f06d652393dfb1d85199d457156f13bf3f63b947 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 17 Jan 2015 21:30:34 +0100 Subject: [PATCH] #1262 DDC-3513 - `RunDqlCommand` should display the generated SQL when asked to do so --- .../Console/Command/RunDqlCommandTest.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/Doctrine/Tests/ORM/Tools/Console/Command/RunDqlCommandTest.php b/tests/Doctrine/Tests/ORM/Tools/Console/Command/RunDqlCommandTest.php index 0b4b88ac4..534922329 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Console/Command/RunDqlCommandTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Console/Command/RunDqlCommandTest.php @@ -64,10 +64,27 @@ class RunDqlCommandTest extends OrmFunctionalTestCase 0, $this->tester->execute(array( 'command' => $this->command->getName(), - 'dql' => 'SELECT e FROM ' . DateTimeModel::CLASSNAME . ' e' + 'dql' => 'SELECT e FROM ' . DateTimeModel::CLASSNAME . ' e', )) ); $this->assertContains(DateTimeModel::CLASSNAME, $this->tester->getDisplay()); } + + public function testWillShowQuery() + { + $this->_em->persist(new DateTimeModel()); + $this->_em->flush(); + + $this->assertSame( + 0, + $this->tester->execute(array( + 'command' => $this->command->getName(), + 'dql' => 'SELECT e FROM ' . DateTimeModel::CLASSNAME . ' e', + '--show-sql' => 'true' + )) + ); + + $this->assertStringMatchesFormat('string \'SELECT %a', $this->tester->getDisplay()); + } }