This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » eZ Publish 5 Platform » Running Tests in installations with...
expandshrink

Running Tests in installations with symbolic links

Running Tests in installations with symbolic links

Wednesday 16 January 2013 11:03:45 pm - 3 replies

Hi. Sorry is the title is not really meaningfull. I'll try to explain. I like to plain with symlinks and so i have a in my laptop this kind of setup

i have these folders

 .../repos/ezp-next

which is a clone of my github ezp-next repo.

I also have 

/var/www/myweb/ 

which is (was) an ezc 2011.install and so it had this...

 /var/www/myweb/vendor/ezsytems/ezpublish

As i like to play with symlinks, i deleted that ezpublish folder and created a symlink to my repo, and so i have something like

 :~/var/www/myweb/vendor/ezsystems$ ls -la ...
...
ezpublish -> /repos/ezp-next/

I would like to run test with this config and i'm having problems. main is when i run test i get this. 

PHP Warning:  require_once(/repos/ezp-next/vendor/autoload.php): failed to open stream: No such
file or directory in /repos/ezp-next/bootstrap.php on line 26 

I find a quick hack for it but dunno if is the way to go or if test needs to be run in other way. i saw that __DIR__ is used at the beginning and a check is made. $rootDir is /repos/ezp-next and i have no vendor subfolder there...

so i changed that to...

 $rootDir = __DIR__;if ( ( $vendorPathPos = strrpos( $rootDir, '/vendor/ezsystems/ezpublish' ) ) !== false )    
$rootDir = substr( $rootDir, 0, $vendorPathPos );
else
$rootDir = '.';

and tests run now. anyone use this kind of setup? thoughts? what i done is set rootDir to the one where i'm running the test... 

Please let me know happy.gif Emoticon

EDIT:

That solved my problem with autoload.php... but now i having problems finding the config.php, so i wait for more opinions

Modified on Wednesday 16 January 2013 11:31:02 pm by Carlos Revillo

Thursday 17 January 2013 12:20:59 pm

Quote from Carlos Revillo :

That solved my problem with autoload.php... but now i having problems finding the config.php, so i wait for more opinions

This should be easily solved by copying config.php-DEVELOPMENT to config.php within your ezp-next folder afaik

Modified on Thursday 17 January 2013 12:21:27 pm by André R

Thursday 17 January 2013 12:34:12 pm

Quote from André R :
Quote from Carlos Revillo :

 

This should be easily solved by copying config.php-DEVELOPMENT to config.php within your ezp-next folder afaik

I already did that. but nothing. i had to manually hardcode the require wich is made here 

https://github.com/ezsystems/ezp-next/blob/master/eZ/Publish/Core/Persistence/Legacy/Tests/TestCase.php#L351

i ran my test with

/var/www/myweb$ phpunit -vc vendor/ezsystems/ezpublish/[...].xml

and require failed because it was trying to find config at /var/www/myweb instead of /var/www/myweb/vendor/ezsystems/ezpublish

Thursday 17 January 2013 1:34:17 pm

ok, yes the test suite requires that current working directory is the ezp-next folder currently.

The plan is to change the test system to use Symfony Service Container instead of our custom Dependency injection container, and while doing that some of these things will need some cleanup.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from