commit 5e473e5d8423eb6d8fcef55ccd34a0c81bec0a78
parent 80369f2afabfa5de4c8d08b70e3370a73a010dc6
Author: finwo <finwo@pm.me>
Date: Mon, 20 Jun 2016 10:39:35 +0200
Added readme & CI tests
Diffstat:
4 files changed, 85 insertions(+), 0 deletions(-)
diff --git a/.travis.yml b/.travis.yml
@@ -0,0 +1,10 @@
+language: php
+php:
+ - '5.3'
+ - '5.4'
+ - '5.5'
+ - '5.6'
+ - '7.0'
+
+install:
+ - composer update --prefer-dist
diff --git a/README.md b/README.md
@@ -0,0 +1,23 @@
+# finwo / cache-memcached
+
+[](https://travis-ci.org/finwo/php-cache-memcached)
+
+-----
+
+Memcached driver for [finwo/cache](https://github.com/finwo/php-cache)
+
+-----
+
+### Contributing
+
+After checking the [Github issues](https://github.com/finwo/php-cache-memcached/issues) and confirming that your request isn't already being worked on, feel free to spawn a new fork of the develop branch & send in a pull request.
+
+
+The develop branch is merged periodically into the master after confirming it's stable, to make sure the master always contains a production-ready version.
+
+-----
+
+### Changelog
+- 2016-06-20
+ - Created README
+ - Added CI tests
diff --git a/phpunit.xml b/phpunit.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<phpunit bootstrap="vendor/autoload.php" colors="true">
+
+ <testsuites>
+ <testsuite name="finwo/cache-memcached test suite">
+ <directory>./tests/</directory>
+ </testsuite>
+ </testsuites>
+
+ <filter>
+ <whitelist>
+ <directory>./</directory>
+ <exclude>
+ <directory>./tests</directory>
+ </exclude>
+ </whitelist>
+ </filter>
+</phpunit>
diff --git a/tests/LintTest.php b/tests/LintTest.php
@@ -0,0 +1,33 @@
+<?php
+
+class LintTest extends \PHPUnit_Framework_TestCase
+{
+ public function testSrc()
+ {
+ // Main entry
+ $fileList = \glob('src/');
+
+ // Loop through known files
+ while ( $inode = \array_shift($fileList) ) {
+
+ // Try to iterate deeper
+ if ( is_dir($inode) ) {
+ $fileList = \array_merge($fileList, \glob(\realpath($inode).'/*'));
+ continue;
+ }
+
+ // If we're a PHP file
+ if (\preg_match('/^.+\.(php|inc)$/i', $inode)) {
+ // Run a unit test
+ $this->lintFile($inode);
+ }
+
+ }
+ }
+
+ private function lintFile($filename = '')
+ {
+ // And actually run the test (with proper error message)
+ $this->assertContains('No syntax errors', \exec(\sprintf('php -l "%s"', $filename), $out), \sprintf("%s contains syntax errors", $filename));
+ }
+}