* Copyright 2001-2010 Strangecode, LLC * * This file is part of The Strangecode Codebase. * * The Strangecode Codebase 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 3 of the License, or (at your option) * any later version. * * The Strangecode Codebase 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 * The Strangecode Codebase. If not, see . */ /** * PHPUnit test case for codebase/lib/SpellCheck.inc.php * * The method skeletons below need to be filled in with * real data so that the tests will run correctly. Replace * all EXPECTED_VAL and PARAM strings with real data. * * Created with PHPUnit_Skeleton on 2005-08-09 */ require_once 'PHPUnit.php'; class SpellCheckTest extends PHPUnit_TestCase { var $SpellCheck; function SpellCheckTest($name) { $this->PHPUnit_TestCase($name); } function setUp() { require dirname(__FILE__) . '/_config.inc.php'; require_once '../lib/SpellCheck.inc.php'; $this->SpellCheck =& new SpellCheck(PARAM); } function tearDown() { unset($this->SpellCheck); } function test_setparam() { $result = $this->SpellCheck->setparam(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_getparam() { $result = $this->SpellCheck->getparam(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_anyerrors() { $result = $this->SpellCheck->anyerrors(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_reseterrorlist() { $result = $this->SpellCheck->reseterrorlist(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_check() { $result = $this->SpellCheck->check(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_suggest() { $result = $this->SpellCheck->suggest(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_add() { $result = $this->SpellCheck->add(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_save() { $result = $this->SpellCheck->save(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_getstringsuggestions() { $result = $this->SpellCheck->getstringsuggestions(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_checkstring() { $result = $this->SpellCheck->checkstring(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_getstringhighlighted() { $result = $this->SpellCheck->getstringhighlighted(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_printcorrectionform() { $result = $this->SpellCheck->printcorrectionform(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_anyformcorrections() { $result = $this->SpellCheck->anyformcorrections(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_applyformcorrections() { $result = $this->SpellCheck->applyformcorrections(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } } // Running the test. $suite = new PHPUnit_TestSuite('SpellCheckTest'); $result = PHPUnit::run($suite); echo $result->toString(); ?>