mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 12:33:26 +00:00
add enhancement
This commit is contained in:
@@ -12,7 +12,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
/**
|
/**
|
||||||
* @var record_adapter
|
* @var record_adapter
|
||||||
*/
|
*/
|
||||||
protected static $need_story = true;
|
protected static $grouping;
|
||||||
protected static $need_records = true;
|
protected static $need_records = true;
|
||||||
protected static $need_subdefs = true;
|
protected static $need_subdefs = true;
|
||||||
|
|
||||||
@@ -30,10 +30,12 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
static::$record_23->set_metadatas($metadatas['metadatas']);
|
static::$record_23->set_metadatas($metadatas['metadatas']);
|
||||||
|
|
||||||
$system_file = new system_file(dirname(__FILE__) . '/../testfiles/cestlafete.jpg');
|
$system_file = new system_file(dirname(__FILE__) . '/../testfiles/cestlafete.jpg');
|
||||||
|
self::$grouping = record_adapter::create(self::$collection, $system_file, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass()
|
||||||
{
|
{
|
||||||
|
self::$grouping->delete();
|
||||||
parent::tearDownAfterClass();
|
parent::tearDownAfterClass();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,21 +102,21 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public function testIs_grouping()
|
public function testIs_grouping()
|
||||||
{
|
{
|
||||||
$this->assertFalse(self::$record_1->is_grouping());
|
$this->assertFalse(self::$record_1->is_grouping());
|
||||||
$this->assertTrue(self::$story_1->is_grouping());
|
$this->assertTrue(self::$grouping->is_grouping());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGet_base_id()
|
public function testGet_base_id()
|
||||||
{
|
{
|
||||||
$this->assertTrue(is_int(static::$record_1->get_base_id()));
|
$this->assertTrue(is_int(static::$record_1->get_base_id()));
|
||||||
$this->assertEquals(self::$collection->get_base_id(), static::$record_1->get_base_id());
|
$this->assertEquals(self::$collection->get_base_id(), static::$record_1->get_base_id());
|
||||||
$this->assertTrue(is_int(static::$story_1->get_base_id()));
|
$this->assertTrue(is_int(static::$grouping->get_base_id()));
|
||||||
$this->assertEquals(self::$collection->get_base_id(), static::$story_1->get_base_id());
|
$this->assertEquals(self::$collection->get_base_id(), static::$grouping->get_base_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGet_record_id()
|
public function testGet_record_id()
|
||||||
{
|
{
|
||||||
$this->assertTrue(is_int(static::$record_1->get_record_id()));
|
$this->assertTrue(is_int(static::$record_1->get_record_id()));
|
||||||
$this->assertTrue(is_int(static::$story_1->get_record_id()));
|
$this->assertTrue(is_int(static::$grouping->get_record_id()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGet_thumbnail()
|
public function testGet_thumbnail()
|
||||||
@@ -173,7 +175,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
{
|
{
|
||||||
$this->assertNotNull(static::$record_1->get_sha256());
|
$this->assertNotNull(static::$record_1->get_sha256());
|
||||||
$this->assertRegExp('/[a-zA-Z0-9]{64}/', static::$record_1->get_sha256());
|
$this->assertRegExp('/[a-zA-Z0-9]{64}/', static::$record_1->get_sha256());
|
||||||
$this->assertNull(static::$story_1->get_sha256());
|
$this->assertNull(static::$grouping->get_sha256());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGet_mime()
|
public function testGet_mime()
|
||||||
@@ -414,7 +416,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_reg_name()
|
public function testGet_reg_name()
|
||||||
{
|
{
|
||||||
$this->assertTrue(is_string(self::$story_1->get_reg_name()));
|
$this->assertTrue(is_string(self::$grouping->get_reg_name()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGet_record_by_sha()
|
public function testGet_record_by_sha()
|
||||||
|
Reference in New Issue
Block a user