วิธีแก้ปัญหา Unittest Warning: require_once(PHP/CodeCoverage/Filter.php): failed

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: วิธีแก้ปัญหา Unittest Warning: require_once(PHP/CodeCoverage/Filter.php): failed

Re: วิธีแก้ปัญหา Unittest Warning: require_once(PHP/CodeCoverage/Filter.php): failed

โดย บุคคลทั่วไป » 24/11/2022 4:46 pm

ใช้ phpunit หรือ selenium ดีกว่ากันเขียนเป็นแต่ PHP

วิธีแก้ปัญหา Unittest Warning: require_once(PHP/CodeCoverage/Filter.php): failed

โดย mindphp » 21/11/2012 5:49 pm

จากบทความ

วิธีติดตั้ง phpunit

วันนี้เจอปัญหา อยู่ๆ phpunit หรือเจ้า unit test ทำงานไม่ได้
เพราะ เปลี่ยน เวอร์ชั่นของ xampp
พอจะใช้ unit test เช็ค functional test เจอปัญหาตามนี้

โค้ด: เลือกทั้งหมด

D:\xampp\php>phpunit
Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No su
ch file or directory in D:\xampp\php\phpunit on line 38

Fatal error: require_once(): Failed opening required 'PHP/CodeCoverage/Filter.ph
p' (include_path='.;D:\xampp\php\PEAR') in D:\xampp\php\phpunit on line 38

ทางแก้คือ ให้ทำการอัพเดด Pear ใหม่
แต่เมืออัพแดด pear แล้วยังเจอปัญหา

phpunit Fatal error: Call to undefined method PHP_CodeCoverage_Filter::getInstance() in

ให้แก้ โดย force install ใหม่ ด้วย packet ใหม่เลย

โค้ด: เลือกทั้งหมด

#pear channel-discover pear.phpunit.de

#pear channel-discover pear.symfony-project.com

#pear channel-discover components.ez.no

#pear update-channels

#pear upgrade-all

#pear install --alldeps phpunit/PHPUnit

#pear install --force --alldeps phpunit/PHPUnit
รอซักพัก phpunit เราก็จะกลับมาใช้งานได้เหมือนเดิม :-D :-D

ข้างบน