Source for file newuser.inc.php
Documentation is available at newuser.inc.php
* test case for new-user functions
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* @author m2mtech <tech@m2m.at>
* @copyright 2007 m2m server software gmbh
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License Version 2
* @version $Id: newuser.inc.php 59 2007-04-24 13:23:59Z m2mtech $
* @link http://www.ea-geier.at/
require_once('code/base/newuser.inc.php');
* helper class - input validator
require_once('code/base/input.class.php');
Mock::generate('eaInput');
* helper class - database
require_once('code/base/db.class.php');
* test case for new-user functions
$this->UnitTestCase('Test New-User Functions');
* tests option generation
* - no real functionality at the moment
$this->assertFalse(saveNewUser($db, $in), 'no post data');
$_POST['buttonNewUser'] = true; // button pressed
$in->error = array('testinputerror' => true);
$in->post = array('mail' => 'testmail', 'pass' => 'testpass');
$in->post = array('mail' => 'testmail', 'pass' => 'testpass', 'txtName' => 'testname');
$db->setReturnValueAt(0, 'isUser', true);
$db->setReturnValueAt(1, 'isUser', false);
$db->setReturnValue('createUser', true);
$result = array('mail' => 'testmail', 'pw' => 'testpass', 'name' => 'testname');
$db->expect('createUser', array($result));
unset ($_POST['buttonNewUser']);
|