Skip to content
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

(possibly) update RootPackageLoaderTest #1508

Closed
xrstf opened this issue Jan 20, 2013 · 6 comments
Closed

(possibly) update RootPackageLoaderTest #1508

xrstf opened this issue Jan 20, 2013 · 6 comments
Milestone

Comments

@xrstf
Copy link

xrstf commented Jan 20, 2013

Inside the RootPackageLoaderTest, the issue sebastianbergmann/phpunit-mock-objects#81 has been referenced:

Can do away with this mock object when sebastianbergmann/phpunit-mock-objects#81 is fixed

The issue has been closed 8 days ago, so maybe the test can be cleaned up.

@stof
Copy link
Contributor

stof commented Jan 20, 2013

but this is not yet part of a released version of the library, right ?

@xrstf
Copy link
Author

xrstf commented Jan 20, 2013

It looks like v1.2.3 was released one day after merging the fix: https://github.com/sebastianbergmann/phpunit-mock-objects/commits/1.2.3

@stof
Copy link
Contributor

stof commented Jan 20, 2013

Ok, so it is fixed when using PHPUnit 3.7.13. Maybe we should wait until Travis uses this version ?

@xrstf
Copy link
Author

xrstf commented Jan 20, 2013

No need to rush, I just wanted to post a little reminder because I was poking around the Composer source ;-)

@simensen
Copy link
Contributor

I took a look at this today with PHPUnit 3.7.22 and I don't see that this is working. I could be totally wrong on how this was intended to work, though? I tried:

<?php
        $processExecutor = $this->getMockBuilder('\\Composer\\Util\\ProcessExecutor')
            ->disableOriginalConstructor()
            ->getMock();

        $self = $this;

        $processExecutor
            ->expects($this->once())
            ->method('execute')
            ->will($this->returnCallback(function ($command, &$output = null, $cwd = null) use ($commitHash, $self) {
                $self->assertStringStartsWith('git branch', $command);

                $output = "* (no branch) $commitHash Commit message\n";

                return 0;
            }));

I get:

Invalid argument supplied for foreach()

So the output is not being set correctly.

Based on the notes for PHPUnit 3.7 it looks like cloning the params should be off by default. I tried both enableArgumentCloning and disableArgumentCloning and it seemed to make no difference. Did sebastianbergmann/phpunit-mock-objects#81 actually address a different problem?

@alcohol
Copy link
Member

alcohol commented Jul 30, 2015

@stof is this still applicable?

alcohol added a commit to alcohol/composer that referenced this issue Jul 30, 2015
Seldaek added a commit that referenced this issue Jul 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants