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

Manually build up argument list #504

Merged
merged 4 commits into from
Sep 10, 2015

Conversation

davedevelopment
Copy link
Collaborator

Fixes #503

$sample[$key] = self::formatArgument($value, $depth + 1);
$key = is_int($key) ? $key : "'$key'";
$value = self::formatArgument($value, $depth + 1);
$sample[]= "$key => $value";
Copy link
Contributor

Choose a reason for hiding this comment

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

cs

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ta G

@GrahamCampbell
Copy link
Contributor

This needs rebasing to load in the previous fixes to get stuff passing.

@@ -1270,6 +1270,22 @@ public function testHandlesMethodWithArgumentExpectationWhenCalledWithNestedReso
}

/**
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

empty phpdoc?

@RobQuistNL
Copy link

Test case:

<?php
require "vendor/autoload.php";

$mock = Mockery::mock();
$mock->shouldReceive('push')->with('value', ['var2' => 'true']);

$mock->push('value', ['var2' => true, 'var 123' => 'with spaces']);

Master:

PHP Fatal error:  Uncaught exception 'Mockery\Exception\NoMatchingExpectationException' with message 'No matching handler found for Mockery_0::push("value", array('var2'=>'true','var123'=>'withspaces',)). Either the method was unexpected or its arguments matched no expected argument list for this method

This PR

PHP Fatal error:  Uncaught exception 'Mockery\Exception\NoMatchingExpectationException' with message 'No matching handler found for Mockery_0::push('value', ['var2' => true, 'var 123' => 'with spaces']). Either the method was unexpected or its arguments matched no expected argument list for this method

👍 from me! Thanks for putting your time and effort into this.

davedevelopment added a commit that referenced this pull request Sep 10, 2015
@davedevelopment davedevelopment merged commit 22b57c7 into mockery:master Sep 10, 2015
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.

3 participants