0
votes

I've got a test suite in yii2 that I would like to run, I have installed composer, codeception, built the test with 'codecept build' and so far so good, everything was smooth as butter until I've issued the command 'codecept run'; it throws an error which by any means I have tried to figured out unfortunately unsuccessfully. I have reinstalled composer, clear the composer cache, rebuilt the project again with codecept build but not success whatsoever.

The error is as follows:

 MyApp\tests.functional Tests (4) -----------------------------------------------------------------
- HomeCest: Check open<pre>PHP User Error &#039;yii\base\ErrorException&#039; with message &#039;Exception &#039;yii\base\InvalidParamException&#039; with message &#039;The file or directory to be published does not exist: /home/user/GIT_MyApp/yii/myapp/vendor/bower/jquery/dist&#039; 

in /home/user/GIT_MyApp/yii/vendor/yiisoft/yii2/web/AssetManager.php:453

Stack trace:
#0 /home/user/GIT_MyApp/yii/vendor/yiisoft/yii2/web/AssetBundle.php(185): yii\web\AssetManager-&gt;publish(&#039;/home/angelo/GI...&#039;, Array)
#1 /home/user/GIT_MyApp/yii/vendor/yiisoft/yii2/web/AssetManager.php(268): yii\web\AssetBundle-&gt;publish(Object(yii\web\AssetManager))
#2 

/home/user/GIT_MyApp/yii/vendor/yiisoft/yii2/web/AssetManager.php(239): yii\web\AssetManager-&gt;loadBundle(&#039;yii\\web\\JqueryA...&#039;, Array, true) 
.....
.....

The weirdest thing though, is that the same project runs fine in another machine (CENT OS). Mine is Kubuntu 16.04. Could it be the machine? Could someone please tell me what is happening and why this error keeps on coming?

1
Can anyone point me somewhere? - ao-pack
Are composer dependencies updated? If so is the problem source similar to one in this question? - Bizley
Yes, composer dependencies are all updated. - ao-pack
the problem seems to be that the path to assets directory is constructed wrongly - it sticks the app name into the path i.e. <yii's root>/<app-name>/vendor instead of looking under <yii's root>/vendor but I don't know why - ao-pack
Any suggestion guys? - ao-pack

1 Answers

0
votes

You have to install fxp/composer-asset-plugin with composer globally:
composer global require "fxp/composer-asset-plugin:~1.3.1"

Like here: https://github.com/yiisoft/yii2-app-basic/blob/2.0.12/.travis.yml#L20