Welcome Guest, Not a member yet? Register   Sign In
Problem with Autorouting improved and HTTP Testing
#1

(This post was last modified: 06-05-2023, 06:13 AM by massimiliano1.mancini.)

Hi,
I'm new in the forum and I hope this is the right place to request some support for the following issue.
Following the guidelines concerning autorouting improved, I have a controller with two different methods:


PHP Code:
getCreate()
postCreate() 

during testing HTTP Feature if I call

PHP Code:
$result $this->post('section/create'$dataPost); 
then the Section::getCreate method is called instead of Section::postCreate.

As workaround, I added a route in my test

PHP Code:
$routes = [
            ['post''section/create''Section::postCreate'],
        ]; 
and the using it, the test works

PHP Code:
$result $this->withRoutes($routes)->post('section/create'$dataPost); 

Am I doing something wrong? Or there is a problem with autorouting and HTTP Feature test?

Thenk you,
Massimiliano
Reply


Messages In This Thread
Problem with Autorouting improved and HTTP Testing - by massimiliano1.mancini - 06-04-2023, 09:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB