| ก่อนทำตามบทความนี้ ต้องอ่านวิธีติดตั้ง Unittest และ Selenium ที่ เตรียมเครื่องทำ สำหรับ PHPUnit และ Selenium หลังจากที่เรา ใช้ yiic webappสร้าง webapplication จะได้ โครงสร้างไฟล์ และ ไดเรกทอรี สำหรับ test ระบบตามโครงสร้างดังนี้ protected/ protected application files tests/ tests for the application fixtures/ ข้อมูลสำหรับ test เก็บในฐานข้อมูล functional/ เก็บ functional tests unit/ ไฟล์สำหรับทำ unit tests report/ เก็บไฟล์ coverage reports bootstrap.php ไฟล์สำหรับกำหนดค่าต่างๆ ไว้ใช้งานเมื่อเริ่มรันโปรแกรม phpunit.xml PHPUnit configuration file ของ PHPUnit WebTestCase.php the base class for Web-based functional tests วิธีรันโปรแกรมสำหรับ test (Testing การทดสอบ โปรแกรมประยุกต์บนเว็บ unit tests และ functional tests) สามารถรันโดยใช้คำสั่ง % cd testdrive/protected/testsถ้าต้องการรัน coverage reports ต้องติดตั้ง xdebug extension ไว้ในเครื่องด้วย (XAMPP มีมาให้เราใช้อยู่แล้ว แค่เปิดใช้งานมัน)
|
เขียนโดย Unittest วันจันทร์ที่ 18 กรกฏาคม 2011 เวลา 00:25 น.
, phpBB3, SMF, Joomla, Wordpress, CMS CRM
, JavaScript & Jquery Ajax
, SQL - Database
, ถาม - ตอบ คอมพิวเตอร์
, PHP Knowledge
, PHP News
, HTML CSS
, Free PHP Code Download script
, Web Hosting Review - Free Host Share Host VPS