Simpletest MockLanguage not working???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
newsdigitalmedia
Forum Newbie
Posts: 1
Joined: Sun Feb 17, 2008 11:34 pm

Simpletest MockLanguage not working???

Post by newsdigitalmedia »

Hello all,

I am using simpletest with mock objects to create a test case class for an expression engine platform. the code is as follows:

<?php

if (!defined('EXT'))
{
define('EXT', '.php');
}

$server_root = <somewhere>;
$ee_root = <somewhere else>;

require_once($server_root.'simpletest/unit_tester.php');
require_once($server_root.'simpletest/mock_objects.php');
require_once($server_root.'simpletest/reporter.php');

require_once('<somewhere>/mod.search_alt.php');

require_once($ee_root.'system/db/db.mysql.php');
require_once($ee_root.'system/core/core.functions.php');
require_once($ee_root.'system/core/core.input.php');
require_once($ee_root.'system/core/core.language.php');
require_once($ee_root.'system/core/core.template.php');

Mock::generate('Language');
$LANG = &new MockLanguage();

class Test_search_alt extends UnitTestCase
{
function Test_search_alt()
{
$this->UnitTestCase('Sample Class Test');
}

function test1()
{
$search = new search_alt();
$this->assertTrue( true );
}
}

$test = &new Test_search_alt();
$test->run(new TextReporter());

?>

the output with I run from the command prompt (windows) php <the above php file> is...

PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_svn.dll' - The specified module could not be found.
in Unknown on line 0
PHP Fatal error: Call to a member function tell() on a non-object in <simpletest install dir>\mock_objects.php on line 419

Forget the warning, the fatal error is what troubles me. Any ideas what I am doing wrong? any thoughts appreciated.

whall
Post Reply