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

Rewrote passName into $pass as requested #50

Closed
wants to merge 2 commits into from
Closed

Rewrote passName into $pass as requested #50

wants to merge 2 commits into from

Conversation

sashahilton00
Copy link

Also tried to write some unit tests, though my phpunit was playing up,
not sure why, hopefully it tests successfully on here…

Also tried to write some unit tests, though my phpunit was playing up,
not sure why, hopefully it tests successfully on here…
@g-
Copy link
Collaborator

g- commented Apr 10, 2016

Hi Sasha, Thank you for including the tests. I see that the pass name is still being set through the constructor. I think this is problematic in scenarios where the PassFactory is packaging multiple passes. Since the pass name is always the same value, each pass would overwrite the previous one.

This could be solved by including the passName as a parameter of the package() method so that a different name can be passed in each time.

Datetime is now defined in the tests file as the tests fail if
date.timezone is not set on the php server.
@sashahilton00
Copy link
Author

@g Sorry about that, didn't really think about it as I'm only ever packaging single passes. Have moved it into the package() function.

@@ -9,6 +9,6 @@
* file that was distributed with this source code.
*/

$loader = require_once __DIR__ . "/../vendor/autoload.php";
$loader = require __DIR__ . "/../vendor/autoload.php";
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the reason for this change? I'd expect the autoload file to only be loaded once.

Copy link
Author

Choose a reason for hiding this comment

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

The test failed when set to require once. I can't remember the exact error or the explanation for it, but this fixed it. Plus it's only in the tests that this has been changed, so not too much to worry about... I can try and reproduce the error if you want, but I am certain that it wasn't something that I later discovered that was wrong with my environment...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok. I've taken this out of this pull request as I'm not convinced that is correct. We can address it separately if it continues to be problematic.

@g- g- closed this in 856ff45 Apr 24, 2016
@sashahilton00
Copy link
Author

Yeah I'm not sure about the require in the test, but I know require_once wasn't working for me. Assume it was just something on my setup.

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