Testing involves two things:
Installing and uninstalling the package to verify that the package
scripts, if any, work and to finally test that the tarball is good
Running package regression tests with pear run-tests
This means we need to make a regression test for our HelloWorld package.
These tests use PHP’s “.phpt” format; here is an example:
–TEST–
HelloWorld test
–FILE–
<?php
include dirname(__FILE__).’/../HelloWorld.php’;
new HelloWorld(false);
new HelloWorld(true);
–EXPECT–
Hello, World!
Hello, World!<br />
The –FOO– lines mark the start of different sections. The .phpt format
defines these sections:
TEST. Title of the test.
SKIPIF. PHP code (must start with <?php) run to determine whether the test
should be executed at all. The test is skipped if this code prints skip.
FILE. PHP code that comprises the test itself.
EXPECT. The expected output of the PHP code in the FILE section.
GET. HTTP GET input variables (for example, foo=bar&ya=da, which requires
CGI binary).
POST. Raw HTTP POST data (same format as GET data), which requires CGI
binary.
The pear run-tests command looks for files with the ending “.phpt” in the
current directory, or subdirectories called “tests.”
-
‹ Home
-
Categories
- .Net
- Ajax
- Basic of Computers
- Basic of MySQL
- C For Beginners
- C Programming
- C# Professional in 15 days - (Book)
- CSS
- CSS Advanced
- CSS For Beginners
- Free Computer Books Online
- HTML For Advanced
- HTML for Beginners
- HTML Tips and Tricks
- INDEX
- Introduction to JavaScript
- Java 2 (simpler way-Old version)
- Javascript
- Javascript For Beginners
- Javascript Tutorial for Beginners
- jQuery
- Linux/Unix
- miscellaneous tricks
- Mozilla firefox tricks
- MS word tricks
- MySQL Basic
- Mysql Classes
- Mysql Functions
- News and Alerts
- Notepad tricks
- PHP
- PHP 5 Power Programming
- PHP Ad Management
- PHP and MySQL - From Beginning to Professional
- PHP and XML
- PHP Script
- PHP Tricks
- Professional C sharp
- Tips and tricks
- Windows tricks
- Wordpress
- Wordpress Plugins
-
Tags
acrobat adobe amazon apple basic of computer CSS css3 current news David Hill delete dell escape google Hack HP IBM IE interesting news internet IT Javascript keyboard knowledge laptop lenovo miscellaneos tricks mouse event mozilla firefox Netezza Corp news News and Alerts onmouseout onmouseover opera oracle PC pdf Robin Johnson safari shortcuts sun microsystems Teradata Corp Tips and tricks windows yahoo
-
Archives
-
RSS Feeds
-
Account
Post a Comment