File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / file / is_dir_variation1.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:03 2012 UTC (12 years, 6 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--TEST--
Test is_dir() function: usage variations - dir/subdir
--FILE--
<?php
/* Prototype: bool is_dir ( string $dirname );
   Description: Tells whether the dirname is a directory
     Returns TRUE if the dirname exists and is a directory, FALSE  otherwise.
*/

/* Testing is_dir() with base and sub dirs */

$file_path = dirname(__FILE__);

echo "-- Testing is_dir() with an empty dir --\n";
$dirname = $file_path."/is_dir_variation1";
mkdir($dirname);
var_dump( is_dir($dirname) );
clearstatcache();

echo "-- Testing is_dir() with a subdir in base dir --\n";
$subdirname = $dirname."/is_dir_variation1_sub";
mkdir($subdirname);
var_dump( is_dir($subdirname) );
var_dump( is_dir($dirname) );

echo "\n*** Done ***";
?>
--CLEAN--
<?php
$file_path = dirname(__FILE__);
$dir_name = $file_path."/is_dir_variation1";
rmdir($dir_name."/is_dir_variation1_sub");
rmdir($dir_name);
?>
--EXPECTF--
-- Testing is_dir() with an empty dir --
bool(true)
-- Testing is_dir() with a subdir in base dir --
bool(true)
bool(true)

*** Done ***

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>