mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
Merge with Fix tests
This commit is contained in:
@@ -177,7 +177,7 @@ class databox_field implements cache_cacheableInterface
|
|||||||
$this->required = !!$row['required'];
|
$this->required = !!$row['required'];
|
||||||
$this->multi = !!$row['multi'];
|
$this->multi = !!$row['multi'];
|
||||||
$this->report = !!$row['report'];
|
$this->report = !!$row['report'];
|
||||||
$this->type = $row['type'];
|
$this->type = $row['type'] ?: self::TYPE_STRING;
|
||||||
$this->tbranch = $row['tbranch'];
|
$this->tbranch = $row['tbranch'];
|
||||||
if ($row['dces_element'])
|
if ($row['dces_element'])
|
||||||
{
|
{
|
||||||
|
@@ -246,7 +246,7 @@ class API_V1_test_adapter extends PhraseanetWebTestCaseAbstract
|
|||||||
$this->assertTrue((strlen($metadatas->separator) > 0));
|
$this->assertTrue((strlen($metadatas->separator) > 0));
|
||||||
|
|
||||||
$this->assertTrue(is_string($metadatas->thesaurus_branch));
|
$this->assertTrue(is_string($metadatas->thesaurus_branch));
|
||||||
$this->assertTrue(in_array($metadatas->type, array(databox_field::TYPE_DATE, databox_field::TYPE_NUMBER, databox_field::TYPE_TEXT)));
|
$this->assertTrue(in_array($metadatas->type, array(databox_field::TYPE_DATE,databox_field::TYPE_STRING, databox_field::TYPE_NUMBER, databox_field::TYPE_TEXT)));
|
||||||
$this->assertTrue(is_bool($metadatas->indexable));
|
$this->assertTrue(is_bool($metadatas->indexable));
|
||||||
$this->assertTrue(is_bool($metadatas->multivalue));
|
$this->assertTrue(is_bool($metadatas->multivalue));
|
||||||
$this->assertTrue(is_bool($metadatas->readonly));
|
$this->assertTrue(is_bool($metadatas->readonly));
|
||||||
|
@@ -254,7 +254,7 @@ class API_V1_test_adapterYaml extends PhraseanetWebTestCaseAbstract
|
|||||||
$this->assertTrue((strlen($metadatas["separator"]) > 0));
|
$this->assertTrue((strlen($metadatas["separator"]) > 0));
|
||||||
|
|
||||||
$this->assertTrue(is_string($metadatas["thesaurus_branch"]));
|
$this->assertTrue(is_string($metadatas["thesaurus_branch"]));
|
||||||
$this->assertTrue(in_array($metadatas["type"], array(databox_field::TYPE_DATE, databox_field::TYPE_NUMBER, databox_field::TYPE_TEXT)));
|
$this->assertTrue(in_array($metadatas["type"], array(databox_field::TYPE_DATE,databox_field::TYPE_STRING, databox_field::TYPE_NUMBER, databox_field::TYPE_TEXT)));
|
||||||
$this->assertTrue(is_bool($metadatas["indexable"]));
|
$this->assertTrue(is_bool($metadatas["indexable"]));
|
||||||
$this->assertTrue(is_bool($metadatas["multivalue"]));
|
$this->assertTrue(is_bool($metadatas["multivalue"]));
|
||||||
$this->assertTrue(is_bool($metadatas["readonly"]));
|
$this->assertTrue(is_bool($metadatas["readonly"]));
|
||||||
|
@@ -37,12 +37,22 @@ class userTest extends PhraseanetPHPUnitAbstract
|
|||||||
$this->assertFalse(User_Adapter::get_usr_id_from_email(null));
|
$this->assertFalse(User_Adapter::get_usr_id_from_email(null));
|
||||||
self::$user->set_email('');
|
self::$user->set_email('');
|
||||||
$this->assertFalse(User_Adapter::get_usr_id_from_email(null));
|
$this->assertFalse(User_Adapter::get_usr_id_from_email(null));
|
||||||
self::$user->set_email('noonealt1@example.com');
|
self::$user->set_email('noone@example.com');
|
||||||
$this->assertEquals(self::$user->get_id(), User_Adapter::get_usr_id_from_email('noonealt1@example.com'));
|
$this->assertEquals(self::$user->get_id(), User_Adapter::get_usr_id_from_email('noone@example.com'));
|
||||||
}
|
}
|
||||||
catch(Exception $e)
|
catch(Exception $e)
|
||||||
{
|
{
|
||||||
$this->fail($e->getMessage());
|
$this->fail($e->getMessage());
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
self::$user->set_email('noonealt1@example.com');
|
||||||
|
$this->fail('A user already got this address');
|
||||||
|
}
|
||||||
|
catch(Exception $e)
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
$this->assertFalse(User_Adapter::get_usr_id_from_email(null));
|
$this->assertFalse(User_Adapter::get_usr_id_from_email(null));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user