Commit a9c39e53 authored by Steve Müller's avatar Steve Müller

add test for Oracle session init parameter value quotation

parent 11676e51
...@@ -25,6 +25,34 @@ class OracleSessionInitTest extends DbalTestCase ...@@ -25,6 +25,34 @@ class OracleSessionInitTest extends DbalTestCase
$listener->postConnect($eventArgs); $listener->postConnect($eventArgs);
} }
/**
* @group DBAL-1824
*
* @dataProvider getPostConnectWithSessionParameterValuesData
*/
public function testPostConnectQuotesSessionParameterValues($name, $value)
{
$connectionMock = $this->getMockBuilder('Doctrine\DBAL\Connection')
->disableOriginalConstructor()
->getMock();
$connectionMock->expects($this->once())
->method('executeUpdate')
->with($this->stringContains(sprintf('%s = %s', $name, $value)));
$eventArgs = new ConnectionEventArgs($connectionMock);
$listener = new OracleSessionInit(array($name => $value));
$listener->postConnect($eventArgs);
}
public function getPostConnectWithSessionParameterValuesData()
{
return array(
array('CURRENT_SCHEMA', 'foo'),
);
}
public function testGetSubscribedEvents() public function testGetSubscribedEvents()
{ {
$listener = new OracleSessionInit(); $listener = new OracleSessionInit();
......
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