php - getting error while running phpunit test -
i made 1 file in ryapi folder connection.php in file putted code :
<?php require_once 'phpunit/framework.php'; class datatest extends phpunit_framework_testcase { /** * @dataprovider provider */ public function testadd($a, $b, $c) { $this->assertequals($c, $a + $b); } public function provider() { return array( array(0, 0, 0), array(0, 1, 1), array(1, 0, 1), array(1, 1, 3) ); } } ?>
when running test following getting following error :
ubuntu@ip-10-162-234-205:/var/www/ryapi$ phpunit datatest php deprecated: comments starting '#' deprecated in /etc/php5/cli/conf.d/mcrypt.ini on line 1 in unknown on line 0 phpunit 3.4.5 sebastian bergmann. argument #1 of phpunit_util_fileloader:checkandload() no existing fileubuntu@ip-10-162-234-205:/var/www/ryapi$
please suggest ? edit while running command pear install --alldeps --force phpunit/phpunit
ubuntu@ip-10-162-234-205:/var/www/ryapi$ sudo pear install --alldeps --force phpunit/phpunit warning: phpunit/phpunit requires pear installer (version >= 1.9.1), installed version 1.9.0 phpunit/phpunit can optionally use php extension "dbus" warning: phpunit/dbunit requires pear installer (version >= 1.9.1), installed version 1.9.0 warning: phpunit/file_iterator requires pear installer (version >= 1.9.1), installed version 1.9.0 warning: phpunit/php_codecoverage requires pear installer (version >= 1.9.1), installed version 1.9.0 phpunit/php_codecoverage can optionally use php extension "xdebug" (version >= 2.0.5) warning: phpunit/phpunit_mockobject requires pear installer (version >= 1.9.1), installed version 1.9.0 warning: phpunit/phpunit_selenium requires pear installer (version >= 1.9.1), installed version 1.9.0 warning: phpunit/php_tokenstream requires pear installer (version >= 1.9.1), installed version 1.9.0 downloading phpunit-3.5.11.tgz ... starting download phpunit-3.5.11.tgz (117,869 bytes) ..........................done: 117,869 bytes validation error: package.xml requires pear version 1.9.1 parse properly, version 1.9.0 parsing of package.xml file "/build/buildd/php5-5.3.2/pear-build-download/package.xml" failed download of "phpunit/phpunit" succeeded, not valid package archive error: cannot download "phpunit/phpunit" downloading dbunit-1.0.1.tgz ... starting download dbunit-1.0.1.tgz (39,055 bytes) ...done: 39,055 bytes validation error: package.xml requires pear version 1.9.1 parse properly, version 1.9.0 parsing of package.xml file "/build/buildd/php5-5.3.2/pear-build-download/package.xml" failed download of "phpunit/dbunit" succeeded, not valid package archive error: cannot download "phpunit/dbunit" downloading file_iterator-1.2.3.tgz ... starting download file_iterator-1.2.3.tgz (3,406 bytes) ...done: 3,406 bytes validation error: package.xml requires pear version 1.9.1 parse properly, version 1.9.0 parsing of package.xml file "/build/buildd/php5-5.3.2/pear-build-download/package.xml" failed download of "phpunit/file_iterator" succeeded, not valid package archive error: cannot download "phpunit/file_iterator" downloading php_codecoverage-1.0.4.tgz ... starting download php_codecoverage-1.0.4.tgz (115,029 bytes) ...done: 115,029 bytes validation error: package.xml requires pear version 1.9.1 parse properly, version 1.9.0 parsing of package.xml file "/build/buildd/php5-5.3.2/pear-build-download/package.xml" failed download of "phpunit/php_codecoverage" succeeded, not valid package archive error: cannot download "phpunit/php_codecoverage" downloading phpunit_mockobject-1.0.8.tgz ... starting download phpunit_mockobject-1.0.8.tgz (18,199 bytes) ...done: 18,199 bytes validation error: package.xml requires pear version 1.9.1 parse properly, version 1.9.0 parsing of package.xml file "/build/buildd/php5-5.3.2/pear-build-download/package.xml" failed download of "phpunit/phpunit_mockobject" succeeded, not valid package archive error: cannot download "phpunit/phpunit_mockobject" downloading phpunit_selenium-1.0.2.tgz ... starting download phpunit_selenium-1.0.2.tgz (16,412 bytes) ...done: 16,412 bytes validation error: package.xml requires pear version 1.9.1 parse properly, version 1.9.0 parsing of package.xml file "/build/buildd/php5-5.3.2/pear-build-download/package.xml" failed download of "phpunit/phpunit_selenium" succeeded, not valid package archive error: cannot download "phpunit/phpunit_selenium" downloading php_tokenstream-1.0.1.tgz ... starting download php_tokenstream-1.0.1.tgz (7,250 bytes) ...done: 7,250 bytes validation error: package.xml requires pear version 1.9.1 parse properly, version 1.9.0 parsing of package.xml file "/build/buildd/php5-5.3.2/pear-build-download/package.xml" failed download of "phpunit/php_tokenstream" succeeded, not valid package archive error: cannot download "phpunit/php_tokenstream" download failed install failed ubuntu@ip-10-162-234-205:/var/www/ryapi$
deprecation message
edit /etc/php5/cli/conf.d/mcrypt.ini
, change line 1 "#" ";"
that should trick , rid of deprecation message.
the phpunit error
you using old version of phpunit, i'd suggest upgrading , if still doesn't work edit question , i'll you.
pear install --alldeps --force phpunit/phpunit
a new pear version
pear upgrade pear/pear
, follow instructions. or pear upgrade pear
if first 1 doesn't work out (for whatever reasons)
Comments
Post a Comment