zendframework / zend-test

Test component from Zend Framework
BSD 3-Clause "New" or "Revised" License
18 stars 38 forks source link

Value "phpunit" in route parameters #61

Closed Scyt8l3 closed 6 years ago

Scyt8l3 commented 6 years ago

Hi,

I'd like to test a route with a parameter that has value "phpunit" but i've an 404 route not found error. If I try with an other value it's work. Is it something to configure or do?

Thanks in advance.

ps: Sorry for any spelling fault, english is not my mother tongue.

michalbundyra commented 6 years ago

@Scyt8l3 Can you provide unit test with it? I don't think that there is any restriction about param values.

Scyt8l3 commented 6 years ago

@webimpress

Sorry for my late response, I've redo some test. And I'm thinking that I've found.

The problem is in \Zend\Http\PhpEnvironment\Request (line 543): "phpunit" is the base name from executable and It take a strpos on my request uri (ex.: '/auth/password/reset/phpunit@domain.email/mNilrJMd7o9EG0wvN7tYOJffCiLhFvfyzzttwvS8F7Y') and thus doesn't take the begining of my route.

michalbundyra commented 6 years ago

@Scyt8l3 I checked it and I can confirm there is an issue. Please see my solution in #66. Would you be able to test that branch with your application please?

I clear all global arrays in tests setUp. For me it works, because we shouldn't build there any request from globals, but maybe I'm missing something and there is another failing test case.