r67783 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67782‎ | r67783 | r67784 >
Date:07:55, 10 June 2010
Author:daniel
Status:deferred
Tags:
Comment:
removed TESTME markers where tests exist
Modified paths:
  • /trunk/extensions/DataTransclusion/DBDataTransclusionSource.php (modified) (history)
  • /trunk/extensions/DataTransclusion/DataTransclusionHandler.php (modified) (history)
  • /trunk/extensions/DataTransclusion/WebDataTransclusionSource.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DataTransclusion/DataTransclusionHandler.php
@@ -88,7 +88,7 @@
8989 // find out which data source to use...
9090 if ( empty( $argv['source'] ) ) {
9191 if ( empty( $argv[1] ) ) {
92 - return DataTransclusionHandler::errorMessage( 'datatransclusion-missing-source', $asHTML ); // TESTME
 92+ return DataTransclusionHandler::errorMessage( 'datatransclusion-missing-source', $asHTML );
9393 } else {
9494 $sourceName = $argv[1];
9595 }
@@ -98,7 +98,7 @@
9999
100100 $source = DataTransclusionHandler::getDataSource( $sourceName );
101101 if ( empty( $source ) ) {
102 - return DataTransclusionHandler::errorMessage( 'datatransclusion-unknown-source', $asHTML, $sourceName ); // TESTME
 102+ return DataTransclusionHandler::errorMessage( 'datatransclusion-unknown-source', $asHTML, $sourceName );
103103 }
104104
105105 // find out how to find the desired record
@@ -110,14 +110,14 @@
111111
112112 $keyFields = $source->getKeyFields();
113113 if ( ! in_array( $by, $keyFields ) ) {
114 - return DataTransclusionHandler::errorMessage( 'datatransclusion-bad-argument-by', $asHTML, $sourceName, $by, join( ', ', $keyFields ) ); // TESTME
 114+ return DataTransclusionHandler::errorMessage( 'datatransclusion-bad-argument-by', $asHTML, $sourceName, $by, join( ', ', $keyFields ) );
115115 }
116116
117117 if ( !empty( $argv['key'] ) ) {
118118 $key = $argv['key'];
119119 } else if ( $key === null || $key === false ) {
120120 if ( empty( $argv[2] ) ) {
121 - return DataTransclusionHandler::errorMessage( 'datatransclusion-missing-argument-key', $asHTML ); // TESTME
 121+ return DataTransclusionHandler::errorMessage( 'datatransclusion-missing-argument-key', $asHTML );
122122 } else {
123123 $key = $argv[2];
124124 }
@@ -126,7 +126,7 @@
127127 // find out how to render the record
128128 if ( empty( $argv['template'] ) ) {
129129 if ( empty( $argv[3] ) ) {
130 - return DataTransclusionHandler::errorMessage( 'datatransclusion-missing-argument-template', $asHTML ); // TESTME
 130+ return DataTransclusionHandler::errorMessage( 'datatransclusion-missing-argument-template', $asHTML );
131131 } else {
132132 $template = $argv[3];
133133 }
@@ -136,12 +136,12 @@
137137
138138 // load the record
139139 $record = $source->fetchRecord( $by, $key );
140 - if ( empty( $record ) ) return DataTransclusionHandler::errorMessage( 'datatransclusion-record-not-found', $asHTML, $sourceName, $by, $key ); // TESTME
 140+ if ( empty( $record ) ) return DataTransclusionHandler::errorMessage( 'datatransclusion-record-not-found', $asHTML, $sourceName, $by, $key );
141141
142142 // render the record into wiki text
143143 $t = Title::newFromText( $template, NS_TEMPLATE );
144144 if ( empty( $t ) ) {
145 - return DataTransclusionHandler::errorMessage( 'datatransclusion-bad-template-name', $asHTML, $template ); // TESTME
 145+ return DataTransclusionHandler::errorMessage( 'datatransclusion-bad-template-name', $asHTML, $template );
146146 }
147147
148148 // FIXME: log the template we used into the parser output, like regular template use
@@ -153,20 +153,20 @@
154154 $text = $handler->render( $record );
155155
156156 if ( $text === false ) {
157 - return DataTransclusionHandler::errorMessage( 'datatransclusion-unknown-template', $asHTML, $template ); // TESTME
 157+ return DataTransclusionHandler::errorMessage( 'datatransclusion-unknown-template', $asHTML, $template );
158158 }
159159
160160 // set parser output expiry
161161 $expire = $source->getCacheDuration();
162162 if ( $expire !== false && $expire !== null ) {
163 - $parser->getOutput()->updateCacheExpiry( $expire ); // NOTE: this works only since r67185 //TESTME
 163+ $parser->getOutput()->updateCacheExpiry( $expire ); // NOTE: this works only since r67185 //TESTME (how?)
164164 }
165165
166166 if ( $asHTML && $parser ) { // render into HTML if desired
167167 $html = $parser->recursiveTagParse( $text );
168 - return $html; // TESTME
 168+ return $html;
169169 } else {
170 - return $text; // TESTME
 170+ return $text;
171171 }
172172 }
173173
@@ -213,7 +213,7 @@
214214 $article = new Article( $this->template );
215215
216216 if ( !$article->exists() ) {
217 - return false; // TESTME
 217+ return false;
218218 }
219219
220220 $text = $article->getContent();
@@ -236,12 +236,12 @@
237237 $v = '';
238238 }
239239
240 - $rec[ $f ] = $this->sanitizeValue( $v ); // TESTME
 240+ $rec[ $f ] = $this->sanitizeValue( $v );
241241 }
242242
243243 // add source meta info, so we can render links back to the source,
244244 // provide license info, etc
245 - $info = $this->source->getSourceInfo(); // TESTME
 245+ $info = $this->source->getSourceInfo();
