Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / dbal / tests / Doctrine / Tests / DBAL / Events / OracleSessionInitTest.php
1 <?php
2
3 namespace Doctrine\Tests\DBAL\Events;
4
5 use Doctrine\Tests\DbalTestCase;
6 use Doctrine\DBAL\Event\Listeners\OracleSessionInit;
7 use Doctrine\DBAL\Event\ConnectionEventArgs;
8 use Doctrine\DBAL\Events;
9
10 require_once __DIR__ . '/../../TestInit.php';
11
12 class OracleSessionInitTest extends DbalTestCase
13 {
14     public function testPostConnect()
15     {
16         $connectionMock = $this->getMock('Doctrine\DBAL\Connection', array(), array(), '', false);
17         $connectionMock->expects($this->once())
18                        ->method('executeUpdate')
19                        ->with($this->isType('string'));
20
21         $eventArgs = new ConnectionEventArgs($connectionMock);
22
23
24         $listener = new OracleSessionInit();
25         $listener->postConnect($eventArgs);
26     }
27
28     public function testGetSubscribedEvents()
29     {
30         $listener = new OracleSessionInit();
31         $this->assertEquals(array(Events::postConnect), $listener->getSubscribedEvents());
32     }
33 }