3 namespace Doctrine\Tests\DBAL\Events;
5 use Doctrine\Tests\DbalTestCase;
6 use Doctrine\DBAL\Event\Listeners\OracleSessionInit;
7 use Doctrine\DBAL\Event\ConnectionEventArgs;
8 use Doctrine\DBAL\Events;
10 require_once __DIR__ . '/../../TestInit.php';
12 class OracleSessionInitTest extends DbalTestCase
14 public function testPostConnect()
16 $connectionMock = $this->getMock('Doctrine\DBAL\Connection', array(), array(), '', false);
17 $connectionMock->expects($this->once())
18 ->method('executeUpdate')
19 ->with($this->isType('string'));
21 $eventArgs = new ConnectionEventArgs($connectionMock);
24 $listener = new OracleSessionInit();
25 $listener->postConnect($eventArgs);
28 public function testGetSubscribedEvents()
30 $listener = new OracleSessionInit();
31 $this->assertEquals(array(Events::postConnect), $listener->getSubscribedEvents());