Index: trunk/phase3/maintenance/parserTests.inc |
— | — | @@ -825,8 +825,25 @@ |
826 | 826 | 'img_metadata' => serialize( array() ), |
827 | 827 | ) ); |
828 | 828 | |
| 829 | + # This image will be blacklisted in [[MediaWiki:Bad image list]] |
| 830 | + $db->insert( 'image', array( |
| 831 | + 'img_name' => 'Bad.jpg', |
| 832 | + 'img_size' => 12345, |
| 833 | + 'img_description' => 'zomgnotcensored', |
| 834 | + 'img_user' => 1, |
| 835 | + 'img_user_text' => 'WikiSysop', |
| 836 | + 'img_timestamp' => $db->timestamp( '20010115123500' ), |
| 837 | + 'img_width' => 320, |
| 838 | + 'img_height' => 240, |
| 839 | + 'img_bits' => 24, |
| 840 | + 'img_media_type' => MEDIATYPE_BITMAP, |
| 841 | + 'img_major_mime' => "image", |
| 842 | + 'img_minor_mime' => "jpeg", |
| 843 | + 'img_metadata' => serialize( array() ), |
| 844 | + ) ); |
| 845 | + |
829 | 846 | # Update certain things in site_stats |
830 | | - $db->insert( 'site_stats', array( 'ss_row_id' => 1, 'ss_images' => 1, 'ss_good_articles' => 1 ) ); |
| 847 | + $db->insert( 'site_stats', array( 'ss_row_id' => 1, 'ss_images' => 2, 'ss_good_articles' => 1 ) ); |
831 | 848 | |
832 | 849 | # Reinitialise the LocalisationCache to match the database state |
833 | 850 | Language::getLocalisationCache()->unloadAll(); |
— | — | @@ -896,6 +913,9 @@ |
897 | 914 | } |
898 | 915 | wfMkdirParents( $dir . '/3/3a' ); |
899 | 916 | copy( "$IP/skins/monobook/headbg.jpg", "$dir/3/3a/Foobar.jpg" ); |
| 917 | + |
| 918 | + wfMkdirParents( $dir . '/0/09' ); |
| 919 | + copy( "$IP/skins/monobook/headbg.jpg", "$dir/0/09/Bad.jpg" ); |
900 | 920 | return $dir; |
901 | 921 | } |
902 | 922 | |
— | — | @@ -931,6 +951,8 @@ |
932 | 952 | "$dir/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg", |
933 | 953 | "$dir/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg", |
934 | 954 | "$dir/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg", |
| 955 | + |
| 956 | + "$dir/0/09/Bad.jpg", |
935 | 957 | ) |
936 | 958 | ); |
937 | 959 | |
— | — | @@ -943,6 +965,10 @@ |
944 | 966 | "$dir/thumb/3/3a/Foobar.jpg", |
945 | 967 | "$dir/thumb/3/3a", |
946 | 968 | "$dir/thumb/3", |
| 969 | + |
| 970 | + "$dir/0/09/", |
| 971 | + "$dir/0/", |
| 972 | + |
947 | 973 | "$dir/thumb", |
948 | 974 | "$dir", |
949 | 975 | ) |
— | — | @@ -1095,6 +1121,7 @@ |
1096 | 1122 | * @param int $line the input line number, for reporting errors |
1097 | 1123 | */ |
1098 | 1124 | private function addArticle($name, $text, $line) { |
| 1125 | + global $wgMessageCache; |
1099 | 1126 | $this->setupGlobals(); |
1100 | 1127 | $title = Title::newFromText( $name ); |
1101 | 1128 | if ( is_null($title) ) { |
— | — | @@ -1108,6 +1135,10 @@ |
1109 | 1136 | |
1110 | 1137 | $art = new Article($title); |
1111 | 1138 | $art->insertNewArticle($text, '', false, false ); |
| 1139 | + if( $title->getNamespace() == NS_MEDIAWIKI ) { |
| 1140 | + $wgMessageCache->replace( $title->getDBkey(), $text ); |
| 1141 | + } |
| 1142 | + |
1112 | 1143 | $this->teardownGlobals(); |
1113 | 1144 | } |
1114 | 1145 | |
Index: trunk/phase3/maintenance/parserTests.txt |
— | — | @@ -7812,7 +7812,18 @@ |
7813 | 7813 | |
7814 | 7814 | !! end |
7815 | 7815 | |
| 7816 | +!!article |
| 7817 | +MediaWiki:bad image list |
| 7818 | +!!text |
| 7819 | +* [[File:Bad.jpg]] except [[Nasty page]] |
| 7820 | +!!endarticle |
7816 | 7821 | |
| 7822 | +!! test |
| 7823 | +Bad images - basic functionality |
| 7824 | +!! input |
| 7825 | +[[File:Bad.jpg]] |
| 7826 | +!! result |
| 7827 | +!! end |
7817 | 7828 | |
7818 | 7829 | |
7819 | 7830 | TODO: |