mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 06:23:18 +00:00
Use of old PDO singleton.
Also fixup test suite to check behaviour of set_mime (only setter)
This commit is contained in:
@@ -246,7 +246,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
|||||||
throw new \Exception(sprintf('Unrecognized mime type %s', $mime));
|
throw new \Exception(sprintf('Unrecognized mime type %s', $mime));
|
||||||
}
|
}
|
||||||
|
|
||||||
$connection = connection::getPDOConnection($this->app, $this->get_sbas_id());
|
$connection = $this->databox->get_connection();
|
||||||
|
|
||||||
$sql = 'UPDATE record SET mime = :mime WHERE record_id = :record_id';
|
$sql = 'UPDATE record SET mime = :mime WHERE record_id = :record_id';
|
||||||
$stmt = $connection->prepare($sql);
|
$stmt = $connection->prepare($sql);
|
||||||
|
@@ -207,6 +207,19 @@ class record_adapterTest extends \PhraseanetAuthenticatedTestCase
|
|||||||
$this->assertRegExp('/image\/\w+/', self::$DI['record_1']->get_mime());
|
$this->assertRegExp('/image\/\w+/', self::$DI['record_1']->get_mime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSetMimeType()
|
||||||
|
{
|
||||||
|
/** @var record_adapter $record_1 */
|
||||||
|
$record_1 = self::$DI['record_1'];
|
||||||
|
|
||||||
|
$oldMime = $record_1->get_mime();
|
||||||
|
$record_1->set_mime('foo/bar');
|
||||||
|
$this->assertEquals('foo/bar', $record_1->get_mime());
|
||||||
|
|
||||||
|
$record_1->set_mime($oldMime);
|
||||||
|
$this->assertEquals($oldMime, $record_1->get_mime());
|
||||||
|
}
|
||||||
|
|
||||||
public function testGet_status()
|
public function testGet_status()
|
||||||
{
|
{
|
||||||
$this->assertRegExp('/[01]{32}/', self::$DI['record_1']->get_status());
|
$this->assertRegExp('/[01]{32}/', self::$DI['record_1']->get_status());
|
||||||
|
Reference in New Issue
Block a user