Skip to content

[Finder] Partially revert #17134 to fix a regression #18065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2016

Conversation

jakzal
Copy link
Contributor

@jakzal jakzal commented Mar 8, 2016

Q A
Branch 2.3
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #18013
License MIT
Doc PR -

@jakzal
Copy link
Contributor Author

jakzal commented Mar 8, 2016

I will not include a test case unless anyone thinks it's absolutely necessary or has a better idea than the test case below. It is rather fragile. It would also double test execution time for the finder component on travis. Finally, it fails on hhvm.

namespace Symfony\Component\Finder\Tests\Iterator;

use Symfony\Component\Finder\Iterator\DepthRangeFilterIterator;
use Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator;

class DepthRangeFilterIteratorTest extends RealIteratorTestCase
{
    // ...

    public function testFtp()
    {
        $inner = new \RecursiveIteratorIterator(new RecursiveDirectoryIterator('ftp://speedtest.tele2.net/', \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST);

        $iterator = new DepthRangeFilterIterator($inner, 0, 0);

        $files = iterator_to_array($iterator);

        $this->assertArrayHasKey('ftp://speedtest.tele2.net/1000GB.zip', $files);
        $this->assertArrayHasKey('ftp://speedtest.tele2.net/100GB.zip', $files);
        $this->assertArrayHasKey('ftp://speedtest.tele2.net/10GB.zip', $files);
        $this->assertArrayHasKey('ftp://speedtest.tele2.net/1GB.zip', $files);
    }
}

@fabpot
Copy link
Member

fabpot commented Mar 9, 2016

@jakzal I think a small comment above the code to explain the reason why we have such a code would probably help any future regressions and should be enough.

@jakzal jakzal force-pushed the finder-regression-on-non-filesystem branch from 89ed2e4 to ead1824 Compare March 9, 2016 12:50
@jakzal
Copy link
Contributor Author

jakzal commented Mar 9, 2016

Comment added.

@fabpot
Copy link
Member

fabpot commented Mar 9, 2016

Thank you @jakzal.

@fabpot fabpot merged commit ead1824 into symfony:2.3 Mar 9, 2016
fabpot added a commit that referenced this pull request Mar 9, 2016
This PR was merged into the 2.3 branch.

Discussion
----------

[Finder] Partially revert #17134 to fix a regression

| Q             | A
| ------------- | ---
| Branch        | 2.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #18013
| License       | MIT
| Doc PR        | -

Commits
-------

ead1824 [Finder] Partially revert #17134 to fix a regression
@jakzal jakzal deleted the finder-regression-on-non-filesystem branch March 9, 2016 13:08
@fabpot fabpot mentioned this pull request Mar 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants