Skip to content

[Finder] Unified tests #7197

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 6, 2013
Merged

[Finder] Unified tests #7197

merged 1 commit into from
Mar 6, 2013

Conversation

gajdaw
Copy link
Contributor

@gajdaw gajdaw commented Feb 27, 2013

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

Tests for Finder are very difficult to read because they contain calls to:

sys_get_temp_dir() . '/symfony2_finder/'

This improved version simplifies adding and removing new dirs and files.

@fabpot
Copy link
Member

fabpot commented Mar 6, 2013

That breaks the tests. Here is a small snippet from my Mac:

24) Symfony\Component\Finder\Tests\FinderTest::testAppendWithAnArray with data set #0 (Symfony\Component\Finder\Adapter\BsdFindAdapter)
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => '/var/folders/3w/sn5kv29j52x68gw46k6w7w540000gn/T/symfony2_finder/foo'
-    1 => '/var/folders/3w/sn5kv29j52x68gw46k6w7w540000gn/T/symfony2_finder/foo/bar.tmp'
+    0 => '/private/var/folders/3w/sn5kv29j52x68gw46k6w7w540000gn/T/symfony2_finder/foo/bar.tmp'
+    1 => '/var/folders/3w/sn5kv29j52x68gw46k6w7w540000gn/T/symfony2_finder/foo'
     2 => '/var/folders/3w/sn5kv29j52x68...r/toto'
 )

.../src/Symfony/Component/Finder/Tests/Iterator/IteratorTestCase.php:27
.../src/Symfony/Component/Finder/Tests/FinderTest.php:441

@fabpot
Copy link
Member

fabpot commented Mar 6, 2013

By the way, there are also many CS problems.

fabpot added a commit that referenced this pull request Mar 6, 2013
This PR was merged into the 2.2 branch.

Commits
-------

a59e5e4 [Finder] Unified tests

Discussion
----------

[Finder] Unified tests

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

Tests for `Finder` are very difficult to read because they contain calls to:

    sys_get_temp_dir() . '/symfony2_finder/'

This improved version simplifies adding and removing new dirs and files.
@fabpot fabpot merged commit a59e5e4 into symfony:2.2 Mar 6, 2013
@gajdaw
Copy link
Contributor Author

gajdaw commented Mar 7, 2013

The call toAbsolute() in line 441:

$this->assertIterator(self::toAbsolute(array('foo', 'foo/bar.tmp', 'toto')), $finder->getIterator());

returns:

+    0 => '/private/var/folders/3w/sn5kv29j52x68gw46k6w7w540000gn/T/symfony2_finder/foo/bar.tmp'

for foo/bar.tmp. There is a prefix /private/ in the path.

Maybe it can be the same problem as:

https://github.com/swiftmailer/swiftmailer/pull/172/files

@gajdaw gajdaw mentioned this pull request Mar 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants