note 110174 deleted from function.basename by googleguy

From: Date: Thu, 27 Sep 2012 01:12:44 +0000
Subject: note 110174 deleted from function.basename by googleguy
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-191036@lists.php.net to get a copy of this message
Note Submitter: erelsgl at gmail dot com ---- Here is a simple way to add a unit-test at the bottom of your library files: <?php // your library functions if (basename(__FILE__)==basename($_SERVER['PHP_SELF'])) { // your unit test } ?> When the library is included in another file, the whole unit-test section will be ignored. It will be activated only when you point your browser to the library file.

« previous php.notes (#191036) next »