Yii Framework Forum: Unable to determine the path info of the current request - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Unable to determine the path info of the current request I am trying to run a simple functional test and can't get anywhere

#1 User is offline   dataskills 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 49
  • Joined: 06-August 13

Posted 02 May 2017 - 03:46 PM

I am just trying to get started with formal php testing and I am not getting anywhere after spending two days on it. I am just trying to run a simple test to check the about page and I get the following error: [yii\base\InvalidConfigException] Unable to determine the path info of the current request.

DOES ANYONE HAVE ANY IDEA WHAT IS CAUSING THIS?

Here is the entire output:

$  vendor/bin/codecept run functional AboutCest:checkAbout -c frontend
Codeception PHP Testing Framework v2.1.11
Powered by PHPUnit 5.3.5 by Sebastian Bergmann and contributors.

Frontend\tests.functional Tests (1) ------------------------------------------------------------------------
Check about (functional\AboutCest::checkAbout)                                                        Error
------------------------------------------------------------------------------------------------------------


Time: 121 ms, Memory: 10.00MB

There was 1 error:

---------
1) Failed to check about in frontend\tests\functional\AboutCest::checkAbout (tests/functional/AboutCest.php)

                                                                                               
  [yii\base\InvalidConfigException] Unable to determine the path info of the current request.  
                                                                                               

Scenario Steps:

 1. $I->amOnPage(["site/about"])

#1  /Applications/MAMP/htdocs/cygnus/vendor/yiisoft/yii2/web/Request.php:724
#2  /Applications/MAMP/htdocs/cygnus/vendor/yiisoft/yii2/web/UrlRule.php:306
#3  /Applications/MAMP/htdocs/cygnus/vendor/yiisoft/yii2/web/UrlManager.php:269
#4  /Applications/MAMP/htdocs/cygnus/vendor/yiisoft/yii2/web/Request.php:183
#5  /Applications/MAMP/htdocs/cygnus/vendor/yiisoft/yii2/web/Application.php:82
#6  /Applications/MAMP/htdocs/cygnus/vendor/symfony/browser-kit/Client.php:315
#7  Codeception\Module\Yii2->amOnPage
#8  /Applications/MAMP/htdocs/cygnus/frontend/tests/_support/_generated/FunctionalTesterActions.php:528
#9  /Applications/MAMP/htdocs/cygnus/frontend/tests/functional/AboutCest.php:10
#10 frontend\tests\functional\AboutCest->checkAbout

FAILURES!
Tests: 1, Assertions: 0, Errors: 1.


=============================================

I would appreciate any help, this is my third try to get going with testing with codeception, I have spent a good solid week on this in all and cannot get ONE SINGLE TEST WORKING. NOT ONE!
0

#2 User is offline   tri 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,824
  • Joined: 20-November 08
  • Location:Stockholm, Sweden

Posted 02 May 2017 - 06:23 PM

At least the tests works in a fresh install on OpenSuse (Leap 42.2)

I did the following (root shell)

composer create-project yiisoft/yii2-app-advanced AppYii2011-advanced 2.0.11
cd AppYii2011-advanced

(init to dev environment)
./init

(created db yii2advanced_test)

./yii_test migrate

(all tests)
vendor/bin/codecept run
(partial tests)
vendor/bin/codecept run -- -c common
vendor/bin/codecept run -- -c frontend

(single test)
vendor/bin/codecept run functional AboutCest:checkAbout -c frontend

Everything OK
Don't forget to read The Definitive Guide to Yii (1.1 en) (1.1 sv) (2.0 en) | The class reference (1.1) (2.0) has the details
0

#3 User is offline   dataskills 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 49
  • Joined: 06-August 13

Posted 02 May 2017 - 07:40 PM

Yes, it works with a fresh install of course, I was wondering if anyone has insight as to the particular error I am getting. I am trying to add code coverage to a code base that originated as Yii 2.0. I have spent time trying to update the test files, etc to codeception 2.1.* etc. I am stuck on this error. Not only can I not figure it out but I can't figure out how to debug it. Do you know of some way to debug tests?
0

#4 User is offline   dataskills 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 49
  • Joined: 06-August 13

Posted 03 May 2017 - 02:43 PM

I found out that this error only happens when I use the UrlManager application component.

If I comment out the UrlManager the test works, but the test fails because my routing has been commented out.

I found something out looking in the code referred to in the stack trace (#1 /Applications/MAMP/htdocs/cygnus/vendor/yiisoft/yii2/web/Request.php:724):
When I try to use the UrlManager, the $scriptUrl variable has a value of "vendor/bin/codecept". It should have the value "/index-test.php" and I can't figure out why it doesn't.
0

#5 User is offline   dataskills 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 49
  • Joined: 06-August 13

Posted 03 May 2017 - 03:23 PM

Forget it, I will try to hire someone. This is impossible.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users