symfony - Get proper installation of PHPUnit Database extension in Symfony2 -
i've been struggling configuration 2 days now.
when launch phpunit bash emulator (working under windows 7)
bin/phpunit -c app
i got following error:
configuration read c:\wamp\www\myproject\app\phpunit.xml.dist
..php fatal error: class 'myproject\business\tests\entity\phpunit_extensions_databas e_dataset_yamldataset' not found in c:\wamp\www\myproject\src\myproject\business\tests\eusermanagertest.php on line 39
environment trying suffix path of phpunit_extensions_database_dataset_yamldataset myproject\business\tests\entity whereas require_once statement specifies defined in phpunit/extensions/database/dataset/yamldataset.php.
the "new" statement below leads bad completion tentative:
namespace myproject\business\tests\entity; require_once "phpunit/autoload.php"; require_once "phpunit/extensions/database/autoload.php"; require_once "phpunit/extensions/database/dataset/yamldataset.php'; use \pdo; use myproject\business\entity\eusermanager; class eusermanagertest extends \phpunit_extensions_database_testcase { ... /** * @return phpunit_extensions_database_dataset_idataset */ protected function getdataset() { return new phpunit_extensions_database_dataset_yamldataset( dirname(__file__)."/eusertable.yml" ); }
question figure out why *!ù% not looking in proper path (as defined in require_once).
maybe lead: found out 2 different phpunit exe files in file tree:
/c/wamp/www/myproject/bin/phpunit
and
/c/wamp/bin/php/php5.4.3/phpunit
i think first 1 has been created when installed phpunit declaring in composer.json file + launching :
composer update
this working unit tests not involving databases launching:
bin/phpunit -c app
the second 1 has been installed through pear explained on phpunit documentation: http://phpunit.de/manual/3.8/en/database.html
class definitions database handling @ second location:
/c/wamp/bin/php/php5.4.3/phpunit/pear/phpunit/extensions/database
and expect php instantiating class.
so hint issue may linked double phpunit installation (the 1 in symfony , other 1 in php5.4.3 directory).
am doing well?
there mistake in installation procedure?
how symfony aware of database extension installation through pear?
note: launching:
/c/wamp/bin/php/php5.4.3/phpunit -c app
from /c/wamp/www/myproject giving error: sh.exe": /c/wamp/bin/php/php5.4.3/phpunit: .\php.exe: bad interpreter: no such file or directory
thanks help
i found solution myself chance without understanding trying do. actuallly phpunit classes declared in global space of php instead of specific namespace. specify 1 needs add "\" before class name php global space.
so solution write: return new \phpunit_extensions_database_dataset_yamldataset( dirname(file)."/eusertable.yml" );
Comments
Post a Comment