1
0
mirror of synced 2025-03-21 15:33:51 +03:00

#1262 DDC-3513 - RunDqlCommand should display the generated SQL when asked to do so

This commit is contained in:
Marco Pivetta 2015-01-17 21:30:34 +01:00
parent 1c6fd512a5
commit f06d652393

View File

@ -64,10 +64,27 @@ class RunDqlCommandTest extends OrmFunctionalTestCase
0, 0,
$this->tester->execute(array( $this->tester->execute(array(
'command' => $this->command->getName(), '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()); $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());
}
} }