jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/360235 )
Change subject: build: Updating mediawiki/mediawiki-codesniffer to 0.9.0 ...................................................................... build: Updating mediawiki/mediawiki-codesniffer to 0.9.0 The following sniffs are failing and were disabled: * MediaWiki.Commenting.FunctionComment.MissingParamName * MediaWiki.Commenting.FunctionComment.MissingParamTag * MediaWiki.Commenting.FunctionComment.MissingReturn * MediaWiki.FunctionComment.Missing.Protected * MediaWiki.FunctionComment.Missing.Public * MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment Change-Id: I990846c669dddb5e3ae8c8739ee902be6459baa7 --- M .gitignore M PagedTiffHandler_body.php M composer.json M phpcs.xml M selenium/PagedTiffHandlerTestCases.php M selenium/PagedTiffHandlerTestSuite.php M selenium/PagedTiffHandler_tests.php M tests/PagedTiffHandlerTest.php 8 files changed, 24 insertions(+), 28 deletions(-) Approvals: Umherirrender: Looks good to me, approved jenkins-bot: Verified diff --git a/.gitignore b/.gitignore index e65c3c5..d6192df 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ .*.swp node_modules/ /vendor +composer.lock diff --git a/PagedTiffHandler_body.php b/PagedTiffHandler_body.php index a8a57e8..eb34a4e 100644 --- a/PagedTiffHandler_body.php +++ b/PagedTiffHandler_body.php @@ -156,7 +156,7 @@ */ function validateParam( $name, $value ) { if ( in_array( $name, [ 'width', 'height', 'page', 'lossy' ] ) ) { - if ( $name === 'page' && trim( $value ) !== (string) intval( $value ) ) { + if ( $name === 'page' && trim( $value ) !== (string)intval( $value ) ) { // Extra junk on the end of page, probably actually a caption // e.g. [[File:Foo.tiff|thumb|Page 3 of the document shows foo]] return false; diff --git a/composer.json b/composer.json index b8f68fb..4a8c744 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", "jakub-onderka/php-console-highlighter": "0.3.2", - "mediawiki/mediawiki-codesniffer": "0.7.2" + "mediawiki/mediawiki-codesniffer": "0.9.0" }, "scripts": { "fix": "phpcbf", diff --git a/phpcs.xml b/phpcs.xml index 95106c5..350c587 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,11 +1,17 @@ -<?xml version="1.0" encoding="UTF-8"?> +<?xml version="1.0"?> <ruleset> <rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki"> - <exclude name="Generic.Classes.DuplicateClassName.Found"/> + <exclude name="Generic.Classes.DuplicateClassName.Found" /> + <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamName" /> + <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" /> + <exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" /> + <exclude name="MediaWiki.FunctionComment.Missing.Protected" /> + <exclude name="MediaWiki.FunctionComment.Missing.Public" /> + <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" /> </rule> <file>.</file> - <arg name="extensions" value="php,php5,inc"/> - <arg name="encoding" value="UTF-8"/> + <arg name="extensions" value="php,php5,inc" /> + <arg name="encoding" value="UTF-8" /> <exclude-pattern>vendor</exclude-pattern> <exclude-pattern>node_modules</exclude-pattern> </ruleset> diff --git a/selenium/PagedTiffHandlerTestCases.php b/selenium/PagedTiffHandlerTestCases.php index aea70b8..4e033d9 100644 --- a/selenium/PagedTiffHandlerTestCases.php +++ b/selenium/PagedTiffHandlerTestCases.php @@ -4,7 +4,6 @@ public $name = 'Check prerequisites'; private $prerequisiteError = null; public function runTest() { - // check whether Multipage.tiff is already uploaded $this->open( $this->getUrl() . '/index.php?title=Image:Multipage.tiff' ); @@ -36,7 +35,6 @@ class SeleniumUploadTiffTest extends SeleniumTestCase { public function uploadFile( $filename ) { - $this->open( $this->getUrl() . '/index.php?title=Special:Upload' ); $this->type( 'wpUploadFile', __DIR__ . @@ -154,7 +152,6 @@ $this->type( 'wpTextbox1', $text ); $this->click( 'wpSave' ); $this->waitForPageToLoad( 10000 ); - } } @@ -185,7 +182,7 @@ // Ergebnis chekcen // $source = $this->getAttribute( - // "//div[@class='gallerybox']//a[@title='Multipage.tiff']//img@src" ); + // "//div[@class='gallerybox']//a[@title='Multipage.tiff']//img@src" ); $source = $this->getAttribute( "//li[@class='gallerybox']//a[@class='image']//img@src" ); $correct = strstr( $source, "-page1-" ); @@ -212,7 +209,7 @@ public function runTest() { $this->preparePage( "[[Image:Multipage.tiff|200px]]\n" ); // $this->selenium->type( 'wpTextbox1', - // "[[Image:Pc260001.tif|thumb]]\n" ); + // "[[Image:Pc260001.tif|thumb]]\n" ); $this->assertSeleniumAttributeEquals( "//div[@id='bodyContent']//img@height", '150' ); @@ -239,7 +236,7 @@ public function runTest() { $this->preparePage( "[[Image:Multipage.tiff|page=2]]\n" ); - // $this->selenium->type( 'wpTextbox1', "[[Image:Pc260001.tif|thumb]]\n" ); + // $this->selenium->type( 'wpTextbox1', "[[Image:Pc260001.tif|thumb]]\n" ); $this->assertSeleniumAttributeEquals( "//div[@id='bodyContent']//img@height", '564' ); diff --git a/selenium/PagedTiffHandlerTestSuite.php b/selenium/PagedTiffHandlerTestSuite.php index 958d788..12a05bc 100644 --- a/selenium/PagedTiffHandlerTestSuite.php +++ b/selenium/PagedTiffHandlerTestSuite.php @@ -119,13 +119,13 @@ parent::addTest( new SeleniumDeleteTiffTest( 'Jello.tif' ) ); // parent::addTest( new SeleniumDeleteTiffTest( - // 'jim___ah.tif' ) ); + // 'jim___ah.tif' ) ); parent::addTest( new SeleniumDeleteTiffTest( 'jim___cg.tif' ) ); // parent::addTest( new SeleniumDeleteTiffTest( - // 'jim___dg.tif' ) ); + // 'jim___dg.tif' ) ); // parent::addTest( new SeleniumDeleteTiffTest( - // 'jim___gg.tif' ) ); + // 'jim___gg.tif' ) ); parent::addTest( new SeleniumDeleteTiffTest( 'ladoga.tif' ) ); parent::addTest( new SeleniumDeleteTiffTest( @@ -139,21 +139,21 @@ parent::addTest( new SeleniumDeleteTiffTest( 'pc260001.tif' ) ); // parent::addTest( new SeleniumDeleteTiffTest( - // 'quad-jpeg.tif' ) ); + // 'quad-jpeg.tif' ) ); parent::addTest( new SeleniumDeleteTiffTest( 'quad-lzw.tif' ) ); parent::addTest( new SeleniumDeleteTiffTest( 'quad-tile.tif' ) ); // parent::addTest( new SeleniumDeleteTiffTest( - // 'smallliz.tif' ) ); + // 'smallliz.tif' ) ); parent::addTest( new SeleniumDeleteTiffTest( 'strike.tif' ) ); // parent::addTest( new SeleniumDeleteTiffTest( - // 'text.tif' ) ); + // 'text.tif' ) ); parent::addTest( new SeleniumDeleteTiffTest( 'ycbcr-cat.tif' ) ); // parent::addTest( new SeleniumDeleteTiffTest( - // 'zackthecat.tif' ) ); + // 'zackthecat.tif' ) ); parent::addTest( new SeleniumDeleteTiffTest( 'multipage.tiff' ) ); } diff --git a/selenium/PagedTiffHandler_tests.php b/selenium/PagedTiffHandler_tests.php index f49021b..a3d493a 100644 --- a/selenium/PagedTiffHandler_tests.php +++ b/selenium/PagedTiffHandler_tests.php @@ -169,7 +169,6 @@ $this->type( 'wpTextbox1', $text ); $this->click( 'wpSave' ); $this->waitForPageToLoad( 10000 ); - } } @@ -200,11 +199,10 @@ // Ergebnis chekcen // $source = $this->getAttribute( - // "//div[@class='gallerybox']//a[@title='Multipage.tiff']//img@src" ); + // "//div[@class='gallerybox']//a[@title='Multipage.tiff']//img@src" ); $source = $this->getAttribute( "//div[@class='gallerybox']//a[@class='image']//img@src" ); $correct = strstr( $source, "-page1-" ); $this->assertEquals( $correct, true ); - } } diff --git a/tests/PagedTiffHandlerTest.php b/tests/PagedTiffHandlerTest.php index 3e24df2..aeead01 100644 --- a/tests/PagedTiffHandlerTest.php +++ b/tests/PagedTiffHandlerTest.php @@ -82,7 +82,6 @@ $interp = $metaArray['exif']['PhotometricInterpretation']; $this->assertTrue( $interp == 2 || $interp == 'RGB' ); // RGB - } function testValidateParam() { @@ -138,7 +137,6 @@ } function testMakeParamString() { - // makeParamString $this->assertEquals( 'lossless-page4-100px', @@ -211,7 +209,6 @@ $thumbPath = $this->large_image->getThumbPath( $thumbName ); $this->assertTrue( $this->repo->fileExists( $thumbPath ), "Intermediate thumb missing" ); - } function testGetThumbType() { @@ -248,7 +245,6 @@ } function testGetPageDimensions() { - // getPageDimensions $this->assertEquals( [ 'width' => 1024, 'height' => 768 ], @@ -313,11 +309,9 @@ // isMultiPage $this->assertTrue( $this->handler->isMultiPage( $this->multipage_image ) ); $this->assertTrue( $this->handler->isMultiPage( $this->mhz_image ) ); - } function testFormatMetadata() { - // formatMetadata $formattedMetadata = $this->handler->formatMetadata( $this->multipage_image ); -- To view, visit https://gerrit.wikimedia.org/r/360235 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I990846c669dddb5e3ae8c8739ee902be6459baa7 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/PagedTiffHandler Gerrit-Branch: master Gerrit-Owner: Legoktm <lego...@member.fsf.org> Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits