xref: /php-src/ext/phar/tests/create_new_phar.phpt (revision 74859783)
1--TEST--
2Phar: create a completely new phar
3--EXTENSIONS--
4phar
5--INI--
6phar.readonly=0
7phar.require_hash=1
8--FILE--
9<?php
10
11file_put_contents('phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php/a.php',
12    "brand new!\n");
13include 'phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php/a.php';
14
15$fileName = "ChineseFile\xE5\x84\xB7\xE9\xBB\x91.php";
16file_put_contents('phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php/$fileName.php',
17    'Text in utf8 file.');
18include 'phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php/$fileName.php';
19?>
20
21--CLEAN--
22<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
23--EXPECT--
24brand new!
25Text in utf8 file.
26