the version information i collected is below
Code: Select all
@version SVN: $Id: TestSuite.php 537 2007-02-24 06:58:18Z sb $any ideas? any working example is deeply appreciated.
Moderator: General Moderators
Code: Select all
@version SVN: $Id: TestSuite.php 537 2007-02-24 06:58:18Z sb $Code: Select all
<?php
##echo "<br />" . __FILE__;
##echo "<br />" . $_SERVER['PHP_SELF'];
//initialize
require_once( "../include.php" );
setIncludePath( '/var/www/html/CDF/backend/modules/' );
//build test case
require_once( '../../helpers/SupplierHelper.php' );
require_once( 'PHPUnit/Framework/TestCase.php' );
class SupplierHelperTest extends PHPUnit_Framework_TestCase{
public function __construct( $name ){
parent::__construct( $name );
}
//some code removed
//5
public function testFindCodeFromSAN(){
$result = SupplierHelper::findSupplierInfoFromInfo( 'SAN', '1697978', 'Code' );
$result1 = SupplierHelper::findSupplierInfoFromInfo( 'SAN', '1556150', 'Code' );
if( $result && $result1 ) $this->pass();
else $this->fail( 'did not pass' );
##$this->assertEquals( 'ING', $result );
}
//some code removed
}
?>
<?php
require_once( 'PHPUnit/Framework/TestSuite.php' );
require_once( 'PHPUnit/TextUI/TestRunner.php' );
$suite = new PHPUnit_Framework_TestSuite;
##$suite->addTest( new SupplierHelperTest( 'testFindSupplierID' ) );
$suite->addTestSuite( 'SupplierHelperTest' );
PHPUnit_TextUI_TestRunner::run( $suite );
?>
Code: Select all
PHPUnit 3.1.2 by Sebastian Bergmann.
....PHP Fatal error: Call to undefined method SupplierHelperTest::pass() in /va r/www/html/CDF/backend/testing/helpersTest/SupplierHelperTest.php on line 48
[root@mail helpersTest]#Code: Select all
try {
$op = new OID();
$op->start();
} catch (Exception $e) {
$this->fail(); // Fail gracefully without interrupting testrun from an uncaught exception
}Code: Select all
public function testFindCodeFromSAN(){
$result = SupplierHelper::findSupplierInfoFromInfo( 'SAN', '1697978', 'Code' );
$result1 = SupplierHelper::findSupplierInfoFromInfo( 'SAN', '1556150', 'Code' );
if( !( $result == 'ING' && $result1 == 'BT' ) ) $this->fail();
##$this->assertEquals( 'ING', $result );
}