Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sebastianbergmann/php-file-iterator
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.0.1
Choose a base ref
...
head repository: sebastianbergmann/php-file-iterator
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.0.2
Choose a head ref
  • 8 commits
  • 9 files changed
  • 3 contributors

Commits on Sep 7, 2018

  1. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    b931e55 View commit details
  2. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    ca2670d View commit details
  3. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    8f13f2d View commit details
  4. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    20c2ce0 View commit details
  5. Fix: Run php-cs-fixer

    localheinz authored and sebastianbergmann committed Sep 7, 2018

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    d7f928a View commit details
  6. Fix: Reduce visibility

    localheinz authored and sebastianbergmann committed Sep 7, 2018

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    8d27bca View commit details
  7. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    26bd9fe View commit details

Commits on Sep 13, 2018

  1. Prepare release

    sebastianbergmann committed Sep 13, 2018

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    050bedf View commit details
Showing with 119 additions and 3 deletions.
  1. +2 −1 .gitignore
  2. +1 −0 .php_cs.dist
  3. +32 −0 .travis.yml
  4. +7 −0 ChangeLog.md
  5. +2 −0 README.md
  6. +3 −1 composer.json
  7. +21 −0 phpunit.xml
  8. +1 −1 src/Factory.php
  9. +50 −0 tests/FactoryTest.php
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.idea
/vendor/
/.php_cs
/.php_cs.cache

/composer.lock
1 change: 1 addition & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -163,5 +163,6 @@ return PhpCsFixer\Config::create()
PhpCsFixer\Finder::create()
->files()
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
->notName('*.phpt')
);
32 changes: 32 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
language: php

sudo: false

php:
- 7.1
- 7.2
- master

env:
matrix:
- DEPENDENCIES="high"
- DEPENDENCIES="low"
global:
- DEFAULT_COMPOSER_FLAGS="--no-interaction --no-ansi --no-progress --no-suggest"

before_install:
- composer self-update
- composer clear-cache

install:
- if [[ "$DEPENDENCIES" = 'high' ]]; then travis_retry composer update $DEFAULT_COMPOSER_FLAGS; fi
- if [[ "$DEPENDENCIES" = 'low' ]]; then travis_retry composer update $DEFAULT_COMPOSER_FLAGS --prefer-lowest; fi

script:
- ./vendor/bin/phpunit --coverage-clover=coverage.xml

after_success:
- bash <(curl -s https://codecov.io/bash)

notifications:
email: false
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).

## [2.0.2] - 2018-09-13

### Fixed

* Fixed [#48](https://github.com/sebastianbergmann/php-file-iterator/issues/48): Excluding an array that contains false ends up excluding the current working directory

## [2.0.1] - 2018-06-11

### Fixed
@@ -54,6 +60,7 @@ No changes

* [Added support for wildcards (glob) in exclude](https://github.com/sebastianbergmann/php-file-iterator/pull/23)

[2.0.2]: https://github.com/sebastianbergmann/php-file-iterator/compare/2.0.1...2.0.2
[2.0.1]: https://github.com/sebastianbergmann/php-file-iterator/compare/2.0.0...2.0.1
[2.0.0]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4...master
[1.4.5]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.4...1.4.5
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Build Status](https://travis-ci.org/sebastianbergmann/php-file-iterator.svg?branch=master)](https://travis-ci.org/sebastianbergmann/php-file-iterator)

# php-file-iterator

## Installation
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -21,6 +21,9 @@
"require": {
"php": "^7.1"
},
"require-dev": {
"phpunit/phpunit": "^7.1"
},
"autoload": {
"classmap": [
"src/"
@@ -32,4 +35,3 @@
}
}
}

21 changes: 21 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.2/phpunit.xsd"
bootstrap="vendor/autoload.php"
forceCoversAnnotation="true"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
verbose="true">
<testsuites>
<testsuite name="default">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>
2 changes: 1 addition & 1 deletion src/Factory.php
Original file line number Diff line number Diff line change
@@ -78,6 +78,6 @@ protected function getPathsAfterResolvingWildcards(array $paths): array
}
}

return $_paths;
return \array_filter($_paths);
}
}
50 changes: 50 additions & 0 deletions tests/FactoryTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php
/*
* This file is part of php-file-iterator.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace SebastianBergmann\FileIterator;

use PHPUnit\Framework\TestCase;

/**
* @covers \SebastianBergmann\FileIterator\Factory
*/
class FactoryTest extends TestCase
{
/**
* @var string
*/
private $root;

/**
* @var Factory
*/
private $factory;

protected function setUp(): void
{
$this->root = __DIR__;
$this->factory = new Factory;
}

public function testFindFilesInTestDirectory(): void
{
$iterator = $this->factory->getFileIterator($this->root, 'Test.php');
$files = \iterator_to_array($iterator);

$this->assertGreaterThanOrEqual(1, \count($files));
}

public function testFindFilesWithExcludedNonExistingSubdirectory(): void
{
$iterator = $this->factory->getFileIterator($this->root, 'Test.php', '', [$this->root . '/nonExistingDir']);
$files = \iterator_to_array($iterator);

$this->assertGreaterThanOrEqual(1, \count($files));
}
}