All pastes #13370 Raw Edit

first unittest

public php v1 · immutable
#13370 ·published 2005-06-04 11:44 UTC
rendered paste body
<?php/* * PHPasteBin - A PasteBin written in PHP * Copyright (C) 2005 Jeroen Budts * * 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. */define('ROOT',        '../../');define('SYSTEM_ROOT', ROOT . 'system/');define('LIBS_ROOT',   ROOT . 'libs/');require_once SYSTEM_ROOT . 'system_functions.php';require_once LIBS_ROOT   . 'simpletest/unit_tester.php';require_once LIBS_ROOT   . 'simpletest/reporter.php';using('entities.BaseEntity',SYSTEM_ROOT);define('UT_ENTITY_ID', 123);/** * Basic Tests for the Paste entity. * @package be_lightyear_phpastebin * @subpackage entities */class TestBaseEntity extends UnitTestCase {	var $_baseEntity = null;	function setUp() {		// i know BaseEntity is defined as being abstract		// but php is just a hack so i'll happely hack here too :)		// (just for the test, i promise ;) )		$this->_baseEntity = new BaseEntity();		$this->_baseEntity->setId(UT_ENTITY_ID);	}	function tearDown() {		$this->_baseEntity = null;	}	/**	 * Tries to get the name.	 */	function testGetName() {		$this->assertEqual(UT_ENTITY_ID, $this->_baseEntity->getId());	}}if (INSIDE_GROUP_TEST != "yes") {	$test = &new TestBaseEntity();	$test->run(new HtmlReporter());}/*jedit edit rules | http://jedit.org: powerful, open-source (gpl) texteditor:mode=php:tabSize=4:indentSize=4:noTabs=false:encoding=UTF-8::folding=indent:collapseFolds=0:wrap=none:maxLineLen=85:*/?>