]> granicus.if.org Git - php/commitdiff
forked test for win32
authorAnatol Belski <ab@php.net>
Mon, 13 Jan 2014 16:12:14 +0000 (17:12 +0100)
committerAnatol Belski <ab@php.net>
Mon, 13 Jan 2014 16:12:14 +0000 (17:12 +0100)
ext/opcache/tests/blacklist-win32.phpt [new file with mode: 0644]
ext/opcache/tests/blacklist.phpt

diff --git a/ext/opcache/tests/blacklist-win32.phpt b/ext/opcache/tests/blacklist-win32.phpt
new file mode 100644 (file)
index 0000000..909c695
--- /dev/null
@@ -0,0 +1,34 @@
+--TEST--
+Blacklist (with glob, quote and comments)
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.blacklist_filename={PWD}/opcache-*.blacklist
+opcache.file_update_protection=0
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php if (substr(PHP_OS, 0, 3) != 'WIN') {  die('skip only for Windows'); } ?>
+--FILE--
+<?php
+$conf = opcache_get_configuration();
+$conf = $conf['blacklist'];
+$conf[3] = preg_replace("!^\\Q".dirname(__FILE__)."\\E!", "__DIR__", $conf[3]); 
+$conf[4] = preg_replace("!^\\Q".dirname(__FILE__)."\\E!", "__DIR__", $conf[4]); 
+print_r($conf);
+include("blacklist.inc");
+$status = opcache_get_status();
+print_r(count($status['scripts']));
+?>
+--EXPECTF--
+Array
+(
+    [0] => C:\path\to\foo
+    [1] => C:\path\to\foo2
+    [2] => C:\path\to\bar
+    [3] => __DIR__\blacklist.inc
+    [4] => __DIR__\current.php
+    [5] => %scurrent.php
+    [6] => %scurrent.php
+)
+ok
+1
index 18c205cacf3cb7117197c912446633f93114d0d6..0c60425dac2e4bb34b014604700615db96e88fb9 100644 (file)
@@ -7,6 +7,7 @@ opcache.blacklist_filename={PWD}/opcache-*.blacklist
 opcache.file_update_protection=0
 --SKIPIF--
 <?php require_once('skipif.inc'); ?>
+<?php if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip not for Windows'); } ?>
 --FILE--
 <?php
 $conf = opcache_get_configuration();