Vendor update && Started using DoctrineMigrations

This commit is contained in:
Polonkai Gergely
2012-07-23 17:09:03 +02:00
parent 7c36f93436
commit bf46316347
1102 changed files with 103189 additions and 7 deletions

View File

@@ -0,0 +1,33 @@
<?php
namespace Doctrine\Tests\DBAL\Events;
use Doctrine\Tests\DbalTestCase;
use Doctrine\DBAL\Event\Listeners\MysqlSessionInit;
use Doctrine\DBAL\Event\ConnectionEventArgs;
use Doctrine\DBAL\Events;
require_once __DIR__ . '/../../TestInit.php';
class MysqlSessionInitTest extends DbalTestCase
{
public function testPostConnect()
{
$connectionMock = $this->getMock('Doctrine\DBAL\Connection', array(), array(), '', false);
$connectionMock->expects($this->once())
->method('executeUpdate')
->with($this->equalTo("SET NAMES foo COLLATE bar"));
$eventArgs = new ConnectionEventArgs($connectionMock);
$listener = new MysqlSessionInit('foo', 'bar');
$listener->postConnect($eventArgs);
}
public function testGetSubscribedEvents()
{
$listener = new MysqlSessionInit();
$this->assertEquals(array(Events::postConnect), $listener->getSubscribedEvents());
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace Doctrine\Tests\DBAL\Events;
use Doctrine\Tests\DbalTestCase;
use Doctrine\DBAL\Event\Listeners\OracleSessionInit;
use Doctrine\DBAL\Event\ConnectionEventArgs;
use Doctrine\DBAL\Events;
require_once __DIR__ . '/../../TestInit.php';
class OracleSessionInitTest extends DbalTestCase
{
public function testPostConnect()
{
$connectionMock = $this->getMock('Doctrine\DBAL\Connection', array(), array(), '', false);
$connectionMock->expects($this->once())
->method('executeUpdate')
->with($this->isType('string'));
$eventArgs = new ConnectionEventArgs($connectionMock);
$listener = new OracleSessionInit();
$listener->postConnect($eventArgs);
}
public function testGetSubscribedEvents()
{
$listener = new OracleSessionInit();
$this->assertEquals(array(Events::postConnect), $listener->getSubscribedEvents());
}
}

View File

@@ -0,0 +1,35 @@
<?php
namespace Doctrine\Tests\DBAL\Events;
use Doctrine\Tests\DbalTestCase;
use Doctrine\DBAL\Event\Listeners\SQLSessionInit;
use Doctrine\DBAL\Event\ConnectionEventArgs;
use Doctrine\DBAL\Events;
require_once __DIR__ . '/../../TestInit.php';
/**
* @group DBAL-169
*/
class SQLSessionInitTest extends DbalTestCase
{
public function testPostConnect()
{
$connectionMock = $this->getMock('Doctrine\DBAL\Connection', array(), array(), '', false);
$connectionMock->expects($this->once())
->method('exec')
->with($this->equalTo("SET SEARCH_PATH TO foo, public, TIMEZONE TO 'Europe/Berlin'"));
$eventArgs = new ConnectionEventArgs($connectionMock);
$listener = new SQLSessionInit("SET SEARCH_PATH TO foo, public, TIMEZONE TO 'Europe/Berlin'");
$listener->postConnect($eventArgs);
}
public function testGetSubscribedEvents()
{
$listener = new SQLSessionInit("SET SEARCH_PATH TO foo, public, TIMEZONE TO 'Europe/Berlin'");
$this->assertEquals(array(Events::postConnect), $listener->getSubscribedEvents());
}
}