Multiple ORMs for all database

This commit is contained in:
Nicolas Le Goff
2014-10-16 20:00:27 +02:00
parent 007d83fe57
commit 9a3e92ed9c
252 changed files with 2901 additions and 2417 deletions

View File

@@ -40,7 +40,7 @@ class ColorspaceTest extends \PhraseanetTestCase
$File = new File(self::$DI['app'], $media, self::$DI['collection']);
$response = $this->object->check(self::$DI['app']['EM'], $File);
$response = $this->object->check(self::$DI['app']['orm.em'], $File);
$this->assertInstanceOf('\\Alchemy\\Phrasea\\Border\\Checker\\Response', $response);
$this->assertTrue($response->isOk());

View File

@@ -37,32 +37,32 @@ class DimensionTest extends \PhraseanetTestCase
$File = new File(self::$DI['app'], $media, self::$DI['collection']);
$object = new Dimension(self::$DI['app'], ['width' => 800]);
$response = $object->check(self::$DI['app']['EM'], $File);
$response = $object->check(self::$DI['app']['orm.em'], $File);
$this->assertInstanceOf('\\Alchemy\\Phrasea\\Border\\Checker\\Response', $response);
$this->assertFalse($response->isOk());
$object = new Dimension(self::$DI['app'], ['width' => 500]);
$response = $object->check(self::$DI['app']['EM'], $File);
$response = $object->check(self::$DI['app']['orm.em'], $File);
$this->assertInstanceOf('\\Alchemy\\Phrasea\\Border\\Checker\\Response', $response);
$this->assertFalse($response->isOk());
$object = new Dimension(self::$DI['app'], ['width' => 400]);
$response = $object->check(self::$DI['app']['EM'], $File);
$response = $object->check(self::$DI['app']['orm.em'], $File);
$this->assertInstanceOf('\\Alchemy\\Phrasea\\Border\\Checker\\Response', $response);
$this->assertTrue($response->isOk());
$object = new Dimension(self::$DI['app'], ['width' => 600, 'height' => 500]);
$response = $object->check(self::$DI['app']['EM'], $File);
$response = $object->check(self::$DI['app']['orm.em'], $File);
$this->assertInstanceOf('\\Alchemy\\Phrasea\\Border\\Checker\\Response', $response);
$this->assertFalse($response->isOk());
$object = new Dimension(self::$DI['app'], ['width' => 600, 'height' => 400]);
$response = $object->check(self::$DI['app']['EM'], $File);
$response = $object->check(self::$DI['app']['orm.em'], $File);
$this->assertInstanceOf('\\Alchemy\\Phrasea\\Border\\Checker\\Response', $response);
$this->assertTrue($response->isOk());
$object = new Dimension(self::$DI['app'], ['width' => 200, 'height' => 200]);
$response = $object->check(self::$DI['app']['EM'], $File);
$response = $object->check(self::$DI['app']['orm.em'], $File);
$this->assertInstanceOf('\\Alchemy\\Phrasea\\Border\\Checker\\Response', $response);
$this->assertTrue($response->isOk());
}

View File

@@ -52,7 +52,7 @@ class ExtensionTest extends \PhraseanetTestCase
$File = new File(self::$DI['app'], $media, self::$DI['collection']);
$response = $this->object->check(self::$DI['app']['EM'], $File);
$response = $this->object->check(self::$DI['app']['orm.em'], $File);
$this->assertEquals($result, $response->isOk());
}

View File

