diff options
| author | Nils Adermann <naderman@naderman.de> | 2011-09-18 23:24:13 +0200 |
|---|---|---|
| committer | Nils Adermann <naderman@naderman.de> | 2011-09-18 23:24:13 +0200 |
| commit | 2731e5a456a6d3da0b8926f63b2a4d440bfe439e (patch) | |
| tree | 6ea3439496aacea16b5197bf16d26f1c716e5232 /tests | |
| parent | bf5d453479ed572692209b7acf71f3e9c0e97cc7 (diff) | |
| parent | 94fead702a450dbbd25b58d68d132a9e476bae44 (diff) | |
| download | forums-2731e5a456a6d3da0b8926f63b2a4d440bfe439e.tar forums-2731e5a456a6d3da0b8926f63b2a4d440bfe439e.tar.gz forums-2731e5a456a6d3da0b8926f63b2a4d440bfe439e.tar.bz2 forums-2731e5a456a6d3da0b8926f63b2a4d440bfe439e.tar.xz forums-2731e5a456a6d3da0b8926f63b2a4d440bfe439e.zip | |
Merge branch 'develop-olympus' into develop
* develop-olympus:
[ticket/10369] Replace root path with "[ROOT]" as per IRC.
[ticket/10369] Add warning about paths outside of phpBB root not being filtered
[ticket/10369] Rename filter_errfile() to filter_root_path().
[ticket/10369] DRY code to remove phpbb path from errfile.
[ticket/10369] Always include errfile and errline in format_errors().
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/error_collector_test.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/error_collector_test.php b/tests/error_collector_test.php new file mode 100644 index 0000000000..e1ac32f5ac --- /dev/null +++ b/tests/error_collector_test.php @@ -0,0 +1,35 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +require_once dirname(__FILE__) . '/../phpBB/includes/functions.php'; +require_once dirname(__FILE__) . '/../phpBB/includes/error_collector.php'; + +class phpbb_error_collector_test extends phpbb_test_case +{ + public function test_collection() + { + $collector = new phpbb_error_collector; + $collector->install(); + + // Cause a warning + 1/0; $line = __LINE__; + + $collector->uninstall(); + + list($errno, $msg_text, $errfile, $errline) = $collector->errors[0]; + $error_contents = $collector->format_errors(); + + $this->assertEquals($errno, 2); + + // Unfortunately $error_contents will contain the full path here, + // because the tests directory is outside of phpbb root path. + $this->assertStringStartsWith('Errno 2: Division by zero at ', $error_contents); + $this->assertStringEndsWith(" line $line", $error_contents); + } +} |