246246 foreach ( $info as $f => $v ) {
247247 if ( is_array( $v ) || is_object( $v ) || is_resource( $v ) ) {
248248 continue;
Index: trunk/extensions/DataTransclusion/WebDataTransclusionSource.php
@@ -74,22 +74,22 @@
7575 }
7676
7777 public function fetchRecord( $field, $value ) {
78 - $raw = $this->loadRecordData( $field, $value ); // TESTME
 78+ $raw = $this->loadRecordData( $field, $value ); // TESTME
7979 if ( !$raw ) {
8080 return false; // TODO: log error?
8181 }
8282
83 - $data = $this->decodeData( $raw, $this->dataFormat ); // TESTME
 83+ $data = $this->decodeData( $raw, $this->dataFormat );
8484 if ( !$data ) {
8585 return false; // TODO: log error?
8686 }
8787
88 - $err = $this->extractError( $data ); // TESTME
 88+ $err = $this->extractError( $data );
8989 if ( $err ) {
9090 return false; // TODO: log error?
9191 }
9292
93 - $rec = $this->extractRecord( $data ); // TESTME
 93+ $rec = $this->extractRecord( $data );
9494 if ( !$rec ) {
9595 return false; // TODO: log error?
9696 }
@@ -130,7 +130,7 @@
131131 }
132132
133133 if ( $format == 'php' ) {
134 - return unserialize( $raw ); // TESTME
 134+ return unserialize( $raw );
135135 }
136136
137137 return false;
Index: trunk/extensions/DataTransclusion/DBDataTransclusionSource.php
@@ -88,10 +88,10 @@
8989 return false; // redundant, but make extra sure we don't get anythign evil here //TESTME
9090 }
9191
92 - $value = $this->convertKey( $field, $value ); // TESTME
 92+ $value = $this->convertKey( $field, $value );
9393
9494 if ( is_string( $value ) ) {
95 - $v = $db->addQuotes( $value ); // TESTME
 95+ $v = $db->addQuotes( $value );
9696 } else {
9797 $v = $value;
9898 }

Status & tagging log