"README.md" did not exist on "cd783d3af67609cc3e0624d8cb613e0bc58062bf"
Select Git revision
sets.key.js
Forked from
SOFT Core / SOFT 260 / JavaScript Practice
Source project has a limited visibility.
-
Brady James Garvin authoredBrady James Garvin authored
UserTest.php 5.71 KiB
<?php
/* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* \file test/phpunit/UserTest.php
* \ingroup test
* \brief This file is an example for a PHPUnit test
* \version $Id$
* \remarks To run this script as CLI: phpunit filename.php
*/
global $conf,$user,$langs,$db;
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
require_once 'PHPUnit/Framework.php';
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
require_once dirname(__FILE__).'/../../htdocs/user/class/user.class.php';
if (empty($user->id))
{
print "Load permissions for admin user nb 1\n";
$user->fetch(1);
$user->getrights();
}
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
/**
* @backupGlobals disabled
* @backupStaticAttributes enabled
* @covers DoliDb
* @covers Translate
* @covers Conf
* @covers Interfaces
* @covers CommonObject
* @covers User
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
*/
class UserTest extends PHPUnit_Framework_TestCase
{
protected $savconf;
protected $savuser;
protected $savlangs;
protected $savdb;
/**
* Constructor
* We save global variables into local variables
*
* @return UserTest
*/
function UserTest()
{
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;