2011-11-10 13 views
24

मैं अपने जेन फ्रेमवर्क प्रोजेक्ट के लिए PHPunit काम करने के लिए प्रयास कर रहा हूं और विभिन्न समस्याओं का सामना कर रहा हूं। मैंने पियर को पुनर्स्थापित किया है और अनइंस्टॉल किया गया PHPunit, और दोनों को दोबारा स्थापित किया है।PHPunit काम नहीं कर सकता

मेरे वर्तमान त्रुटि

[email protected]:~$ phpunit PHP Warning: require_once(PHPUnit/Framework/MockObject/Autoload.php): failed to open stream: No such file or directory in /usr/share/php/PHPUnit/Autoload.php on line 48 PHP Fatal error: require_once(): Failed opening required 'PHPUnit/Framework/MockObject/Autoload.php' (include_path='.:/usr/share/php/:/usr/local/share/php/library') in /usr/share/php/PHPUnit/Autoload.php on line 48

मैं ubuntu 11.10 उपयोग कर रहा हूँ, पीएचपी 5.3.6-13ubuntu3.2

अगर कोई मुझे कुछ संकेत दे सकता है मैं बहुत आभारी होंगे है। मैंने Google पर बहुत कुछ देखा है, लेकिन मेरी समस्या को हल करने के लिए कुछ भी नहीं लगता है।

धन्यवाद,

डेमियन।

यहाँ मेरी खोल डंप है जो दिखाता है मैं हाल ही में क्या किया है है:

[email protected]:~$ phpunit 
The program 'phpunit' is currently not installed. You can install it by typing: 
sudo apt-get install phpunit 

[email protected]:~$ sudo pear channel-discover pear.phpunit.de 
[sudo] password for demian: 

Channel "pear.phpunit.de" is already initialized 

[email protected]:~$ sudo pear channel-discover pear.symfony-project.com 

Channel "pear.symfony-project.com" is already initialized 

[email protected]:~$ sudo pear channel-discover components.ez.no 

Channel "components.ez.no" is already initialized 

[email protected]:~$ sudo pear update-channels 

Updating channel "components.ez.no" 

Channel "components.ez.no" is up to date 

Updating channel "doc.php.net" 

Channel "doc.php.net" is up to date 

Updating channel "pear.php.net" 

Channel "pear.php.net" is up to date 

Updating channel "pear.phpunit.de" 

Channel "pear.phpunit.de" is up to date 

Updating channel "pear.symfony-project.com" 

Channel "pear.symfony-project.com" is up to date 

Updating channel "pecl.php.net" 

Channel "pecl.php.net" is up to date 

[email protected]:~$ sudo pear upgrade-all 

Will upgrade channel://pear.php.net/benchmark 

downloading Benchmark-1.2.8.tgz ... 

Starting to download Benchmark-1.2.8.tgz (8,352 bytes) 

.....done: 8,352 bytes 

upgrade-all ok: channel://pear.php.net/Benchmark-1.2.8 

[email protected]:~$ sudo pear install --force --alldeps phpunit/PHPUnit 

downloading PHPUnit-3.6.3.tgz ... 

Starting to download PHPUnit-3.6.3.tgz (116,362 bytes) 

.........................done: 116,362 bytes 

install ok: channel://pear.phpunit.de/PHPUnit-3.6.3 

[email protected]:~$ pear install phpunit/PHP_CodeCoverage 

phpunit/PHP_CodeCoverage is already installed and is the same as the released version 1.1.1 

install failed 

[email protected]:~$ phpunit 


PHP Warning: require_once(PHPUnit/Framework/MockObject/Autoload.php): failed to open 
stream: No such file or directory in /usr/share/php/PHPUnit/Autoload.php on line 48 

PHP Fatal error: require_once(): Failed opening required 
'PHPUnit/Framework/MockObject/Autoload.php' (include_path='.:/usr/share/php/:/usr/local/share/php/library') in /usr/share/php/PHPUnit/Autoload.php on line 48 

[email protected]:~$ pear install phpunit 

Warning: lstat(): Lstat failed for /tmp/pear/cache/312d32445ed39d8611ead5ee1d8cd72frest.cacheid in PEAR/REST.php on line 276 
PHP Warning: lstat(): Lstat failed for /tmp/pear/cache/312d32445ed39d8611ead5ee1d8cd72frest.cacheid in /usr/share/php/PEAR/REST.php on line 276 
No releases available for package "pear.php.net/phpunit" 
install failed 

[email protected]:~$ sudo pear install phpunit 