@@ -43,7 +43,7 @@ class FilenameTest extends \PhraseanetTestCase
*/
public function testCheck()
{
$response = $this->object->check(self::$DI['app']['EM'], new File(self::$DI['app'], $this->media, self::$DI['collection']));
$response = $this->object->check(self::$DI['app']['orm.em'], new File(self::$DI['app'], $this->media, self::$DI['collection']));
$this->assertInstanceOf('\\Alchemy\\Phrasea\\Border\\Checker\\Response', $response);
@@ -63,7 +63,7 @@ class FilenameTest extends \PhraseanetTestCase
->will($this->returnValue(self::$DI['app']['random.low']->generateString(32)))
;
$response = $this->object->check(self::$DI['app']['EM'], $mock);
$response = $this->object->check(self::$DI['app']['orm.em'], $mock);
$this->assertInstanceOf('\\Alchemy\\Phrasea\\Border\\Checker\\Response', $response);
@@ -86,14 +86,14 @@ class FilenameTest extends \PhraseanetTestCase
->will($this->returnValue(strtoupper($this->media->getFile()->getFilename())))
;
$response = $this->object->check(self::$DI['app']['EM'], $mock);
$response = $this->object->check(self::$DI['app']['orm.em'], $mock);
$this->assertInstanceOf('\\Alchemy\\Phrasea\\Border\\Checker\\Response', $response);
$this->assertFalse($response->isOk());
$objectSensitive = new Filename(self::$DI['app'], ['sensitive' => true]);
$responseSensitive = $objectSensitive->check(self::$DI['app']['EM'], $mock);
$responseSensitive = $objectSensitive->check(self::$DI['app']['orm.em'], $mock);
$this->assertTrue($responseSensitive->isOk());

View File

@@ -29,7 +29,7 @@ class MediaTypeTest extends \PhraseanetTestCase
{
$media = self::$DI['app']['mediavorus']->guess(__DIR__ . '/../../../../../files/test001.jpg');
$file = new File(self::$DI['app'], $media, self::$DI['collection']);
$response = $this->object->check(self::$DI['app']['EM'], $file);
$response = $this->object->check(self::$DI['app']['orm.em'], $file);
$this->assertTrue($response->isOk());
@@ -37,7 +37,7 @@ class MediaTypeTest extends \PhraseanetTestCase
$media = self::$DI['app']['mediavorus']->guess(__DIR__ . '/../../../../../files/test001.jpg');
$file = new File(self::$DI['app'], $media, self::$DI['collection']);
$response = $object->check(self::$DI['app']['EM'], $file);
$response = $object->check(self::$DI['app']['orm.em'], $file);
$this->assertFalse($response->isOk());
}

View File

@@ -38,7 +38,7 @@ class Sha256Test extends \PhraseanetTestCase
*/
public function testCheck()
{
$session = self::$DI['app']['EM']->find('Phraseanet:LazaretSession', 1);
$session = self::$DI['app']['orm.em']->find('Phraseanet:LazaretSession', 1);
self::$DI['app']['phraseanet.SE'] = $this->createSearchEngineMock();
self::$DI['app']['border-manager']->process($session, File::buildFromPathfile($this->media->getFile()->getPathname(), self::$DI['collection'], self::$DI['app']), null, Manager::FORCE_RECORD);
@@ -51,7 +51,7 @@ class Sha256Test extends \PhraseanetTestCase
->will($this->returnValue('7fad283de349b903c850548cda65cf2d86d24c4e3856cdc2b97e47430494b8c8'))
;
$response = $this->object->check(self::$DI['app']['EM'], $mock);
$response = $this->object->check(self::$DI['app']['orm.em'], $mock);
$this->assertInstanceOf('\\Alchemy\\Phrasea\\Border\\Checker\\Response', $response);
$this->assertFalse($response->isOk());
}
@@ -69,7 +69,7 @@ class Sha256Test extends \PhraseanetTestCase
->will($this->returnValue(self::$DI['app']['random.low']->generateString(3)))
;
$response = $this->object->check(self::$DI['app']['EM'], $mock);
$response = $this->object->check(self::$DI['app']['orm.em'], $mock);
$this->assertInstanceOf('\\Alchemy\\Phrasea\\Border\\Checker\\Response', $response);

View File

@@ -37,7 +37,7 @@ class UUIDTest extends \PhraseanetTestCase
*/
public function testCheck()
{
$response = $this->object->check(self::$DI['app']['EM'], new File(self::$DI['app'], $this->media, self::$DI['collection']));
$response = $this->object->check(self::$DI['app']['orm.em'], new File(self::$DI['app'], $this->media, self::$DI['collection']));
$this->assertInstanceOf('\\Alchemy\\Phrasea\\Border\\Checker\\Response', $response);
@@ -57,7 +57,7 @@ class UUIDTest extends \PhraseanetTestCase
->will($this->returnValue(self::$DI['app']['random.low']->generateString(3)))
;
$response = $this->object->check(self::$DI['app']['EM'], $mock);
$response = $this->object->check(self::$DI['app']['orm.em'], $mock);
$this->assertInstanceOf('\\Alchemy\\Phrasea\\Border\\Checker\\Response', $response);

View File

@@ -54,7 +54,7 @@ class ManagerTest extends \PhraseanetAuthenticatedWebTestCase
{
parent::setUp();
$this->object = new Manager(self::$DI['app']);
$this->session = self::$DI['app']['EM']->find('Phraseanet:LazaretSession', 1);
$this->session = self::$DI['app']['orm.em']->find('Phraseanet:LazaretSession', 1);
}
/**