summaryrefslogtreecommitdiff
path: root/vendor/zordius
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-10-18 09:31:31 +0200
committerPierre Schmitz <pierre@archlinux.de>2015-10-18 09:31:31 +0200
commit80f7dc77d430774192b929d780f96260066df2ee (patch)
tree102eaae7fc9ec567f2af76e96da3de2d1e83afcf /vendor/zordius
parentcccd7bb4d819334c07e0dadaf16cbfdef31880e1 (diff)
Update to MediaWiki 1.25.3
Diffstat (limited to 'vendor/zordius')
-rw-r--r--vendor/zordius/lightncandy/build/gen_doc6
-rw-r--r--vendor/zordius/lightncandy/build/gen_test.php64
-rw-r--r--vendor/zordius/lightncandy/build/push_ghpage12
-rw-r--r--vendor/zordius/lightncandy/build/runphp2
-rw-r--r--vendor/zordius/lightncandy/build/travis_push60
5 files changed, 144 insertions, 0 deletions
diff --git a/vendor/zordius/lightncandy/build/gen_doc b/vendor/zordius/lightncandy/build/gen_doc
new file mode 100644
index 00000000..428e619d
--- /dev/null
+++ b/vendor/zordius/lightncandy/build/gen_doc
@@ -0,0 +1,6 @@
+#!/bin/sh
+curl -O https://cloud.github.com/downloads/apigen/apigen/ApiGen-2.8.0-standalone.zip
+unzip -oq ApiGen-2.8.0-standalone.zip
+rm ApiGen-2.8.0-standalone.zip
+php -dopen_basedir=/ apigen/apigen.php --source src/ --destination build/result/docs/ --template-config apigen/templates/bootstrap/config.neon --deprecated yes
+rm -rf apigen
diff --git a/vendor/zordius/lightncandy/build/gen_test.php b/vendor/zordius/lightncandy/build/gen_test.php
new file mode 100644
index 00000000..97d49489
--- /dev/null
+++ b/vendor/zordius/lightncandy/build/gen_test.php
@@ -0,0 +1,64 @@
+<?php
+
+foreach (Array(
+ 'vendor/phpunit/phpunit/PHPUnitPHPUnit/Autoload.php',
+ 'PHPUnit/Autoload.php',
+ 'src/lightncandy.php'
+) as $inc) {
+ if (file_exists($inc)) {
+ include_once($inc);
+ break;
+ }
+}
+
+genTestForClass('LightnCandy');
+genTestForClass('LCRun3');
+
+function genTestForClass($classname) {
+ ob_start();
+
+ echo <<<VAR
+<?php
+/**
+ * Generated by build/gen_test
+ */
+require_once('src/lightncandy.php');
+
+class {$classname}Test extends PHPUnit_Framework_TestCase
+{
+
+VAR
+ ;
+
+ $class = new ReflectionClass($classname);
+ foreach ($class->getMethods() as $method) {
+ if (preg_match_all('/@expect (.+) when input (.+)( after (.+))?/', $method->getDocComment(), $matched)) {
+ echo <<<VAR
+ /**
+ * @covers {$classname}::{$method->name}
+ */
+ public function testOn_{$method->name}() {
+ \$method = new ReflectionMethod('$classname', '{$method->name}');
+
+VAR
+ ;
+ if ($method->isPrivate() || $method->isProtected()) {
+ echo " \$method->setAccessible(true);\n";
+ }
+ foreach ($matched[1] as $idx => $expect) {
+ if ($matched[3][$idx]) {
+ echo " {$matched[3][$idx]}\n";
+ }
+ echo " \$this->assertEquals($expect, \$method->invoke(null,\n {$matched[2][$idx]}\n ));\n";
+ }
+ echo " }\n";
+ }
+ }
+ echo "}\n?>";
+
+ $fn = "tests/{$classname}Test.php";
+ if (!file_put_contents($fn, ob_get_clean())) {
+ die("Can not generate tests into file $fn !!\n");
+ }
+}
+?>
diff --git a/vendor/zordius/lightncandy/build/push_ghpage b/vendor/zordius/lightncandy/build/push_ghpage
new file mode 100644
index 00000000..de64e2b9
--- /dev/null
+++ b/vendor/zordius/lightncandy/build/push_ghpage
@@ -0,0 +1,12 @@
+#!/bin/sh
+git checkout -B gh-pages
+git pull origin gh-pages
+rm *
+rm -rf src
+rm -rf test
+cp -r build/result/docs/* .
+rm -rf build
+rm .travis.yml
+git add .
+git commit -a -m "New documents on github"
+git push origin gh-pages
diff --git a/vendor/zordius/lightncandy/build/runphp b/vendor/zordius/lightncandy/build/runphp
new file mode 100644
index 00000000..aa694de3
--- /dev/null
+++ b/vendor/zordius/lightncandy/build/runphp
@@ -0,0 +1,2 @@
+#!/bin/sh
+php -dopen_basedir=/ $1 $2
diff --git a/vendor/zordius/lightncandy/build/travis_push b/vendor/zordius/lightncandy/build/travis_push
new file mode 100644
index 00000000..b51e4dcc
--- /dev/null
+++ b/vendor/zordius/lightncandy/build/travis_push
@@ -0,0 +1,60 @@
+#!/bin/sh
+echo "DEBUG ENV: ${TRAVIS_JOB_NUMBER} , ${TRAVIS_BUILD_NUMBER} , ${TRAVIS_PULL_REQUEST} ..."
+
+if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
+ echo "This is a PR, skip push."
+ exit 0
+fi
+
+if [ "${TRAVIS_BUILD_NUMBER}.1" != "${TRAVIS_JOB_NUMBER}" ]; then
+ echo "Only push documents 1 time... quit."
+ exit 0
+fi
+
+# Push coverage report
+wget https://scrutinizer-ci.com/ocular.phar
+php ocular.phar code-coverage:upload --format=php-clover coverage.clover
+
+# Set for all push in this script.
+git config --global user.name "Travis-CI"
+git config --global user.email "zordius@yahoo-inc.com"
+
+# Generate ANSI sample
+git clone https://github.com/fcambus/ansilove
+php tests/example_debug.php > example_debug
+php ansilove/ansilove example_debug
+git add example_debug.png
+
+# Push new tests back to this branch
+git commit -a -m "Auto generated tests from Travis [ci skip]"
+git push "https://${GHTK}@github.com/zordius/lightncandy.git" HEAD:${TRAVIS_BRANCH} > /dev/null 2>&1
+
+# Update hash in HandlebarsTest and push back, trigger new tests there.
+git clone https://github.com/zordius/HandlebarsTest
+cd HandlebarsTest
+echo ${TRAVIS_COMMIT} > lightncandy
+git add lightncandy
+git commit -a -m "Auto test on zordius/lightncandy@${TRAVIS_COMMIT}"
+git push "https://${GHTK}@github.com/zordius/HandlebarsTest.git" > /dev/null 2>&1
+cd ..
+
+# Generate documents for this branch
+build/gen_doc
+cd build/result/docs
+
+if [ "${TRAVIS_BRANCH}" != "master" ]; then
+ echo "Document will be pushed here: http://zordius.github.io/lightncandy/${TRAVIS_BRANCH}/"
+ cd ..
+ git init
+ git pull --quiet "https://${GHTK}@github.com/zordius/lightncandy.git" gh-pages:master > /dev/null 2>&1
+ rm -rf $TRAVIS_BRANCH
+ mv docs $TRAVIS_BRANCH
+ git add $TRAVIS_BRANCH
+else
+ echo "Document will be pushed here: http://zordius.github.io/lightncandy/"
+ git init
+ git add .
+fi
+
+git commit -m "Auto deployed to Github Pages from branch ${TRAVIS_BRANCH} @${TRAVIS_COMMIT} [ci skip]"
+git push --force --quiet "https://${GHTK}@github.com/zordius/lightncandy.git" master:gh-pages > /dev/null 2>&1