WARNING: "pear/PHPUnit" is deprecated in favor of "phpunit/PHPUnit" 
Did not download dependencies: pear/PHP_Compat, use --alldeps or --onlyreqdeps to download automatically 
pear/PHPUnit can optionally use package "pear/PHP_Compat" 
downloading PHPUnit-1.3.2.tgz ... 
Starting to download PHPUnit-1.3.2.tgz (20,913 bytes) 
........done: 20,913 bytes 
install ok: channel://pear.php.net/PHPUnit-1.3.2 

[email protected]:~$ phpunit 

PHP Warning: require_once(PHPUnit/Framework/MockObject/Autoload.php): failed to open stream: No such file or directory in /usr/share/php/PHPUnit/Autoload.php on line 48 
PHP Fatal error: require_once(): Failed opening required 'PHPUnit/Framework/MockObject/Autoload.php' (include_path='.:/usr/share/php/:/usr/local/share/php/library') in /usr/share/php/PHPUnit/Autoload.php on line 48 

[email protected]:~$ sudo pear uninstall phpunit 
uninstall ok: channel://pear.php.net/PHPUnit-1.3.2 

[email protected]:~$ ^C 

[email protected]:~$ pear install phpunit/PHPUnit 
phpunit/PHPUnit is already installed and is the same as the released version 3.6.3 
install failed 

[email protected]:~$ phpunit 

PHP Warning: require_once(PHPUnit/Framework/MockObject/Autoload.php): failed to open stream: No such file or directory in /usr/share/php/PHPUnit/Autoload.php on line 48 
PHP Fatal error: require_once(): Failed opening required 'PHPUnit/Framework/MockObject/Autoload.php' (include_path='.:/usr/share/php/:/usr/local/share/php/library') in /usr/share/php/PHPUnit/Autoload.php on line 48 

[email protected]:~$ pear install --force phpunit/PHPUnit 

WARNING: configuration download directory "/tmp/pear/download" is not writeable. Change download_dir config variable to a writeable dir to avoid this warning 
Cannot install, php_dir for channel "pear.phpunit.de" is not writeable by the current user 

[email protected]:~$ sudo pear install phpunit/PHPUnit 

phpunit/PHPUnit is already installed and is the same as the released version 3.6.3 
install failed 

[email protected]:~$ pear install --force phpunit/PHPUnit 

WARNING: configuration download directory "/tmp/pear/download" is not writeable. Change download_dir config variable to a writeable dir to avoid this warning 
Cannot install, php_dir for channel "pear.phpunit.de" is not writeable by the current user 

[email protected]:~$ sudo pear install --force phpunit/PHPUnit 

Did not download optional dependencies: phpunit/PHP_Invoker, use --alldeps to download automatically 
downloading PHPUnit-3.6.3.tgz ... 
Starting to download PHPUnit-3.6.3.tgz (116,362 bytes) 
.........................done: 116,362 bytes 
install ok: channel://pear.phpunit.de/PHPUnit-3.6.3 

[email protected]:~$ phpunit 

PHP Warning: require_once(PHPUnit/Framework/MockObject/Autoload.php): failed to open stream: No such file or directory in /usr/share/php/PHPUnit/Autoload.php on line 48 
PHP Fatal error: require_once(): Failed opening required 'PHPUnit/Framework/MockObject/Autoload.php' (include_path='.:/usr/share/php/:/usr/local/share/php/library') in /usr/share/php/PHPUnit/Autoload.php on line 48 
+0

लिखने योग्य त्रुटि के लिए php.ini (लाइन 988) [Phar] देखें; http://php.net/phar.readonly;phar.readonly = बंद – davidcondrey

उत्तर

63

यह सही PHPUnit ऊपर उठाता है, लेकिन अन्य संकुल याद कर रहे हैं। आप

sudo pear install --alldeps --force phpunit/phpunit 

का उपयोग कर इसे ठीक करने में सक्षम होना चाहिए या आप केवल lib कि इस मुद्दे को हो रहा है अद्यतन करने के लिए चाहते हैं:

sudo pear install --force phpunit/PHPUnit_MockObject 

विंडोज उपयोगकर्ता: न आना "sudo" अगर आप कर रहे हैं विंडोज प्लेटफ़ॉर्म पर

+6

इसका उपयोग करके फिक्स्ड: सुडो नाशपाती इंस्टॉल --force phpunit/PHPUnit_MockObject – dimbo

+2

क्या एक बेवकूफ त्रुटि है। यह एक निर्भरता के रूप में mockobject क्यों स्थापित नहीं करता है? इसके लिए धन्यवाद, वैसे भी! – Duke

+0

@Duke अगर नाशपाती सही तरीके से काम करता है तो यह करता है :) – edorian