예제 #1
0
<?php

/********************************************************************************
 *
 *  Xataface Web Application Framework for PHP and MySQL
 *  Copyright (C) 2005  Steve Hannah <*****@*****.**>
 *  
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *  
 *  This library 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
 *  Lesser General Public License for more details.
 *  
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 *===============================================================================
 */
require_once 'Table_builderTest.php';
$test = new PHPUnit_TestSuite('Table_builderTest');
$result = new PHPUnit_TestResult();
//$result->addListener(new Benchmarker());
$test->run($result);
print $result->toHtml();
        $user = new User();
        $user->first_name = 'Gaurav';
        $user->last_name = 'Bhatnagar';
        $user->homepage = 'http://www.newdelhitimes.org';
        $user->login_name = 'gaurav';
        $user->password = md5('password1');
        $user->email = '*****@*****.**';
        $user->save();
      }
      else {
        throw $e;
      }
    }

    $newuser = new User();
    $newuser->load('gaurav');
    $this->assertTrue($newuser->first_name == 'Gaurav');
    $newuser->delete();
    $this->assertTrue($newuser->is_active == FALSE);
  }
}

$suite = new PHPUnit_TestSuite();
$suite->addTest(new UserTestCase('testUserCRUD'));
$result = new PHPUnit_TestResult();
$suite->run($result);

print($result->toString());

?>