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

add test for Oracle session init parameter value quotation

parent 11676e51
......@@ -25,9 +25,37 @@ class OracleSessionInitTest extends DbalTestCase
$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()
{
$listener = new OracleSessionInit();
$this->assertEquals(array(Events::postConnect), $listener->getSubscribedEvents());
}
}
\ No newline at end of file
}
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