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

Pass metadata with requests #32

Merged
merged 7 commits into from
Aug 19, 2019
Merged

Pass metadata with requests #32

merged 7 commits into from
Aug 19, 2019

Conversation

asgrim
Copy link
Collaborator

@asgrim asgrim commented Aug 19, 2019

Adds metadata into the requests made.

Currently, it's difficult to test this, as we cannot inject dependencies, so have no way to "fake" the server. I'll look at refactoring and fixing this separately as it's not strictly related.

@asgrim asgrim added the enhancement New feature or request label Aug 19, 2019
@asgrim asgrim requested a review from cschneid August 19, 2019 15:48
{
parent::__construct($agent);

// Construct and stop the timer to use its timestamp logic. This event
// is a single point in time, not a range.
$this->timer = new Timer();
$this->timer->stop();
$this->timer = new Timer((float) $now->format('U.u'));
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this explicit $now just for testing?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Primarily yes; time is global state, so converting to use a defined time-stamp.in tests is always going to be a win. I've lost count of the number of tests I've discovered were flaky due to assumptions about date/time 😁

@cschneid cschneid merged commit 5708f68 into master Aug 19, 2019
@asgrim asgrim deleted the pass-metadata-with-requests branch August 19, 2019 16:26
@asgrim asgrim added this to the 0.1.1 milestone Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants