Fix unit tests

This commit is contained in:
Romain Neutron
2013-01-28 19:31:26 +01:00
parent 2fb0c60157
commit aa18c48306
43 changed files with 582 additions and 256 deletions

View File

@@ -110,6 +110,12 @@ class User_Query implements User_QueryInterface
*/
protected $only_templates = false;
/**
*
* @var boolean
*/
protected $email_not_null = false;
/**
*
* @var Array
@@ -222,6 +228,10 @@ class User_Query implements User_QueryInterface
$sql .= ' AND usr.invite=0 ';
}
if ( ! $this->email_not_null) {
$sql .= ' AND usr.usr_mail IS NOT NULL ';
}
if ($this->only_templates === true) {
$sql .= ' AND model_of = ' . $this->app['phraseanet.user']->get_id();
} elseif ($this->include_templates === false) {
@@ -439,6 +449,18 @@ class User_Query implements User_QueryInterface
return $this;
}
/**
*
* @param boolean $boolean
* @return User_Query
*/
public function email_not_null($boolean)
{
$this->email_not_null = ! ! $boolean;
return $this;
}
/**
*
* @param array $rights