-
Notifications
You must be signed in to change notification settings - Fork 195
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
Codeigniter-restserver and GET parameters #49
Comments
It seems you are right. But I don't know why codeigniter-restserver does not use |
How about this? $output = $this->request('GET', 'query_string/index/name/Mike'); |
I have a little bit complicated parameters.
What will be from this parameter in the form proposed by you?
Thanks |
have you any suggestion how I inject the above url to the codigniter? |
This is workaround for example 7 ( set_is_cli(FALSE);
$this->warningOff();
$_SERVER['REQUEST_URI'] = 'api/example/users/id/1?format=xml';
$output = $this->request('GET', 'api/example/users/id/1');
set_is_cli(TRUE);
$this->warningOn();
$this->assertEquals(
'<?xml version="1.0" encoding="utf-8"?>
<xml><id>1</id><name>John</name><email>john@example.com</email><fact>Loves coding</fact></xml>
',
$output
);
$this->assertResponseCode(200); In your case, you set $_SERVER['REQUEST_URI'] = 'log?page=1&rows=10&filterRules=%5B%7B%22field%22%3A%22time%22%2C%22op%22%3A%22between%22%2C%22value%22%3A%5B%222015-08-01%22%2C%222015-08-31%22%5D%7D%5D'; |
I posted issue to ask why. |
Thanks. |
I sent PR: #51 With this PR, we can write test like this: set_is_cli(FALSE);
$this->warningOff();
$output = $this->request(
'GET',
'api/example/users/id/1?format=xml'
);
set_is_cli(TRUE);
$this->warningOn();
$this->assertEquals(
'<?xml version="1.0" encoding="utf-8"?>
<xml><id>1</id><name>John</name><email>john@example.com</email><fact>Loves coding</fact></xml>
',
$output
);
$this->assertResponseCode(200); But we can't remove below, because of implementation of codeigniter-restserver. set_is_cli(FALSE);
$this->warningOff(); |
Thanks, I will try ASAP |
If you use latest You can write tests without |
@serazoli |
Thanks |
Hi.
The codeigniter-rest-server not accept the GET parameter from array (['name' => 'Mike'])
because rest-server don't use $_GET variable - if i saw good.
and
not work.
$output will be NULL
Sorry my bad English
Thanks.
The text was updated successfully, but these errors were encountered: