Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #527 from norv/unittest
Unit testing
- Loading branch information
Showing
138 changed files
with
44,543 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
define('TESTDIR', dirname(__FILE__) . '/'); | ||
|
||
require_once('simpletest/autorun.php'); | ||
|
||
// SSI mode should work for most tests. (core and subs) | ||
// For web tester tests, it should not be necessary. | ||
// For install/upgrade, if we even can test those, SSI is a no-no. | ||
// Might wanna make two or three different suites. | ||
require_once('../SSI.php'); | ||
|
||
/** | ||
* All tests suite. This suite adds all files/classes/folders currently | ||
* being tested. | ||
* | ||
* To run all tests, execute php all_tests.php in tests directory | ||
* Or, scripturl/tests/all_tests.php | ||
*/ | ||
class AllTests extends TestSuite | ||
{ | ||
function AllTests() | ||
{ | ||
$this->TestSuite('All tests'); | ||
|
||
// controllers (web tests) | ||
$this->addFile('sources/controllers/TestAuth.php'); | ||
|
||
// admin controllers (web tests) | ||
$this->addFile('sources/admin/TestManageBoardsSettings.php'); | ||
$this->addFile('sources/admin/TestManagePostsSettings.php'); | ||
|
||
// install | ||
$this->addFile('install/TestInstall.php'); | ||
|
||
// core sources | ||
$this->addFile('sources/TestLogging.php'); | ||
|
||
// subs APIs | ||
$this->addFile('sources/subs/TestBoards.subs.php'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
require_once(TESTDIR . 'simpletest/autorun.php'); | ||
require_once(TESTDIR . 'simpletest/web_tester.php'); | ||
// require_once('../install/install.php'); | ||
|
||
/** | ||
* TestCase class for installer script | ||
*/ | ||
class TestInstall extends WebTestCase | ||
{ | ||
function setUp() | ||
{ | ||
global $scripturl; | ||
|
||
// it'd be kinda difficult without this :P | ||
$this->scripturl = $scripturl; | ||
} | ||
|
||
function testWelcome() | ||
{ | ||
$this->get(substr($this->scripturl, 0, -9) . '/install.php'); | ||
$this->assertTitle('ELKARTE Installer'); | ||
$this->assertText('Welcome to ELKARTE. This script will guide you through the process for installing'); | ||
|
||
// Mmm... | ||
$this->assertText('continuing with installation may result in the loss or corruption of existing data.'); | ||
} | ||
} |
Oops, something went wrong.