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

Codeception - Unable to determine the request URI #3218

Closed
Koudy opened this issue Apr 23, 2014 · 16 comments
Closed

Codeception - Unable to determine the request URI #3218

Koudy opened this issue Apr 23, 2014 · 16 comments
Labels
type:docs Documentation
Milestone

Comments

@Koudy
Copy link
Contributor

Koudy commented Apr 23, 2014

Get this error after the test is completed:

PHP Fatal error:  Uncaught exception 'yii\base\InvalidConfigException' with mess
age 'Unable to determine the request URI.' in C:\open_server\OpenServer\domains\
site.ru\protected\vendor\yiisoft\yii2\web\Request.php:767
Stack trace:
#0 C:\open_server\OpenServer\domains\site.ru\protected\vendor\yiisoft\yii2\web\
Request.php(727): yii\web\Request->resolveRequestUri()
#1 C:\open_server\OpenServer\domains\site.ru\protected\vendor\yiisoft\yii2\web\
Request.php(712): yii\web\Request->getUrl()
#2 C:\open_server\OpenServer\domains\site.ru\protected\vendor\yiisoft\yii2-debu
g\LogTarget.php(140): yii\web\Request->getAbsoluteUrl()
#3 C:\open_server\OpenServer\domains\site.ru\protected\vendor\yiisoft\yii2-debu
g\LogTarget.php(50): yii\debug\LogTarget->collectSummary()
#4 C:\open_server\OpenServer\domains\site.ru\protected\vendor\yiisoft\yii2-debu
g\LogTarget.php(111): yii\debug\LogTarget->export(Array)
#5 C:\open_server\OpenServer\domains\site.ru\protected\vendor\yiisoft\yii2\log\
Dispatcher.php(179): yii\debug\LogTarget->collect(Array, tr in C:\open_server\Op
enServer\domains\site.ru\protected\vendor\yiisoft\yii2\web\Request.php on line
767
@samdark
Copy link
Member

samdark commented Apr 23, 2014

Which test?

@Koudy
Copy link
Contributor Author

Koudy commented Apr 23, 2014

@samdark, acceptance

wantTo('ensure that page works'); $I->amOnPage('/login/'); $I->see('Some text)');

@qiangxue
Copy link
Member

Does the included acceptance test (in basic or advanced app) run well on your side?

@qiangxue qiangxue added this to the 2.0 RC milestone Apr 23, 2014
@Ragazzo
Copy link
Contributor

Ragazzo commented Apr 23, 2014

What version of Yii2 are you using? What version of Codeception and how you installed it? Also note that if you already have slah in yaml config than here in the begining it is not needed:

$I->amOnPage('/login/');

@Koudy
Copy link
Contributor Author

Koudy commented Apr 23, 2014

@qiangxue, I didn't try.

@Ragazzo,
"require": {
"yiisoft/yii2": "2.0.0-beta",
"codeception/codeception": "1.8.@dev",
"codeception/specify": "
",
"codeception/verify": "*"
}

@Ragazzo
Copy link
Contributor

Ragazzo commented Apr 23, 2014

have you tried without slash? can you post here your suite yaml, cept and page html so we can reproduce it if needed?

@Koudy
Copy link
Contributor Author

Koudy commented Apr 23, 2014

@Ragazzo, yes, I tried.
acceptance.suite.yml:
class_name: WebGuy
modules:
enabled:
- PhpBrowser
- WebHelper
config:
PhpBrowser:
url: 'http://site.ru'

Cept:

wantTo('ensure that home page works'); $I->amOnPage('/'); $I->see('Congratulations!'); Do you really need html page? Tests works fine, but after the text of the test output test errors.

@Ragazzo
Copy link
Contributor

Ragazzo commented Apr 23, 2014

so as i see you are trying this one on yii2-basic am i right? and the problem is that when you add custom text in index view of site controller tests fails and cant find this new text?

@Koudy
Copy link
Contributor Author

Koudy commented Apr 23, 2014

@Ragazzo it is already working project, so I can not say that it yii2-basic or yii2-advanced, although the structure closer to the advanced and index page is not changed, but it does not matter - the tests work correctly - give Ok when text is found and failed when is not. For other page this is the same. The problem in error I get after test is finished and it try write logs if I'm not wrong.

@Ragazzo
Copy link
Contributor

Ragazzo commented Apr 23, 2014

ok, can you upload maybe some small reproducable example of your exception? Because currently it is hard to say what is wrong.

@qiangxue
Copy link
Member

Try disabling the "debug" module (this is not needed for tests anyway).

@Koudy
Copy link
Contributor Author

Koudy commented Apr 23, 2014

@qiangxue, It helped, thanks.

@Koudy Koudy closed this as completed Apr 23, 2014
@samdark
Copy link
Member

samdark commented Apr 23, 2014

Should we state it in the docs somewhere?

@Ragazzo
Copy link
Contributor

Ragazzo commented Apr 23, 2014

i guess yes, but even with debug module on i was not having such problems, but as a note yes. maybe it should be done also in testing.md that will be done after RC i think.

@samdark samdark reopened this Apr 23, 2014
@samdark samdark self-assigned this Apr 23, 2014
@samdark samdark removed their assignment May 4, 2014
@lynicidn
Copy link
Contributor

lynicidn commented May 7, 2014

in yii1 this error solving if set urlFormat as 'get' in url manager

@samdark
Copy link
Member

samdark commented Aug 25, 2014

Closing this one since I wasn't able to reproduce it.

@samdark samdark closed this as completed Aug 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:docs Documentation
Projects
None yet
Development

No branches or pull requests

5 participants