summaryrefslogtreecommitdiff
path: root/ext/phar/tests/bug65028.phpt
blob: 7d24ead69d78bc18f5ce063b7c462e164862e710 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
--TEST--
Phar - test specific manifest length
--INI--
phar.readonly=0
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--FILE--
<?php

$files = array(
	"lib/widgets/Widgets.php",
	"lib/events/FormBeginEventArgs.php",
	"lib/events/FormEndEventArgs.php",
	"lib/Core.php",
	"lib/database/MySqlDatabase.php",
	"lib/utils/DateUtil.php",
	"js/global.js",
	"files/_emptyDirectory",
	"files/search/schema.xml",
	"vendor/Fusonic/Linq/Internal/WhereIterator.php",
	"vendor/Fusonic/Linq/Internal/SelectManyIterator.php",
	"vendor/Fusonic/Linq/Internal/SelectIterator.php",
	"vendor/Fusonic/Linq/Internal/DiffIterator.php",
	"vendor/Fusonic/Linq/Internal/GroupIterator.php",
	"vendor/Fusonic/Linq/Internal/DistinctIterator.php",
	"vendor/Fusonic/Linq/Internal/LinqHelper.php",
	"vendor/Fusonic/Linq/Internal/OrderIterator.php",
	"vendor/Fusonic/Linq/Internal/IntersectIterator.php",
	"vendor/Fusonic/Linq/GroupedLinq.php",
	"vendor/Fusonic/Linq.php",
	"vendor/Fusonic/UI/Widgets/Forms/FormBegin.php",
	"vendor/Fusonic/UI/Widgets/Forms/FormSectionBuilder.php",
	"vendor/Fusonic/UI/Widgets/Forms/AutoSelect.php",
	"vendor/Fusonic/UI/Widgets/Forms/ControlGroup.php",
	"vendor/Fusonic/UI/Widgets/Forms/FormEnd.php",
	"vendor/Fusonic/UI/Widgets/WidgetBase.php",
	"modules/calendar/ajax/calendarGetInvitedUsersContentAjaxHandler.php",
	"modules/calendar/js/calendarAppointmentForm.js",
	"modules/calendar/misc/calendarAppointment.php",
	"modules/calendar/pages/forms/calendarAppointmentForm.php",
	"modules/calendar/setup/config.xml",
	"modules/cmt/js/cmtMicroCommentsWidget.js",
	"modules/cmt/setup/config.xml",
	"modules/meta/misc/metaContentHelper.php",
	"modules/meta/setup/config.xml",
	"modules/brd/misc/brdPostStreamFormatter.php",
	"modules/brd/misc/brdPost.php",
	"modules/brd/setup/config/streamContents.xml",
	"modules/brd/setup/resources/lang/en.xml",
	"modules/brd/setup/resources/lang/de.xml",
	"modules/brd/setup/config.xml",
	"modules/auth/misc/authLoginService.php",
	"modules/auth/setup/config.xml",
	"modules/bwd/cache/bwdWordCacheCreator.php",
	"modules/bwd/bwd.php",
	"modules/bwd/setup/config.xml",
	"modules/nws/templates/pages/forms/nwsNewsForm.tpl",
	"modules/nws/templates/pages/nwsShowNewsPage.tpl",
	"modules/nws/pages/forms/nwsNewsForm.php",
	"modules/nws/pages/nwsShowNewsPage.php",
	"modules/nws/setup/config.xml",
	"modules/gmp/cache/gmpMarkersCacheCreator.php",
	"modules/gmp/select/gmpMapContentSelect.php",
	"modules/gmp/templates/gmpShowAppointmentPage.tpl",
	"modules/gmp/templates/gmpShowLinkPage.tpl",
	"modules/gmp/setup/config.xml",
	"modules/mul/cache/mulVideoPortalCacheCreator.php",
	"modules/mul/misc/mulPermissionHelper.php",
	"modules/mul/templates/widgets/mulFileEmbedWidget_Video_Flv.tpl",
	"modules/mul/setup/config/mulUploadVideoPortalMatches.xml",
	"modules/mul/setup/config.xml",
	"modules/cat/select/catCategorySelect.php",
	"modules/cat/misc/catCategory.php",
	"modules/cat/templates/pages/forms/catCategoryForm.tpl",
	"modules/cat/pages/forms/catEditCategoryForm.php",
	"modules/cat/pages/forms/catAddCategoryForm.php",
	"modules/cat/setup/config.xml",
	"modules/sty/events/styPageShowEventHandler.php",
	"modules/sty/misc/styBox.php",
	"modules/sty/templates/pages/forms/styLayoutForm.tpl",
	"modules/sty/templates/pages/forms/styBoxForm.tpl",
	"modules/sty/templates/pages/forms/styVariantForm.tpl",
	"modules/sty/setup/resources/lang/en.xml",
	"modules/sty/setup/resources/lang/de.xml",
	"modules/sty/setup/config.xml",
	"modules/reg/misc/regRegistrationHelper.php",
	"modules/reg/setup/config.xml",
	"modules/not/misc/notEmailNotificationProvider.php",
	"modules/not/setup/config.xml",
	"modules/styfusonic/setup/config.xml",
	"modules/sys/ajax/sysUserAutoSuggestSelectAjaxHandler.php",
	"modules/sys/js/sysUserAutoSuggestSelect.js",
	"modules/sys/select/sysPermissionSelect.php",
	"modules/sys/misc/sysHtaccessConfigWriter.php",
	"modules/sys/misc/sysUserRepository.php",
	"modules/sys/setup/resources/lang/en.xml",
	"modules/sys/setup/resources/lang/de.xml",
	"modules/sys/setup/config.xml",
	"modules/igr/boxes/igrGreatestEntriesBoxTab.php",
	"modules/igr/boxes/igrTopRatedEntriesBoxTab.php",
	"modules/igr/setup/config.xml",
	"modules/rat/ajax/ratRateAjaxHandler.php",
	"modules/rat/ajax/ratUnlikeAjaxHandler.php",
	"modules/rat/setup/config.xml",
	"modules/search/select/searchModuleSelect.php",
	"modules/search/select/searchOrderSelect.php",
	"modules/search/misc/searchResultFormatter.php",
	"modules/search/misc/searchProviderSolr.php",
	"modules/search/misc/searchProviderLucene.php",
	"modules/search/misc/searchResultItem.php",
	"modules/search/misc/searchProviderBase.php",
	"modules/search/misc/searchIProvider.php",
	"modules/search/templates/misc/searchResultFormatter.tpl",
	"modules/search/templates/pages/searchIndexPage.tpl",
	"modules/search/templates/pages/forms/searchSearchForm.tpl",
	"modules/search/pages/forms/searchSearchForm.php",
	"modules/search/css/searchResultFormatter.css",
	"modules/search/setup/config/sysSettings.xml",
	"modules/search/setup/resources/lang/en.xml",
	"modules/search/setup/resources/lang/de.xml",
	"modules/search/setup/config.xml",
	"style/Fusonic/40components.css",
	"style/_emptyDirectory",
	"index.php",
//	"a", // This will make the test pass
);

// Create Phar with the filenames above
$phar = new Phar(__DIR__ . "/bug65028.phar");
foreach($files as $file)
{
	$phar->addFromString($file, "");
}

// Copy phar
copy(__DIR__ . "/bug65028.phar", __DIR__ . "/bug65028-copy.phar");

// Open phar
try
{
	$phar = new Phar(__DIR__ . "/bug65028-copy.phar");
	echo "No exception thrown.\n";
}
catch(UnexpectedValueException $ex)
{
	echo "Exception thrown: " . $ex->getMessage() . "\n";
}
?>
--CLEAN--
<?php
@unlink(__DIR__ . "/bug65028.phar");
@unlink(__DIR__ . "/bug65028-copy.phar");
?>
--EXPECT--
No exception thrown.