dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Leave table names with numbers untouched in DatabaseBase::generalizeSQL"
[lhc/web/wiklou.git]
/
tests
/
testHelpers.inc
diff --git
a/tests/testHelpers.inc
b/tests/testHelpers.inc
index
818b24e
..
8c24f39
100644
(file)
--- a/
tests/testHelpers.inc
+++ b/
tests/testHelpers.inc
@@
-318,7
+318,7
@@
class DbTestRecorder extends DbTestPreviewer {
array(
'tr_date' => $this->db->timestamp(),
'tr_mw_version' => $this->version,
array(
'tr_date' => $this->db->timestamp(),
'tr_mw_version' => $this->version,
- 'tr_php_version' =>
phpversion()
,
+ 'tr_php_version' =>
PHP_VERSION
,
'tr_db_version' => $this->db->getServerVersion(),
'tr_uname' => php_uname()
),
'tr_db_version' => $this->db->getServerVersion(),
'tr_uname' => php_uname()
),
@@
-465,6
+465,22
@@
class TestFileIterator implements Iterator {
continue;
}
continue;
}
+ if ( $this->section == 'endtransparenthooks' ) {
+ $this->checkSection( 'transparenthooks' );
+
+ foreach ( explode( "\n", $this->sectionData['transparenthooks'] ) as $line ) {
+ $line = trim( $line );
+
+ if ( $line ) {
+ $delayedParserTest->requireTransparentHook( $line );
+ }
+ }
+
+ $this->clearSection();
+
+ continue;
+ }
+
if ( $this->section == 'end' ) {
$this->checkSection( 'test' );
// "input" and "result" are old section names allowed
if ( $this->section == 'end' ) {
$this->checkSection( 'test' );
// "input" and "result" are old section names allowed
@@
-601,6
+617,7
@@
class DelayedParserTest {
/** Initialized on construction */
private $hooks;
private $fnHooks;
/** Initialized on construction */
private $hooks;
private $fnHooks;
+ private $transparentHooks;
public function __construct() {
$this->reset();
public function __construct() {
$this->reset();
@@
-613,6
+630,7
@@
class DelayedParserTest {
public function reset() {
$this->hooks = array();
$this->fnHooks = array();
public function reset() {
$this->hooks = array();
$this->fnHooks = array();
+ $this->transparentHooks = array();
}
/**
}
/**
@@
-641,6
+659,14
@@
class DelayedParserTest {
}
}
}
}
+ # Trigger delayed transparent hooks. Any failure will make us abort
+ foreach ( $this->transparentHooks as $hook ) {
+ $ret = $parserTest->requireTransparentHook( $hook );
+ if ( !$ret ) {
+ return false;
+ }
+ }
+
# Delayed execution was successful.
return true;
}
# Delayed execution was successful.
return true;
}
@@
-663,6
+689,15
@@
class DelayedParserTest {
$this->fnHooks[] = $fnHook;
}
$this->fnHooks[] = $fnHook;
}
+ /**
+ * Similar to ParserTest object but does not run anything
+ * Use unleash() to really execute the hook function
+ * @param string $fnHook
+ */
+ public function requireTransparentHook( $hook ) {
+ $this->transparentHooks[] = $hook;
+ }
+
}
/**
}
/**
@@
-674,11
+709,12
@@
class DjVuSupport {
* Initialises DjVu tools global with default values
*/
public function __construct() {
* Initialises DjVu tools global with default values
*/
public function __construct() {
- global $wgDjvuRenderer, $wgDjvuDump, $wgDjvuToXML, $wgFileExtensions;
+ global $wgDjvuRenderer, $wgDjvuDump, $wgDjvuToXML, $wgFileExtensions
, $wgDjvuTxt
;
$wgDjvuRenderer = $wgDjvuRenderer ? $wgDjvuRenderer : '/usr/bin/ddjvu';
$wgDjvuDump = $wgDjvuDump ? $wgDjvuDump : '/usr/bin/djvudump';
$wgDjvuToXML = $wgDjvuToXML ? $wgDjvuToXML : '/usr/bin/djvutoxml';
$wgDjvuRenderer = $wgDjvuRenderer ? $wgDjvuRenderer : '/usr/bin/ddjvu';
$wgDjvuDump = $wgDjvuDump ? $wgDjvuDump : '/usr/bin/djvudump';
$wgDjvuToXML = $wgDjvuToXML ? $wgDjvuToXML : '/usr/bin/djvutoxml';
+ $wgDjvuTxt = $wgDjvuTxt ? $wgDjvuTxt : '/usr/bin/djvutxt';
if ( !in_array( 'djvu', $wgFileExtensions ) ) {
$wgFileExtensions[] = 'djvu';
if ( !in_array( 'djvu', $wgFileExtensions ) ) {
$wgFileExtensions[] = 'djvu';
@@
-691,10
+727,11
@@
class DjVuSupport {
* @return bool
*/
public function isEnabled() {
* @return bool
*/
public function isEnabled() {
- global $wgDjvuRenderer, $wgDjvuDump, $wgDjvuToXML;
+ global $wgDjvuRenderer, $wgDjvuDump, $wgDjvuToXML
, $wgDjvuTxt
;
return is_executable( $wgDjvuRenderer )
&& is_executable( $wgDjvuDump )
return is_executable( $wgDjvuRenderer )
&& is_executable( $wgDjvuDump )
- && is_executable( $wgDjvuToXML );
+ && is_executable( $wgDjvuToXML )
+ && is_executable( $wgDjvuTxt );
}
}
}
}