2008-08-16 23:40:59 +04:00
|
|
|
<?php
|
|
|
|
|
2009-01-22 22:38:10 +03:00
|
|
|
namespace Doctrine\Tests\ORM;
|
|
|
|
|
|
|
|
require_once dirname(__FILE__) . '/../TestInit.php';
|
2008-08-16 23:40:59 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* EntityManager tests.
|
|
|
|
*/
|
2009-01-22 22:38:10 +03:00
|
|
|
class EntityManagerTest extends \Doctrine\Tests\OrmTestCase
|
2009-01-04 19:15:32 +03:00
|
|
|
{
|
|
|
|
private $_em;
|
|
|
|
|
|
|
|
function setUp() {
|
|
|
|
parent::setUp();
|
|
|
|
$this->_em = $this->_getTestEntityManager();
|
|
|
|
}
|
|
|
|
|
2008-08-16 23:40:59 +04:00
|
|
|
public function testSettingInvalidFlushModeThrowsException()
|
|
|
|
{
|
|
|
|
$prev = $this->_em->getFlushMode();
|
|
|
|
try {
|
|
|
|
$this->_em->setFlushMode('foobar');
|
|
|
|
$this->fail("Setting invalid flushmode did not trigger exception.");
|
2009-01-22 22:38:10 +03:00
|
|
|
} catch (\Doctrine\ORM\Exceptions\EntityManagerException $expected) {}
|
2008-08-16 23:40:59 +04:00
|
|
|
$this->_em->setFlushMode($prev);
|
|
|
|
}
|
|
|
|
}
|