Skip to content

Commit

Permalink
Merge pull request #13 from GrahamForks/tweaks
Browse files Browse the repository at this point in the history
Tweaks
  • Loading branch information
jeremeamia committed Feb 2, 2015
2 parents 9e1ea10 + ddf22bb commit 035b520
Show file tree
Hide file tree
Showing 16 changed files with 67 additions and 65 deletions.
9 changes: 9 additions & 0 deletions .gitattributes
@@ -0,0 +1,9 @@
* text=auto

/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/build.xml export-ignore
/phpunit.xml.dist export-ignore
/README.md export-ignore
8 changes: 4 additions & 4 deletions .gitignore
@@ -1,6 +1,6 @@
.idea/*
vendor/*
build/*
.DS_Store
/.idea
/vendor
/build
cache.properties
composer.lock
phpunit.xml
15 changes: 11 additions & 4 deletions .travis.yml
@@ -1,8 +1,15 @@
language: php

php:
- 5.3.3
- 5.3
- 5.4
before_script:
- composer install
- cp phpunit.xml.dist phpunit.xml
script: sudo phpunit --coverage-text
- 5.5
- 5.6
- hhvm

install:
- travis_retry composer install --no-interaction --prefer-source

script:
- phpunit --coverage-text
7 changes: 6 additions & 1 deletion composer.json
Expand Up @@ -14,6 +14,11 @@
"php": ">=5.3.2"
},
"autoload": {
"psr-0": { "FunctionParser": "src/" }
"psr-4": { "FunctionParser\\": "src/" }
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
}
}
4 changes: 0 additions & 4 deletions composer.lock

This file was deleted.

3 changes: 1 addition & 2 deletions demo/class-method.php
Expand Up @@ -3,8 +3,7 @@
namespace Demo;

// Include the autoloader
require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . '.composer'
. DIRECTORY_SEPARATOR . 'autoload.php';
require_once __DIR__.'/../vendor/autoload.php'

use FunctionParser\FunctionParser;

Expand Down
8 changes: 5 additions & 3 deletions demo/simple-closure.php
@@ -1,17 +1,19 @@
<?php

namespace Demo;

// Include the autoloader
require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . '.composer'
. DIRECTORY_SEPARATOR . 'autoload.php';
require_once __DIR__.'/../vendor/autoload.php'

use FunctionParser\FunctionParser;
use ReflectionFunction;

$foo = 2;
$closure = function($bar) use($foo) {
return $foo + $bar;
};

$parser = new FunctionParser(new \ReflectionFunction($closure));
$parser = new FunctionParser(new ReflectionFunction($closure));

echo "CODE:" . PHP_EOL;
echo $parser->getCode() . PHP_EOL;
Expand Down
64 changes: 31 additions & 33 deletions phpunit.xml.dist
@@ -1,36 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap="./tests/bootstrap.php"
colors="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader"
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
syntaxCheck="true"
strict="false"
verbose="true"
>

<testsuites>
<testsuite name="FunctionParser">
<directory>./tests/FunctionParser/UnitTest</directory>
<directory>./tests/FunctionParser/IntegrationTest</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory suffix=".php">./src/FunctionParser</directory>
</whitelist>
</filter>

<logging>
<log type="coverage-html" target="./build/tests/coverage"
yui="true" highlight="false" charset="UTF-8"
lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="./build/tests/coverage.xml"/>
<log type="junit" target="./build/tests/log.xml" logIncompleteSkipped="false"/>
<log type="testdox-html" target="./build/tests/testdox.html"/>
</logging>

<testsuites>
<testsuite name="FunctionParser">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="./build/tests/coverage"
yui="true" highlight="false" charset="UTF-8"
lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="./build/tests/coverage.xml"/>
<log type="junit" target="./build/tests/log.xml" logIncompleteSkipped="false"/>
<log type="testdox-html" target="./build/tests/testdox.html"/>
</logging>
</phpunit>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 0 additions & 14 deletions tests/bootstrap.php

This file was deleted.

0 comments on commit 035b520

Please sign in to comment.