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

Windows: tests failing #3

Open
jasir opened this issue Feb 22, 2013 · 8 comments
Open

Windows: tests failing #3

jasir opened this issue Feb 22, 2013 · 8 comments

Comments

@jasir
Copy link

jasir commented Feb 22, 2013

PHP Warning: preg_replace(): No ending delimiter '#' found in C:\Work\projects\Test\library\Respect\Test\StreamWrapper\StreamWrapperDelegate.php on line 69

PHP 5.4.9

@alganet
Copy link
Member

alganet commented Feb 22, 2013

Hi! This is probably due to a mismatched regex using the DIRECTORY_SEPARATOR constant (which in Windows leads to a backslash, an escaping character), I'm gonna take a look and fix it soon. I'll let you know when the code is online!

And hey, thanks for using and reporting feedback =D

@jasir
Copy link
Author

jasir commented Feb 22, 2013

Thanks a lot, I am looking forward for this project, seems promising!

@nickl-
Copy link
Member

nickl- commented Feb 22, 2013

So much for DIRECTORY_SEPARATOR then hehehe =)

We can then simplify the fullyQualified function and all the concatenations by instead providing both solutions. I could've swarn DIRECTORY_SEPARATOR was double escaped under windows!??!?!?!?

If I recall we could also just str_replace('\\', '/', $path) as C:/windows is also valid, can someone confirm please?

@jasir awesome to have you try this the same day it was released and just for that I will personally see that you have this working on windows. How did you come to try this, if you don't mind me asking? Were you looking for a StreamWrapper specifically? If you tell us more about your specific requirements we can see that you are also happy as a Panda 🐼 =)

nickl- added a commit that referenced this issue Feb 22, 2013
Instead convert windows \ paths to / paths see #3
nickl- added a commit that referenced this issue Feb 22, 2013
@nickl-
Copy link
Member

nickl- commented Feb 23, 2013

There still seems to be troubles with accessing directories, will have to look into it but read and write to virtual files are working as expected.

file_put_contents('some/virtual/file.out', 'is working');
echo file_get_contents('some/virtual/file.out'); // is working

The Respect/Foundation Makefile I groomed a bit to work with git bash as is installed with git for windows:
http://code.google.com/p/msysgit/downloads/list?q=full+installer+official+git

And make as installed from gnuwin project:
http://sourceforge.net/projects/gnuwin32/files/make/3.81/

@jasir Let us know what you find and thank you for understanding, windows has become foreign territory =) but like all things will eventually come right.

@jasir
Copy link
Author

jasir commented Feb 26, 2013

Hi, thank for your effort, but the tests are still failing (3 failures, 5 errors) on windows. Unfortunatelly I do not have time to help you a lot, I can paste Phpunit output here if you want to.

Regarding your question, I just stumbled on your project on packagist. As I am interested in testing and such.
What I was really looking for was for some stream_wrapper for php, which would temove final keword from included classes for make mocking of some final objects possible :-) Something similar to https://github.com/juzna/php-enhancer.

@nickl-
Copy link
Member

nickl- commented Feb 28, 2013

Will you please put the phpunit output in a gist and post here.

I managed to get the Makefile to work via git for windows git bash and installing gnuwin32 make but if you can run phpunit -v --debug I am sure it will help us.

If you have a moment while you're at it and simply comment out the tests that are failing then make a pull request that would be extra awesome but net required.

The stream_wrapper is for mocking file system like vfStream (if I got it right) does but the difference is that your tests can use the normal file:// protocol instead of respect:// for example, which is much simpler to do but what's the fun in that?

Reflect is what you're after, did you see the new reflect mocking an abstract class? I forgot about final, we should do something like that too. The idea with Reflect is to simply Reflect::on(somethin) and we will internally sort out the differences so that you don't have to worry. Next in line is the invoke method requirement but properties are sorted and you can even instantiate the constructor so to speak of a private constructor or whatever. Would be interesting to see what we can do with final. Tx for the link.

@jasir
Copy link
Author

jasir commented Mar 1, 2013

Hi, here is gist with phpunit. Unfortunatelly I have no time to dive in and fix that, hope this help. I'll check this Reflect thing one more time, seems very interesting. Solution for mocking final classes (and classes with with final methods) would be very nice to find...

https://gist.github.com/jasir/5063904

@nickl-
Copy link
Member

nickl- commented Mar 1, 2013

Tx @jasir no worries every little bit counts, your're a superStar! I will ping you once I've had a look.

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

No branches or pull requests

3 participants