Skip to content

Conversation

thunderer
Copy link
Contributor

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

Fixed reported bug #14384 and added test case for it.

@jakzal jakzal added the Finder label Apr 17, 2015
public function testShellCommand()
{
$cmd = Command::create()->add('--force');
$this->assertSame('--force', $cmd->join());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not related to the issue, is it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just a sanity check before checking problem case. Command class is not tested anywhere directly, so I thought it would be a good idea.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's a better idea to split this into more than one test then.

By the way, it could be interesting to use index 1 instead of 2 in the second call of addAtIndex() to ensure that you can also insert in the middle.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xabbuh How about introducing separate Shell\CommandTest.php suite to cover Command class then? I'd be happy to work on it as it's one of the least covered classes in a whole component.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xabbuh Can you reply to my comment? I'd be happy to refactor the tests, but I need guidance on what effect are you interested in.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thunderer A dedicated CommandTest class sounds like a good idea to me.

@thunderer
Copy link
Contributor Author

@xabbuh I've added tests for Shell\Command class, 100% coverage from now. PHP 5.3.3 build errored due to network problem with Composer. Please tell me what you think.

BTW Since I'm the author of the Tests\Shell\CommandTest.php file, can I add @author docblock above class declaration?

$cmd->add('--force');
$cmd->add('--run');

$this->assertSame('--force --run', (string)$cmd);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing space: (string) $cmd

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'll fix this in one batch when @xabbuh gets back to me with his thoughts. :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I missed this. Yes, please change as suggested. :)

@thunderer
Copy link
Contributor Author

@xabbuh Can you comment on the current state of this PR?

@fabpot
Copy link
Member

fabpot commented Jun 11, 2015

👍

Can you rebase and fix CS issues?

@@ -13,6 +13,7 @@

use Symfony\Component\Finder\Finder;
use Symfony\Component\Finder\Adapter;
use Symfony\Component\Finder\Shell\Command;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be reverted.

@jakzal
Copy link
Contributor

jakzal commented Jul 6, 2015

ping @thunderer

thunderer and others added 20 commits July 7, 2015 15:44
Apache rewrite module renames client request
header (`HTTP_`) by prepending `REDIRECT_` to
it. http basic authentication and http digest
authentication are properly processed in
REDIRECT_ form, while bearer is processed in
HTTP_ form, but dropped in REDIRECT_ form.
There is no translation writer format named 'xliff', but 'xlf' only. So the TranslationUpdateCommand can't be called with 'output-format' == 'xliff' and the version info will never be shown.
Using https for symfony.com/search stops chrome (and eventually firefox)
from warning us about "Mixed Content" when developing sites that use SSL
for the entire site.
Restless-ET and others added 22 commits July 7, 2015 15:52
The `SwitchUserEvent` is triggered in case an account is switched. This works okay while switching to the user, but on exit the `SwitchUserEvent` is triggered again with the original User. That User was not initialized by the provider yet.

load user by UserInterface instead of username
In AZ, as in TR, pluralization is always 0: 

0 kitab (zero books)
1 kitab (1 book)
3 kitab (3 books)
104 kitab (104 books)

Apparently ZF ruleset was wrong in the first place :)
@thunderer
Copy link
Contributor Author

@jakzal I fixed CS issues and rebased my branch for 2.3 but it added the whole history to my branch. Can you merge it like that or is it bad and I should do something about that? // @xabbuh @fabpot

@jakzal
Copy link
Contributor

jakzal commented Jul 7, 2015

@thunderer althought it's not me who's gonna be merging it, I expect it might be hard. Are you sure you rebased with the latest 2.3? In the worst case create a new PR.

@thunderer
Copy link
Contributor Author

@jakzal @xabbuh @fabpot I don't know what happened, I just fetched upstream/2.3, pulled it, then rebased my branch and strange things happened. Please see PR #15223, hopefully it'll be okay.

Also, please tell me, can I add my @author docblock in the test class as I created that file?

@fabpot fabpot closed this Jul 7, 2015
@thunderer thunderer deleted the finder-command-addatindex-bugfix branch July 7, 2015 14:26
fabpot added a commit that referenced this pull request Jul 8, 2015
… argument (thunderer)

This PR was squashed before being merged into the 2.3 branch (closes #15223).

Discussion
----------

[Finder] Command::addAtIndex() fails with Command instance argument

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

Fixed reported bug #14384 and added test case for it. This is a second PR as previous #14385 went bad after I failed to rebase 2.3 branch properly.

Commits
-------

2aff566 [Finder] Command::addAtIndex() fails with Command instance argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.