Ladsgroup has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/366854 )
Change subject: Fix composer tests
......................................................................
Fix composer tests
Bug: T171160
Change-Id: Ib99b632fe67d128c51becfb2cd16559608a9b426
---
M composer.json
A phpcs.xml
M tests/SmokeTest.php
M tests/bootstrap.php
4 files changed, 32 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/wikibase/wikiba.se
refs/changes/54/366854/1
diff --git a/composer.json b/composer.json
index 0cf7826..a23cf66 100644
--- a/composer.json
+++ b/composer.json
@@ -4,7 +4,20 @@
"worldskills/bootstrap": "~3.2",
"dflydev/embedded-composer": "^1.0@dev"
},
+ "require-dev": {
+ "jakub-onderka/php-parallel-lint": "0.9.2",
+ "jakub-onderka/php-console-highlighter": "0.3.2",
+ "wikibase/wikibase-codesniffer": "^0.1.0"
+ },
"config": {
"component-dir": "source/components"
+ },
+ "scripts": {
+ "fix": "phpcbf",
+ "test": [
+ "parallel-lint . --exclude vendor",
+ "phpcs -p -s",
+ "phpunit"
+ ]
}
}
diff --git a/phpcs.xml b/phpcs.xml
new file mode 100644
index 0000000..7622b32
--- /dev/null
+++ b/phpcs.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<ruleset name="wikiba.se">
+ <rule ref="./vendor/wikibase/wikibase-codesniffer/Wikibase" />
+
+ <rule ref="Generic.Formatting.NoSpaceAfterCast" />
+ <rule ref="Generic.Metrics.CyclomaticComplexity" />
+ <rule ref="Generic.Metrics.NestingLevel" />
+ <rule ref="PSR1.Files.SideEffects" />
+ <rule ref="Squiz.Operators.ValidLogicalOperators" />
+ <rule ref="Generic.PHP.SAPIUsage.FunctionFound">
+ <exclude-pattern>tests/bootstrap\.php</exclude-pattern>
+ </rule>
+ <rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
+ <exclude-pattern>tests/SmokeTest\.php</exclude-pattern>
+ </rule>
+ <file>.</file>
+ <exclude-pattern>node_modules</exclude-pattern>
+</ruleset>
diff --git a/tests/SmokeTest.php b/tests/SmokeTest.php
index 6f8364e..1f97518 100644
--- a/tests/SmokeTest.php
+++ b/tests/SmokeTest.php
@@ -8,7 +8,6 @@
private static $PAGE_PATH;
-
public static function setUpBeforeClass() {
self::$PAGE_PATH = __DIR__ . '/../output_test/';
exec( 'vendor/bin/sculpin generate --env=test' );
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 64171d3..876b9ec 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -11,4 +11,4 @@
die( 'You need to install this package with Composer before you can run
the tests' );
}
-require_once( __DIR__ . '/../vendor/autoload.php' );
+require_once ( __DIR__ . '/../vendor/autoload.php' );
--
To view, visit https://gerrit.wikimedia.org/r/366854
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib99b632fe67d128c51becfb2cd16559608a9b426
Gerrit-PatchSet: 1
Gerrit-Project: wikibase/wikiba.se
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits