mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 14:33:14 +00:00
Merge branch 'master' of github.com:alchemy-fr/Phraseanet
This commit is contained in:
@@ -246,7 +246,7 @@ class API_V1_test_adapter extends PhraseanetWebTestCaseAbstract
|
||||
$this->assertTrue((strlen($metadatas->separator) > 0));
|
||||
|
||||
$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->multivalue));
|
||||
$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(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["multivalue"]));
|
||||
$this->assertTrue(is_bool($metadatas["readonly"]));
|
||||
|
59
lib/unitTest/userTest.php
Normal file
59
lib/unitTest/userTest.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2010 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
|
||||
require_once dirname(__FILE__) . '/PhraseanetPHPUnitAbstract.class.inc';
|
||||
|
||||
/**
|
||||
*
|
||||
* @package
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
|
||||
|
||||
|
||||
class userTest extends PhraseanetPHPUnitAbstract
|
||||
{
|
||||
|
||||
|
||||
public function testMail()
|
||||
{
|
||||
$this->assertFalse(User_Adapter::get_usr_id_from_email(null));
|
||||
try
|
||||
{
|
||||
$appbox = appbox::get_instance();
|
||||
|
||||
self::$user->set_email(null);
|
||||
|
||||
$this->assertFalse(User_Adapter::get_usr_id_from_email(null));
|
||||
self::$user->set_email('');
|
||||
$this->assertFalse(User_Adapter::get_usr_id_from_email(null));
|
||||
self::$user->set_email('noone@example.com');
|
||||
$this->assertEquals(self::$user->get_id(), User_Adapter::get_usr_id_from_email('noone@example.com'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
$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));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user