Version Description
= 3.4 =
- This version introduces a major refactoring of the code responsible for the core backup engine. We made sure to write unit tests for the new code, and we have tested it on several user's sites. It fixes a lot of old bugs, and Windows users should see major improvements to reliability.
= 3.3.4 =
- WordPress 4.4 compatibility.
= 3.3.1 =
- Fixes a bug that would prevent downloading backups since 3.3.0 - please update.
= 3.2.5 =
- Security fixes related to add_query_arg
= 3.2.1 =
- Important bug fixes. Please upgrade to this version to avoid incomplete or broken backups.
= 3.1.3 =
- Fixes backwards compatibility for add-ons and avoids a Fatal Error. Please upgrade straight to this version before upgrading your add-ons.
= 3.0.4 =
- Fixes a few minor bugs. Immediate update is recommended.
= 3.0.2 =
- Important: we have dropped support for PHP 5.2, you will not be able to activate BackUpWordPress on a server running PHP versions older than PHP 5.3.29
= 3.0.1 =
- This is a critical update. Fixes a bug in the core backup library. Please update immediately.
Download this release
Release Info
Developer | xibodevelopment |
Plugin | BackUpWordPress |
Version | 3.12 |
Comparing to | |
See all releases |
Code changes from version 3.11 to 3.12
- backupwordpress.php +1 -1
- classes/class-plugin.php +1 -1
- composer.json +26 -0
- composer.lock +168 -0
- languages/backupwordpress.pot +1 -1
- readme.txt +6 -2
- vendor/ifsnop/mysqldump-php/.gitignore +4 -0
- vendor/ifsnop/mysqldump-php/.scrutinizer.yml +43 -0
- vendor/ifsnop/mysqldump-php/.travis.yml +41 -0
- vendor/ifsnop/mysqldump-php/tests/create_users.sh +24 -0
- vendor/ifsnop/mysqldump-php/tests/delete_users.sh +13 -0
- vendor/ifsnop/mysqldump-php/tests/test.php +100 -0
- vendor/ifsnop/mysqldump-php/tests/test.sh +152 -0
- vendor/ifsnop/mysqldump-php/tests/test001.src.sql +136 -0
- vendor/ifsnop/mysqldump-php/tests/test002.src.sql +14 -0
- vendor/ifsnop/mysqldump-php/tests/test005.src.sql +12 -0
- vendor/ifsnop/mysqldump-php/tests/test006.src.sql +107 -0
- vendor/ifsnop/mysqldump-php/tests/test008.src.sql +80 -0
- vendor/ifsnop/mysqldump-php/tests/test009.src.sql +57 -0
- vendor/ifsnop/mysqldump-php/tests/test010.src.sql +56 -0
- vendor/ifsnop/mysqldump-php/tests/test011.src.sql +52 -0
- vendor/symfony/finder/.gitignore +0 -3
- vendor/symfony/finder/README.md +0 -14
- vendor/symfony/finder/Tests/BsdFinderTest.php +0 -44
- vendor/symfony/finder/Tests/Comparator/ComparatorTest.php +0 -65
- vendor/symfony/finder/Tests/Comparator/DateComparatorTest.php +0 -64
- vendor/symfony/finder/Tests/Comparator/NumberComparatorTest.php +0 -108
- vendor/symfony/finder/Tests/Expression/ExpressionTest.php +0 -72
- vendor/symfony/finder/Tests/Expression/GlobTest.php +0 -51
- vendor/symfony/finder/Tests/Expression/RegexTest.php +0 -147
- vendor/symfony/finder/Tests/FakeAdapter/DummyAdapter.php +0 -57
- vendor/symfony/finder/Tests/FakeAdapter/FailingAdapter.php +0 -45
- vendor/symfony/finder/Tests/FakeAdapter/NamedAdapter.php +0 -57
- vendor/symfony/finder/Tests/FakeAdapter/UnsupportedAdapter.php +0 -44
- vendor/symfony/finder/Tests/FinderTest.php +0 -787
- vendor/symfony/finder/Tests/Fixtures/A/B/C/abc.dat +0 -0
- vendor/symfony/finder/Tests/Fixtures/A/B/ab.dat +0 -0
- vendor/symfony/finder/Tests/Fixtures/A/a.dat +0 -0
- vendor/symfony/finder/Tests/Fixtures/copy/A/B/C/abc.dat.copy +0 -0
- vendor/symfony/finder/Tests/Fixtures/copy/A/B/ab.dat.copy +0 -0
- vendor/symfony/finder/Tests/Fixtures/copy/A/a.dat.copy +0 -0
- vendor/symfony/finder/Tests/Fixtures/dolor.txt +0 -2
- vendor/symfony/finder/Tests/Fixtures/ipsum.txt +0 -2
- vendor/symfony/finder/Tests/Fixtures/lorem.txt +0 -2
- vendor/symfony/finder/Tests/Fixtures/one/a +0 -0
- vendor/symfony/finder/Tests/Fixtures/one/b/c.neon +0 -0
- vendor/symfony/finder/Tests/Fixtures/one/b/d.neon +0 -0
- vendor/symfony/finder/Tests/Fixtures/r+e.gex[c]a(r)s/dir/bar.dat +0 -0
- vendor/symfony/finder/Tests/Fixtures/with space/foo.txt +0 -0
- vendor/symfony/finder/Tests/GlobTest.php +0 -26
- vendor/symfony/finder/Tests/GnuFinderTest.php +0 -44
- vendor/symfony/finder/Tests/Iterator/CustomFilterIteratorTest.php +0 -46
- vendor/symfony/finder/Tests/Iterator/DateRangeFilterIteratorTest.php +0 -74
- vendor/symfony/finder/Tests/Iterator/DepthRangeFilterIteratorTest.php +0 -83
- vendor/symfony/finder/Tests/Iterator/ExcludeDirectoryFilterIteratorTest.php +0 -80
- vendor/symfony/finder/Tests/Iterator/FilePathsIteratorTest.php +0 -72
- vendor/symfony/finder/Tests/Iterator/FileTypeFilterIteratorTest.php +0 -73
- vendor/symfony/finder/Tests/Iterator/FilecontentFilterIteratorTest.php +0 -86
- vendor/symfony/finder/Tests/Iterator/FilenameFilterIteratorTest.php +0 -54
- vendor/symfony/finder/Tests/Iterator/FilterIteratorTest.php +0 -51
- vendor/symfony/finder/Tests/Iterator/Iterator.php +0 -55
- vendor/symfony/finder/Tests/Iterator/IteratorTestCase.php +0 -100
- vendor/symfony/finder/Tests/Iterator/MockFileListIterator.php +0 -21
- vendor/symfony/finder/Tests/Iterator/MockSplFileInfo.php +0 -132
- vendor/symfony/finder/Tests/Iterator/MultiplePcreFilterIteratorTest.php +0 -71
- vendor/symfony/finder/Tests/Iterator/PathFilterIteratorTest.php +0 -82
- vendor/symfony/finder/Tests/Iterator/RealIteratorTestCase.php +0 -119
- vendor/symfony/finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php +0 -59
- vendor/symfony/finder/Tests/Iterator/SizeRangeFilterIteratorTest.php +0 -69
- vendor/symfony/finder/Tests/Iterator/SortableIteratorTest.php +0 -183
- vendor/symfony/finder/Tests/PhpFinderTest.php +0 -45
- vendor/symfony/finder/Tests/Shell/CommandTest.php +0 -166
backupwordpress.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: BackUpWordPress
|
4 |
Plugin URI: https://updraftplus.com/backupwordpress/?afref=744
|
5 |
Description: Simple automated backups of your WordPress powered website. Once activated you'll find me under <strong>Tools → Backups</strong>. On multisite, you'll find me under the Network Settings menu.
|
6 |
-
Version: 3.
|
7 |
Author: XIBO Ltd
|
8 |
Author URI: https://profiles.wordpress.org/xibodevelopment
|
9 |
License: GPL-2+
|
3 |
Plugin Name: BackUpWordPress
|
4 |
Plugin URI: https://updraftplus.com/backupwordpress/?afref=744
|
5 |
Description: Simple automated backups of your WordPress powered website. Once activated you'll find me under <strong>Tools → Backups</strong>. On multisite, you'll find me under the Network Settings menu.
|
6 |
+
Version: 3.12
|
7 |
Author: XIBO Ltd
|
8 |
Author URI: https://profiles.wordpress.org/xibodevelopment
|
9 |
License: GPL-2+
|
classes/class-plugin.php
CHANGED
@@ -6,7 +6,7 @@ namespace HM\BackUpWordPress;
|
|
6 |
* Class Plugin
|
7 |
*/
|
8 |
final class Plugin {
|
9 |
-
const PLUGIN_VERSION = '3.
|
10 |
|
11 |
/**
|
12 |
* @var Plugin The singleton instance.
|
6 |
* Class Plugin
|
7 |
*/
|
8 |
final class Plugin {
|
9 |
+
const PLUGIN_VERSION = '3.12';
|
10 |
|
11 |
/**
|
12 |
* @var Plugin The singleton instance.
|
composer.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name" : "humanmade/backupwordpress",
|
3 |
+
"description": "Simple automated backups of your WordPress powered website.",
|
4 |
+
"keywords" : [
|
5 |
+
"wordpress",
|
6 |
+
"backup"
|
7 |
+
],
|
8 |
+
"type" : "wordpress-plugin",
|
9 |
+
"homepage" : "https://github.com/humanmade/backupwordpress",
|
10 |
+
"license" : "GPL-2.0",
|
11 |
+
"authors" : [
|
12 |
+
{
|
13 |
+
"name" : "Human Made Limited",
|
14 |
+
"email" : "backupwordpress@hmn.md",
|
15 |
+
"homepage": "https://bwp.hmn.md/"
|
16 |
+
}
|
17 |
+
],
|
18 |
+
"support" : {
|
19 |
+
"issues": "https://github.com/humanmade/backupwordpress/issues"
|
20 |
+
},
|
21 |
+
"require": {
|
22 |
+
"symfony/finder": "~2.8",
|
23 |
+
"symfony/process": "~2.8",
|
24 |
+
"ifsnop/mysqldump-php":"~2.1"
|
25 |
+
}
|
26 |
+
}
|
composer.lock
ADDED
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_readme": [
|
3 |
+
"This file locks the dependencies of your project to a known state",
|
4 |
+
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
5 |
+
"This file is @generated automatically"
|
6 |
+
],
|
7 |
+
"content-hash": "178e95a25ce4467f191024f0a677b2df",
|
8 |
+
"packages": [
|
9 |
+
{
|
10 |
+
"name": "ifsnop/mysqldump-php",
|
11 |
+
"version": "v2.3.1",
|
12 |
+
"source": {
|
13 |
+
"type": "git",
|
14 |
+
"url": "https://github.com/ifsnop/mysqldump-php.git",
|
15 |
+
"reference": "1806317c2ce897cb38fbae5283f17d1451308244"
|
16 |
+
},
|
17 |
+
"dist": {
|
18 |
+
"type": "zip",
|
19 |
+
"url": "https://api.github.com/repos/ifsnop/mysqldump-php/zipball/1806317c2ce897cb38fbae5283f17d1451308244",
|
20 |
+
"reference": "1806317c2ce897cb38fbae5283f17d1451308244",
|
21 |
+
"shasum": ""
|
22 |
+
},
|
23 |
+
"require": {
|
24 |
+
"php": ">=5.3.0"
|
25 |
+
},
|
26 |
+
"require-dev": {
|
27 |
+
"phpunit/phpunit": "3.7.*",
|
28 |
+
"squizlabs/php_codesniffer": "1.*"
|
29 |
+
},
|
30 |
+
"type": "library",
|
31 |
+
"autoload": {
|
32 |
+
"psr-4": {
|
33 |
+
"Ifsnop\\": "src/Ifsnop/"
|
34 |
+
}
|
35 |
+
},
|
36 |
+
"notification-url": "https://packagist.org/downloads/",
|
37 |
+
"license": [
|
38 |
+
"MIT"
|
39 |
+
],
|
40 |
+
"authors": [
|
41 |
+
{
|
42 |
+
"name": "Diego Torres",
|
43 |
+
"homepage": "https://github.com/ifsnop",
|
44 |
+
"role": "Developer"
|
45 |
+
}
|
46 |
+
],
|
47 |
+
"description": "This is a php version of linux's mysqldump in terminal \"$ mysqldump -u username -p...\"",
|
48 |
+
"homepage": "https://github.com/ifsnop/mysqldump-php",
|
49 |
+
"keywords": [
|
50 |
+
"backup",
|
51 |
+
"database",
|
52 |
+
"dump",
|
53 |
+
"export",
|
54 |
+
"mysql",
|
55 |
+
"mysqldump",
|
56 |
+
"pdo",
|
57 |
+
"sqlite"
|
58 |
+
],
|
59 |
+
"time": "2017-05-07T22:27:29+00:00"
|
60 |
+
},
|
61 |
+
{
|
62 |
+
"name": "symfony/finder",
|
63 |
+
"version": "v2.8.21",
|
64 |
+
"source": {
|
65 |
+
"type": "git",
|
66 |
+
"url": "https://github.com/symfony/finder.git",
|
67 |
+
"reference": "b058a6f0cb6ee9b6b727aae03d5a62474a308528"
|
68 |
+
},
|
69 |
+
"dist": {
|
70 |
+
"type": "zip",
|
71 |
+
"url": "https://api.github.com/repos/symfony/finder/zipball/b058a6f0cb6ee9b6b727aae03d5a62474a308528",
|
72 |
+
"reference": "b058a6f0cb6ee9b6b727aae03d5a62474a308528",
|
73 |
+
"shasum": ""
|
74 |
+
},
|
75 |
+
"require": {
|
76 |
+
"php": ">=5.3.9"
|
77 |
+
},
|
78 |
+
"type": "library",
|
79 |
+
"extra": {
|
80 |
+
"branch-alias": {
|
81 |
+
"dev-master": "2.8-dev"
|
82 |
+
}
|
83 |
+
},
|
84 |
+
"autoload": {
|
85 |
+
"psr-4": {
|
86 |
+
"Symfony\\Component\\Finder\\": ""
|
87 |
+
},
|
88 |
+
"exclude-from-classmap": [
|
89 |
+
"/Tests/"
|
90 |
+
]
|
91 |
+
},
|
92 |
+
"notification-url": "https://packagist.org/downloads/",
|
93 |
+
"license": [
|
94 |
+
"MIT"
|
95 |
+
],
|
96 |
+
"authors": [
|
97 |
+
{
|
98 |
+
"name": "Fabien Potencier",
|
99 |
+
"email": "fabien@symfony.com"
|
100 |
+
},
|
101 |
+
{
|
102 |
+
"name": "Symfony Community",
|
103 |
+
"homepage": "https://symfony.com/contributors"
|
104 |
+
}
|
105 |
+
],
|
106 |
+
"description": "Symfony Finder Component",
|
107 |
+
"homepage": "https://symfony.com",
|
108 |
+
"time": "2017-05-25T22:57:22+00:00"
|
109 |
+
},
|
110 |
+
{
|
111 |
+
"name": "symfony/process",
|
112 |
+
"version": "v2.8.21",
|
113 |
+
"source": {
|
114 |
+
"type": "git",
|
115 |
+
"url": "https://github.com/symfony/process.git",
|
116 |
+
"reference": "d54232f5682fda2f8bbebff7c81b864646867ab9"
|
117 |
+
},
|
118 |
+
"dist": {
|
119 |
+
"type": "zip",
|
120 |
+
"url": "https://api.github.com/repos/symfony/process/zipball/d54232f5682fda2f8bbebff7c81b864646867ab9",
|
121 |
+
"reference": "d54232f5682fda2f8bbebff7c81b864646867ab9",
|
122 |
+
"shasum": ""
|
123 |
+
},
|
124 |
+
"require": {
|
125 |
+
"php": ">=5.3.9"
|
126 |
+
},
|
127 |
+
"type": "library",
|
128 |
+
"extra": {
|
129 |
+
"branch-alias": {
|
130 |
+
"dev-master": "2.8-dev"
|
131 |
+
}
|
132 |
+
},
|
133 |
+
"autoload": {
|
134 |
+
"psr-4": {
|
135 |
+
"Symfony\\Component\\Process\\": ""
|
136 |
+
},
|
137 |
+
"exclude-from-classmap": [
|
138 |
+
"/Tests/"
|
139 |
+
]
|
140 |
+
},
|
141 |
+
"notification-url": "https://packagist.org/downloads/",
|
142 |
+
"license": [
|
143 |
+
"MIT"
|
144 |
+
],
|
145 |
+
"authors": [
|
146 |
+
{
|
147 |
+
"name": "Fabien Potencier",
|
148 |
+
"email": "fabien@symfony.com"
|
149 |
+
},
|
150 |
+
{
|
151 |
+
"name": "Symfony Community",
|
152 |
+
"homepage": "https://symfony.com/contributors"
|
153 |
+
}
|
154 |
+
],
|
155 |
+
"description": "Symfony Process Component",
|
156 |
+
"homepage": "https://symfony.com",
|
157 |
+
"time": "2017-05-08T01:19:21+00:00"
|
158 |
+
}
|
159 |
+
],
|
160 |
+
"packages-dev": [],
|
161 |
+
"aliases": [],
|
162 |
+
"minimum-stability": "stable",
|
163 |
+
"stability-flags": [],
|
164 |
+
"prefer-stable": false,
|
165 |
+
"prefer-lowest": false,
|
166 |
+
"platform": [],
|
167 |
+
"platform-dev": []
|
168 |
+
}
|
languages/backupwordpress.pot
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the GPL-2+.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: BackUpWordPress 3.
|
6 |
"Report-Msgid-Bugs-To: support@xibomarketing.com\n"
|
7 |
"POT-Creation-Date: 2018-10-29 10:39:44+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
2 |
# This file is distributed under the GPL-2+.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: BackUpWordPress 3.12\n"
|
6 |
"Report-Msgid-Bugs-To: support@xibomarketing.com\n"
|
7 |
"POT-Creation-Date: 2018-10-29 10:39:44+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: xibodevelopment, willmot, dashaluna, pauldewouters, joehoyle, mattheu, tcrsavage, cuvelier, katmoody, sambulance
|
3 |
Tags: back up, backup, backups, database, zip, db, files, archive, wp-cli, xibodevelopment
|
4 |
Requires at least: 3.9
|
5 |
-
Tested up to: 5.
|
6 |
-
Stable tag: 3.
|
7 |
|
8 |
Simple automated backups of your WordPress-powered website.
|
9 |
|
@@ -157,6 +157,10 @@ users should see major improvements to reliability.
|
|
157 |
|
158 |
== Changelog ==
|
159 |
|
|
|
|
|
|
|
|
|
160 |
### 3.11 / 2021-03-08
|
161 |
|
162 |
* Updated to WP 5.7
|
2 |
Contributors: xibodevelopment, willmot, dashaluna, pauldewouters, joehoyle, mattheu, tcrsavage, cuvelier, katmoody, sambulance
|
3 |
Tags: back up, backup, backups, database, zip, db, files, archive, wp-cli, xibodevelopment
|
4 |
Requires at least: 3.9
|
5 |
+
Tested up to: 5.9
|
6 |
+
Stable tag: 3.12
|
7 |
|
8 |
Simple automated backups of your WordPress-powered website.
|
9 |
|
157 |
|
158 |
== Changelog ==
|
159 |
|
160 |
+
### 3.12 / 2022-01-27
|
161 |
+
|
162 |
+
* Updated to WP 5.9
|
163 |
+
|
164 |
### 3.11 / 2021-03-08
|
165 |
|
166 |
* Updated to WP 5.7
|
vendor/ifsnop/mysqldump-php/.gitignore
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/.project
|
2 |
+
/composer.phar
|
3 |
+
/.settings
|
4 |
+
/vendor/
|
vendor/ifsnop/mysqldump-php/.scrutinizer.yml
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
before_commands:
|
2 |
+
- 'composer install --dev --prefer-source'
|
3 |
+
|
4 |
+
checks:
|
5 |
+
php: true
|
6 |
+
|
7 |
+
filter:
|
8 |
+
excluded_paths: [vendor/*, tests/*]
|
9 |
+
|
10 |
+
tools:
|
11 |
+
php_mess_detector:
|
12 |
+
enabled: true
|
13 |
+
config:
|
14 |
+
controversial_rules:
|
15 |
+
camel_case_method_name: false
|
16 |
+
|
17 |
+
sensiolabs_security_checker: true
|
18 |
+
|
19 |
+
# Analyzes the size and structure of a PHP project.
|
20 |
+
php_pdepend: true
|
21 |
+
php_loc:
|
22 |
+
enabled: true
|
23 |
+
|
24 |
+
# We recommend to use PHP Code Similarity Analyzer instead as it is
|
25 |
+
# robust against code modifications and provides better targets for
|
26 |
+
# refactoring.
|
27 |
+
php_cpd: false
|
28 |
+
php_sim: true
|
29 |
+
|
30 |
+
# PHP Analyzer is our own analysis tool for PHP code. It’s latest
|
31 |
+
# version is exclusively available through the hosted version on
|
32 |
+
# scrutinizer-ci.com.
|
33 |
+
php_analyzer: true
|
34 |
+
php_code_sniffer:
|
35 |
+
enabled: true
|
36 |
+
config:
|
37 |
+
standard: "PSR1"
|
38 |
+
sniffs:
|
39 |
+
generic:
|
40 |
+
naming_conventions:
|
41 |
+
camel_caps_function_name_sniff: false
|
42 |
+
files:
|
43 |
+
one_class_per_file_sniff: false
|
vendor/ifsnop/mysqldump-php/.travis.yml
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
dist: trusty
|
2 |
+
sudo: required
|
3 |
+
|
4 |
+
language: php
|
5 |
+
|
6 |
+
php:
|
7 |
+
- 7.1
|
8 |
+
- 7.0
|
9 |
+
- 5.6
|
10 |
+
- 5.5
|
11 |
+
- 5.4
|
12 |
+
# - 5.3
|
13 |
+
- hhvm
|
14 |
+
- nightly
|
15 |
+
|
16 |
+
services:
|
17 |
+
- mysql
|
18 |
+
|
19 |
+
before_script:
|
20 |
+
- curl -s http://getcomposer.org/installer | php
|
21 |
+
- php composer.phar install
|
22 |
+
- sudo service mysql stop || echo "mysql not stopped"
|
23 |
+
- echo mysql-apt-config mysql-apt-config/select-server select mysql-5.7 | sudo debconf-set-selections
|
24 |
+
- wget http://dev.mysql.com/get/mysql-apt-config_0.7.3-1_all.deb
|
25 |
+
- sudo dpkg --install mysql-apt-config_0.7.3-1_all.deb
|
26 |
+
- sudo apt-get update -q
|
27 |
+
- sudo apt-get install -q -y --force-yes -o Dpkg::Options::=--force-confnew mysql-server
|
28 |
+
- sudo mysql_upgrade
|
29 |
+
- sudo service mysql stop || echo "mysql not stopped"
|
30 |
+
- sudo mysqld_safe --skip-grant-tables &
|
31 |
+
- sleep 4
|
32 |
+
- sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
|
33 |
+
- sudo mysqladmin shutdown
|
34 |
+
- sleep 1
|
35 |
+
- sudo service mysql start
|
36 |
+
- mysql -V
|
37 |
+
- tests/create_users.sh
|
38 |
+
|
39 |
+
script:
|
40 |
+
- php src/Ifsnop/Mysqldump/Mysqldump.php
|
41 |
+
- cd tests && ./test.sh
|
vendor/ifsnop/mysqldump-php/tests/create_users.sh
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
mysql -u root -e "CREATE USER 'travis'@'%';"
|
4 |
+
mysql -u root -e "CREATE DATABASE test001;"
|
5 |
+
mysql -u root -e "CREATE DATABASE test002;"
|
6 |
+
mysql -u root -e "CREATE DATABASE test005;"
|
7 |
+
mysql -u root -e "CREATE DATABASE test006a;"
|
8 |
+
mysql -u root -e "CREATE DATABASE test006b;"
|
9 |
+
mysql -u root -e "CREATE DATABASE test008;"
|
10 |
+
mysql -u root -e "CREATE DATABASE test009;"
|
11 |
+
mysql -u root -e "CREATE DATABASE test010;"
|
12 |
+
mysql -u root -e "CREATE DATABASE test011;"
|
13 |
+
mysql -u root -e "GRANT ALL PRIVILEGES ON test001.* TO 'travis'@'%' WITH GRANT OPTION;"
|
14 |
+
mysql -u root -e "GRANT ALL PRIVILEGES ON test002.* TO 'travis'@'%' WITH GRANT OPTION;"
|
15 |
+
mysql -u root -e "GRANT ALL PRIVILEGES ON test005.* TO 'travis'@'%' WITH GRANT OPTION;"
|
16 |
+
mysql -u root -e "GRANT ALL PRIVILEGES ON test006a.* TO 'travis'@'%' WITH GRANT OPTION;"
|
17 |
+
mysql -u root -e "GRANT ALL PRIVILEGES ON test006b.* TO 'travis'@'%' WITH GRANT OPTION;"
|
18 |
+
mysql -u root -e "GRANT ALL PRIVILEGES ON test008.* TO 'travis'@'%' WITH GRANT OPTION;"
|
19 |
+
mysql -u root -e "GRANT ALL PRIVILEGES ON test009.* TO 'travis'@'%' WITH GRANT OPTION;"
|
20 |
+
mysql -u root -e "GRANT ALL PRIVILEGES ON test010.* TO 'travis'@'%' WITH GRANT OPTION;"
|
21 |
+
mysql -u root -e "GRANT ALL PRIVILEGES ON test011.* TO 'travis'@'%' WITH GRANT OPTION;"
|
22 |
+
mysql -u root -e "GRANT SUPER,LOCK TABLES ON *.* TO 'travis'@'%';"
|
23 |
+
mysql -u root -e "GRANT SELECT ON mysql.proc to 'travis'@'%';"
|
24 |
+
mysql -u root -e "FLUSH PRIVILEGES;"
|
vendor/ifsnop/mysqldump-php/tests/delete_users.sh
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
mysql -e "DROP DATABASE test001;"
|
4 |
+
mysql -e "DROP DATABASE test002;"
|
5 |
+
mysql -e "DROP DATABASE test005;"
|
6 |
+
mysql -e "DROP DATABASE test006a;"
|
7 |
+
mysql -e "DROP DATABASE test006b;"
|
8 |
+
mysql -e "DROP DATABASE test008;"
|
9 |
+
mysql -e "DROP DATABASE test009;"
|
10 |
+
|
11 |
+
mysql -e "DROP USER 'travis'";
|
12 |
+
|
13 |
+
mysql -e "FLUSH PRIVILEGES;"
|
vendor/ifsnop/mysqldump-php/tests/test.php
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
for($i=0;$i<128;$i++) {
|
4 |
+
echo "$i>" . bin2hex(chr($i)) . "<" . PHP_EOL;
|
5 |
+
}
|
6 |
+
*/
|
7 |
+
|
8 |
+
error_reporting(E_ALL);
|
9 |
+
|
10 |
+
include_once(dirname(__FILE__) . "/../src/Ifsnop/Mysqldump/Mysqldump.php");
|
11 |
+
|
12 |
+
use Ifsnop\Mysqldump as IMysqldump;
|
13 |
+
|
14 |
+
$dumpSettings = array(
|
15 |
+
'exclude-tables' => array('/^travis*/'),
|
16 |
+
'compress' => IMysqldump\Mysqldump::NONE,
|
17 |
+
'no-data' => false,
|
18 |
+
'add-drop-table' => true,
|
19 |
+
'single-transaction' => true,
|
20 |
+
'lock-tables' => true,
|
21 |
+
'add-locks' => true,
|
22 |
+
'extended-insert' => false,
|
23 |
+
'disable-keys' => true,
|
24 |
+
'skip-triggers' => false,
|
25 |
+
'add-drop-trigger' => true,
|
26 |
+
'routines' => true,
|
27 |
+
'databases' => false,
|
28 |
+
'add-drop-database' => false,
|
29 |
+
'hex-blob' => true,
|
30 |
+
'no-create-info' => false,
|
31 |
+
'where' => ''
|
32 |
+
);
|
33 |
+
|
34 |
+
$dump = new IMysqldump\Mysqldump(
|
35 |
+
"mysql:host=localhost;dbname=test001",
|
36 |
+
"travis",
|
37 |
+
"",
|
38 |
+
$dumpSettings);
|
39 |
+
$dump->start("mysqldump-php_test001.sql");
|
40 |
+
|
41 |
+
$dumpSettings['default-character-set'] = IMysqldump\Mysqldump::UTF8MB4;
|
42 |
+
$dumpSettings['complete-insert'] = true;
|
43 |
+
$dump = new IMysqldump\Mysqldump(
|
44 |
+
"mysql:host=localhost;dbname=test002",
|
45 |
+
"travis",
|
46 |
+
"",
|
47 |
+
$dumpSettings);
|
48 |
+
$dump->start("mysqldump-php_test002.sql");
|
49 |
+
|
50 |
+
$dumpSettings['complete-insert'] = false;
|
51 |
+
$dump = new IMysqldump\Mysqldump(
|
52 |
+
"mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=test005",
|
53 |
+
"travis",
|
54 |
+
"",
|
55 |
+
$dumpSettings);
|
56 |
+
$dump->start("mysqldump-php_test005.sql");
|
57 |
+
|
58 |
+
$dump = new IMysqldump\Mysqldump(
|
59 |
+
"mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=test006a",
|
60 |
+
"travis",
|
61 |
+
"",
|
62 |
+
array("no-data" => true, "add-drop-table" => true));
|
63 |
+
$dump->start("mysqldump-php_test006.sql");
|
64 |
+
|
65 |
+
$dump = new IMysqldump\Mysqldump(
|
66 |
+
"mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=test008",
|
67 |
+
"travis",
|
68 |
+
"",
|
69 |
+
array("no-data" => true, "add-drop-table" => true));
|
70 |
+
$dump->start("mysqldump-php_test008.sql");
|
71 |
+
|
72 |
+
$dump = new IMysqldump\Mysqldump(
|
73 |
+
"mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=test009",
|
74 |
+
"travis",
|
75 |
+
"",
|
76 |
+
array("no-data" => true, "add-drop-table" => true, "reset-auto-increment" => true, "add-drop-database" => true));
|
77 |
+
$dump->start("mysqldump-php_test009.sql");
|
78 |
+
|
79 |
+
$dump = new IMysqldump\Mysqldump(
|
80 |
+
"mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=test010",
|
81 |
+
"travis",
|
82 |
+
"",
|
83 |
+
array("events" => true));
|
84 |
+
$dump->start("mysqldump-php_test010.sql");
|
85 |
+
|
86 |
+
$dump = new IMysqldump\Mysqldump(
|
87 |
+
"mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=test011",
|
88 |
+
"travis",
|
89 |
+
"",
|
90 |
+
array('complete-insert' => false));
|
91 |
+
$dump->start("mysqldump-php_test011a.sql");
|
92 |
+
|
93 |
+
$dump = new IMysqldump\Mysqldump(
|
94 |
+
"mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=test011",
|
95 |
+
"travis",
|
96 |
+
"",
|
97 |
+
array('complete-insert' => true));
|
98 |
+
$dump->start("mysqldump-php_test011b.sql");
|
99 |
+
|
100 |
+
exit;
|
vendor/ifsnop/mysqldump-php/tests/test.sh
ADDED
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
function checksum_test001() {
|
4 |
+
for i in 000 001 002 003 010 011 015 027 029 033 200; do
|
5 |
+
mysql -utravis -B -e "CHECKSUM TABLE test${i}" test001 | grep -v -i checksum
|
6 |
+
done
|
7 |
+
}
|
8 |
+
|
9 |
+
function checksum_test002() {
|
10 |
+
for i in 201; do
|
11 |
+
mysql -utravis --default-character-set=utf8mb4 -B -e "CHECKSUM TABLE test${i}" test002 | grep -v -i checksum
|
12 |
+
done
|
13 |
+
}
|
14 |
+
|
15 |
+
function checksum_test005() {
|
16 |
+
for i in 000; do
|
17 |
+
mysql -utravis -B -e "CHECKSUM TABLE test${i}" test001 | grep -v -i checksum
|
18 |
+
done
|
19 |
+
}
|
20 |
+
|
21 |
+
for i in $(seq 0 35) ; do
|
22 |
+
ret[$i]=0
|
23 |
+
done
|
24 |
+
|
25 |
+
index=0
|
26 |
+
|
27 |
+
mysql -utravis < test001.src.sql; ret[((index++))]=$?
|
28 |
+
mysql -utravis --default-character-set=utf8mb4 < test002.src.sql; ret[((index++))]=$?
|
29 |
+
mysql -utravis < test005.src.sql; ret[((index++))]=$?
|
30 |
+
mysql -utravis < test006.src.sql; ret[((index++))]=$?
|
31 |
+
mysql -utravis < test008.src.sql; ret[((index++))]=$?
|
32 |
+
mysql -utravis < test009.src.sql; ret[((index++))]=$?
|
33 |
+
mysql -utravis < test010.src.sql; ret[((index++))]=$?
|
34 |
+
mysql -utravis < test011.src.sql; ret[((index++))]=$?
|
35 |
+
|
36 |
+
checksum_test001 > test001.src.checksum
|
37 |
+
checksum_test002 > test002.src.checksum
|
38 |
+
checksum_test005 > test005.src.checksum
|
39 |
+
mysqldump -utravis test001 \
|
40 |
+
--no-autocommit \
|
41 |
+
--extended-insert=false \
|
42 |
+
--hex-blob=true \
|
43 |
+
--routines=true \
|
44 |
+
> mysqldump_test001.sql
|
45 |
+
ret[((index++))]=$?
|
46 |
+
|
47 |
+
mysqldump -utravis test002 \
|
48 |
+
--no-autocommit \
|
49 |
+
--extended-insert=false \
|
50 |
+
--complete-insert=true \
|
51 |
+
--hex-blob=true \
|
52 |
+
--default-character-set=utf8mb4 \
|
53 |
+
> mysqldump_test002.sql
|
54 |
+
ret[((index++))]=$?
|
55 |
+
|
56 |
+
mysqldump -utravis test005 \
|
57 |
+
--no-autocommit \
|
58 |
+
--extended-insert=false \
|
59 |
+
--hex-blob=true \
|
60 |
+
> mysqldump_test005.sql
|
61 |
+
ret[((index++))]=$?
|
62 |
+
|
63 |
+
php test.php
|
64 |
+
ret[((index++))]=$?
|
65 |
+
|
66 |
+
mysql -utravis test001 < mysqldump-php_test001.sql
|
67 |
+
ret[((index++))]=$?
|
68 |
+
mysql -utravis test002 < mysqldump-php_test002.sql
|
69 |
+
ret[((index++))]=$?
|
70 |
+
mysql -utravis test005 < mysqldump-php_test005.sql
|
71 |
+
ret[((index++))]=$?
|
72 |
+
mysql -utravis test006b < mysqldump-php_test006.sql
|
73 |
+
ret[((index++))]=$?
|
74 |
+
mysql -utravis test009 < mysqldump-php_test009.sql
|
75 |
+
ret[((index++))]=$?
|
76 |
+
|
77 |
+
checksum_test001 > mysqldump-php_test001.checksum
|
78 |
+
checksum_test002 > mysqldump-php_test002.checksum
|
79 |
+
checksum_test005 > mysqldump-php_test005.checksum
|
80 |
+
|
81 |
+
cat test001.src.sql | grep ^INSERT > test001.filtered.sql
|
82 |
+
cat test002.src.sql | grep ^INSERT > test002.filtered.sql
|
83 |
+
cat test005.src.sql | grep ^INSERT > test005.filtered.sql
|
84 |
+
cat test008.src.sql | grep FOREIGN > test008.filtered.sql
|
85 |
+
cat test010.src.sql | grep CREATE | grep EVENT > test010.filtered.sql
|
86 |
+
cat test011.src.sql | grep INSERT > test011.filtered.sql
|
87 |
+
cat mysqldump_test001.sql | grep ^INSERT > mysqldump_test001.filtered.sql
|
88 |
+
cat mysqldump_test002.sql | grep ^INSERT > mysqldump_test002.filtered.sql
|
89 |
+
cat mysqldump_test005.sql | grep ^INSERT > mysqldump_test005.filtered.sql
|
90 |
+
cat mysqldump-php_test001.sql | grep ^INSERT > mysqldump-php_test001.filtered.sql
|
91 |
+
cat mysqldump-php_test002.sql | grep ^INSERT > mysqldump-php_test002.filtered.sql
|
92 |
+
cat mysqldump-php_test005.sql | grep ^INSERT > mysqldump-php_test005.filtered.sql
|
93 |
+
cat mysqldump-php_test008.sql | grep FOREIGN > mysqldump-php_test008.filtered.sql
|
94 |
+
cat mysqldump-php_test010.sql | grep CREATE | grep EVENT > mysqldump-php_test010.filtered.sql
|
95 |
+
cat mysqldump-php_test011a.sql | grep INSERT > mysqldump-php_test011a.filtered.sql
|
96 |
+
cat mysqldump-php_test011b.sql | grep INSERT > mysqldump-php_test011b.filtered.sql
|
97 |
+
|
98 |
+
diff test001.filtered.sql mysqldump_test001.filtered.sql
|
99 |
+
ret[((index++))]=$?
|
100 |
+
diff test002.filtered.sql mysqldump_test002.filtered.sql
|
101 |
+
ret[((index++))]=$?
|
102 |
+
|
103 |
+
diff test001.filtered.sql mysqldump-php_test001.filtered.sql
|
104 |
+
ret[((index++))]=$?
|
105 |
+
diff test002.filtered.sql mysqldump-php_test002.filtered.sql
|
106 |
+
ret[((index++))]=$?
|
107 |
+
|
108 |
+
diff test001.src.checksum mysqldump-php_test001.checksum
|
109 |
+
ret[((index++))]=$?
|
110 |
+
diff test002.src.checksum mysqldump-php_test002.checksum
|
111 |
+
ret[((index++))]=$?
|
112 |
+
diff test005.src.checksum mysqldump-php_test005.checksum
|
113 |
+
ret[((index++))]=$?
|
114 |
+
|
115 |
+
diff mysqldump_test005.filtered.sql mysqldump-php_test005.filtered.sql
|
116 |
+
ret[((index++))]=$?
|
117 |
+
|
118 |
+
diff test008.filtered.sql mysqldump-php_test008.filtered.sql
|
119 |
+
ret[((index++))]=$?
|
120 |
+
|
121 |
+
#test reset-auto-increment
|
122 |
+
test009=`cat mysqldump-php_test009.sql | grep -i ENGINE | grep AUTO_INCREMENT`
|
123 |
+
if [[ -z $test009 ]]; then ret[((index++))]=0; else ret[((index++))]=1; fi
|
124 |
+
|
125 |
+
# test backup events
|
126 |
+
diff test010.filtered.sql mysqldump-php_test010.filtered.sql
|
127 |
+
ret[((index++))]=$?
|
128 |
+
|
129 |
+
# test virtual column support, with simple inserts forced to complete (a) and complete inserts (b)
|
130 |
+
diff test011.filtered.sql mysqldump-php_test011a.filtered.sql
|
131 |
+
ret[((index++))]=$?
|
132 |
+
diff test011.filtered.sql mysqldump-php_test011b.filtered.sql
|
133 |
+
ret[((index++))]=$?
|
134 |
+
|
135 |
+
rm *.checksum 2> /dev/null
|
136 |
+
rm *.filtered.sql 2> /dev/null
|
137 |
+
rm mysqldump* 2> /dev/null
|
138 |
+
|
139 |
+
echo "Done $index tests"
|
140 |
+
|
141 |
+
retvalue=0
|
142 |
+
for i in $(seq 0 35) ; do
|
143 |
+
if [[ ${ret[$i]} -ne 0 ]]; then
|
144 |
+
echo "test $i returned ${ret[$i]}"
|
145 |
+
retvalue=${ret[$i]}
|
146 |
+
fi
|
147 |
+
# total=$((${ret[$i]} + $total))
|
148 |
+
done
|
149 |
+
|
150 |
+
echo "Exiting with code $retvalue"
|
151 |
+
|
152 |
+
exit $retvalue
|
vendor/ifsnop/mysqldump-php/tests/test001.src.sql
ADDED
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
DROP DATABASE IF EXISTS `test001`;
|
2 |
+
CREATE DATABASE `test001`;
|
3 |
+
USE `test001`;
|
4 |
+
|
5 |
+
DROP TABLE IF EXISTS `test000`;
|
6 |
+
CREATE TABLE `test000` (
|
7 |
+
`id` int,
|
8 |
+
`col01` bit(6) DEFAULT NULL,
|
9 |
+
`col02` tinyint(4) DEFAULT NULL,
|
10 |
+
`col03` tinyint(4) UNSIGNED DEFAULT NULL,
|
11 |
+
`col10` bigint DEFAULT NULL,
|
12 |
+
`col11` bigint UNSIGNED DEFAULT NULL,
|
13 |
+
`col15` double DEFAULT NULL,
|
14 |
+
`col27` varchar(6) DEFAULT NULL
|
15 |
+
);
|
16 |
+
INSERT INTO `test000` VALUES (1,0x21,-128,255,-9223372036854775808,18446744073709551615,-2.2250738585072014e-308,'0abcde');
|
17 |
+
|
18 |
+
DROP TABLE IF EXISTS `test001`;
|
19 |
+
CREATE TABLE `test001` (
|
20 |
+
`id` int,
|
21 |
+
`col` bit(1) DEFAULT NULL
|
22 |
+
);
|
23 |
+
INSERT INTO `test001` VALUES (1,NULL);
|
24 |
+
INSERT INTO `test001` VALUES (2,0x00);
|
25 |
+
INSERT INTO `test001` VALUES (3,0x01);
|
26 |
+
|
27 |
+
DROP TABLE IF EXISTS `test002`;
|
28 |
+
CREATE TABLE `test002` (
|
29 |
+
`id` int,
|
30 |
+
`col` tinyint(4) DEFAULT NULL
|
31 |
+
);
|
32 |
+
INSERT INTO `test002` VALUES (1,NULL);
|
33 |
+
INSERT INTO `test002` VALUES (2,-128);
|
34 |
+
INSERT INTO `test002` VALUES (3,0);
|
35 |
+
INSERT INTO `test002` VALUES (4,127);
|
36 |
+
|
37 |
+
DROP TABLE IF EXISTS `test003`;
|
38 |
+
CREATE TABLE `test003` (
|
39 |
+
`id` int,
|
40 |
+
`col` tinyint(4) UNSIGNED DEFAULT NULL
|
41 |
+
);
|
42 |
+
INSERT INTO `test003` VALUES (1,NULL);
|
43 |
+
INSERT INTO `test003` VALUES (2,0);
|
44 |
+
INSERT INTO `test003` VALUES (3,255);
|
45 |
+
|
46 |
+
DROP TABLE IF EXISTS `test010`;
|
47 |
+
CREATE TABLE `test010` (
|
48 |
+
`id` int,
|
49 |
+
`col` bigint DEFAULT NULL
|
50 |
+
);
|
51 |
+
INSERT INTO `test010` VALUES (1,NULL);
|
52 |
+
INSERT INTO `test010` VALUES (2,-9223372036854775808);
|
53 |
+
INSERT INTO `test010` VALUES (3,0);
|
54 |
+
INSERT INTO `test010` VALUES (4,9223372036854775807);
|
55 |
+
|
56 |
+
DROP TABLE IF EXISTS `test011`;
|
57 |
+
CREATE TABLE `test011` (
|
58 |
+
`id` int,
|
59 |
+
`col` bigint UNSIGNED DEFAULT NULL
|
60 |
+
);
|
61 |
+
INSERT INTO `test011` VALUES (1,NULL);
|
62 |
+
INSERT INTO `test011` VALUES (3,0);
|
63 |
+
INSERT INTO `test011` VALUES (4,18446744073709551615);
|
64 |
+
|
65 |
+
|
66 |
+
DROP TABLE IF EXISTS `test015`;
|
67 |
+
CREATE TABLE `test015` (
|
68 |
+
`id` int,
|
69 |
+
`col` double DEFAULT NULL
|
70 |
+
);
|
71 |
+
INSERT INTO `test015` VALUES (1,NULL);
|
72 |
+
INSERT INTO `test015` VALUES (2,-1.7976931348623157e308);
|
73 |
+
INSERT INTO `test015` VALUES (3,-2.2250738585072014e-308);
|
74 |
+
INSERT INTO `test015` VALUES (4,0);
|
75 |
+
INSERT INTO `test015` VALUES (5,2.2250738585072014e-308);
|
76 |
+
INSERT INTO `test015` VALUES (6,1.7976931348623157e308);
|
77 |
+
|
78 |
+
|
79 |
+
DROP TABLE IF EXISTS `test027`;
|
80 |
+
CREATE TABLE `test027` (
|
81 |
+
`id` int,
|
82 |
+
`col` varchar(6) DEFAULT NULL
|
83 |
+
);
|
84 |
+
INSERT INTO `test027` VALUES (1,NULL);
|
85 |
+
INSERT INTO `test027` VALUES (2,'');
|
86 |
+
INSERT INTO `test027` VALUES (3,'0');
|
87 |
+
INSERT INTO `test027` VALUES (4,'2e308');
|
88 |
+
INSERT INTO `test027` VALUES (5,'999.99');
|
89 |
+
INSERT INTO `test027` VALUES (6,'-2e-30');
|
90 |
+
INSERT INTO `test027` VALUES (7,'-99.99');
|
91 |
+
INSERT INTO `test027` VALUES (8,'0');
|
92 |
+
INSERT INTO `test027` VALUES (9,'0abcde');
|
93 |
+
INSERT INTO `test027` VALUES (10,'123');
|
94 |
+
|
95 |
+
DROP TABLE IF EXISTS `test029`;
|
96 |
+
CREATE TABLE `test029` (
|
97 |
+
`id` int,
|
98 |
+
`col` blob NOT NULL
|
99 |
+
);
|
100 |
+
INSERT INTO `test029` VALUES (1,0x00010203040506070809909192939495969798A9);
|
101 |
+
INSERT INTO `test029` VALUES (2,'');
|
102 |
+
|
103 |
+
DROP TABLE IF EXISTS `test033`;
|
104 |
+
CREATE TABLE `test033` (
|
105 |
+
`id` int,
|
106 |
+
`col` text NOT NULL
|
107 |
+
);
|
108 |
+
INSERT INTO `test033` VALUES (1,'test test test');
|
109 |
+
|
110 |
+
|
111 |
+
DROP VIEW IF EXISTS `test100`;
|
112 |
+
CREATE ALGORITHM=UNDEFINED DEFINER=`travis`@`localhost` SQL SECURITY DEFINER VIEW `test100` AS select `test000`.`id` AS `id`,`test000`.`col01` AS `col01`,`test000`.`col02` AS `col02`,`test000`.`col03` AS `col03`,`test000`.`col10` AS `col10`,`test000`.`col11` AS `col11`,`test000`.`col15` AS `col15`,`test000`.`col27` AS `col27` from `test000`;
|
113 |
+
|
114 |
+
DROP VIEW IF EXISTS `test127`;
|
115 |
+
CREATE ALGORITHM=UNDEFINED DEFINER=`travis`@`localhost` SQL SECURITY DEFINER VIEW `test127` AS select `test027`.`id` AS `id`,`test027`.`col` AS `col` from `test027`;
|
116 |
+
|
117 |
+
|
118 |
+
DROP TABLE IF EXISTS `test200`;
|
119 |
+
CREATE TABLE `test200` (
|
120 |
+
`id` int,
|
121 |
+
`col` tinyint(4) DEFAULT NULL
|
122 |
+
);
|
123 |
+
|
124 |
+
CREATE TRIGGER before_test200_insert
|
125 |
+
BEFORE insert ON `test200`
|
126 |
+
FOR EACH ROW set NEW.col = NEW.col + 1;
|
127 |
+
|
128 |
+
-- INSERT INTO `test200` VALUES (1,1); -- trigger tests
|
129 |
+
|
130 |
+
/*!50003 DROP PROCEDURE IF EXISTS `GetAllFromTest000` */;
|
131 |
+
DELIMITER //
|
132 |
+
CREATE PROCEDURE GetAllFromTest000()
|
133 |
+
BEGIN
|
134 |
+
SELECT * FROM test000;
|
135 |
+
END //
|
136 |
+
DELIMITER ;
|
vendor/ifsnop/mysqldump-php/tests/test002.src.sql
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
DROP DATABASE IF EXISTS `test002`;
|
2 |
+
CREATE DATABASE `test002`;
|
3 |
+
USE `test002`;
|
4 |
+
|
5 |
+
DROP TABLE IF EXISTS `test201`;
|
6 |
+
CREATE TABLE `test201` (
|
7 |
+
`col` text COLLATE utf8mb4_unicode_ci
|
8 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
9 |
+
|
10 |
+
INSERT INTO `test201` (`col`) VALUES ('áéíóú');
|
11 |
+
INSERT INTO `test201` (`col`) VALUES ('🎲');
|
12 |
+
INSERT INTO `test201` (`col`) VALUES ('🎭');
|
13 |
+
INSERT INTO `test201` (`col`) VALUES ('💩');
|
14 |
+
INSERT INTO `test201` (`col`) VALUES ('🐈');
|
vendor/ifsnop/mysqldump-php/tests/test005.src.sql
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
DROP DATABASE IF EXISTS `test005`;
|
2 |
+
CREATE DATABASE `test005`;
|
3 |
+
USE `test005`;
|
4 |
+
|
5 |
+
SET TIME_ZONE='+07:00';
|
6 |
+
DROP TABLE IF EXISTS `test000`;
|
7 |
+
CREATE TABLE `test000`(
|
8 |
+
`id` int,
|
9 |
+
`col` TIMESTAMP NOT NULL
|
10 |
+
);
|
11 |
+
INSERT INTO `test000` VALUES (1,'2014-01-01 00:00:00');
|
12 |
+
SET TIME_ZONE='+00:00';
|
vendor/ifsnop/mysqldump-php/tests/test006.src.sql
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
-- phpMyAdmin SQL Dump
|
2 |
+
-- version 4.4.0
|
3 |
+
-- http://www.phpmyadmin.net
|
4 |
+
--
|
5 |
+
-- Servidor: localhost
|
6 |
+
-- Tiempo de generación: 31-08-2015 a las 19:26:58
|
7 |
+
-- Versión del servidor: 5.5.42
|
8 |
+
-- Versión de PHP: 5.6.7
|
9 |
+
|
10 |
+
DROP DATABASE IF EXISTS `test006a`;
|
11 |
+
CREATE DATABASE `test006a`;
|
12 |
+
|
13 |
+
DROP DATABASE IF EXISTS `test006b`;
|
14 |
+
CREATE DATABASE `test006b`;
|
15 |
+
|
16 |
+
USE `test006a`;
|
17 |
+
|
18 |
+
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
19 |
+
SET time_zone = "+00:00";
|
20 |
+
|
21 |
+
|
22 |
+
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
23 |
+
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
24 |
+
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
25 |
+
/*!40101 SET NAMES utf8 */;
|
26 |
+
|
27 |
+
--
|
28 |
+
-- Base de datos: `my_test_db`
|
29 |
+
--
|
30 |
+
|
31 |
+
-- --------------------------------------------------------
|
32 |
+
|
33 |
+
--
|
34 |
+
-- Estructura de tabla para la tabla `my_table`
|
35 |
+
--
|
36 |
+
|
37 |
+
CREATE TABLE IF NOT EXISTS `my_table` (
|
38 |
+
`id` int(11) NOT NULL,
|
39 |
+
`name` varchar(300) DEFAULT NULL,
|
40 |
+
`lastname` varchar(300) DEFAULT NULL,
|
41 |
+
`username` varchar(300) DEFAULT NULL
|
42 |
+
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
43 |
+
|
44 |
+
-- --------------------------------------------------------
|
45 |
+
|
46 |
+
--
|
47 |
+
-- Estructura Stand-in para la vista `my_view`
|
48 |
+
--
|
49 |
+
CREATE TABLE IF NOT EXISTS `my_view` (
|
50 |
+
`id` int(11)
|
51 |
+
,`name` varchar(300)
|
52 |
+
,`lastname` varchar(300)
|
53 |
+
,`username` varchar(300)
|
54 |
+
);
|
55 |
+
|
56 |
+
-- --------------------------------------------------------
|
57 |
+
|
58 |
+
--
|
59 |
+
-- Estructura Stand-in para la vista `view_of_my_table`
|
60 |
+
--
|
61 |
+
CREATE TABLE IF NOT EXISTS `view_of_my_table` (
|
62 |
+
`id` int(11)
|
63 |
+
,`name` varchar(300)
|
64 |
+
,`lastname` varchar(300)
|
65 |
+
,`username` varchar(300)
|
66 |
+
);
|
67 |
+
|
68 |
+
-- --------------------------------------------------------
|
69 |
+
|
70 |
+
--
|
71 |
+
-- Estructura para la vista `my_view`
|
72 |
+
--
|
73 |
+
DROP TABLE IF EXISTS `my_view`;
|
74 |
+
|
75 |
+
CREATE ALGORITHM=UNDEFINED DEFINER=`travis`@`localhost` SQL SECURITY DEFINER VIEW `my_view` AS select `view_of_my_table`.`id` AS `id`,`view_of_my_table`.`name` AS `name`,`view_of_my_table`.`lastname` AS `lastname`,`view_of_my_table`.`username` AS `username` from `view_of_my_table`;
|
76 |
+
|
77 |
+
-- --------------------------------------------------------
|
78 |
+
|
79 |
+
--
|
80 |
+
-- Estructura para la vista `view_of_my_table`
|
81 |
+
--
|
82 |
+
DROP TABLE IF EXISTS `view_of_my_table`;
|
83 |
+
|
84 |
+
CREATE ALGORITHM=UNDEFINED DEFINER=`travis`@`localhost` SQL SECURITY DEFINER VIEW `view_of_my_table` AS select `my_table`.`id` AS `id`,`my_table`.`name` AS `name`,`my_table`.`lastname` AS `lastname`,`my_table`.`username` AS `username` from `my_table`;
|
85 |
+
|
86 |
+
--
|
87 |
+
-- Índices para tablas volcadas
|
88 |
+
--
|
89 |
+
|
90 |
+
--
|
91 |
+
-- Indices de la tabla `my_table`
|
92 |
+
--
|
93 |
+
ALTER TABLE `my_table`
|
94 |
+
ADD PRIMARY KEY (`id`);
|
95 |
+
|
96 |
+
--
|
97 |
+
-- AUTO_INCREMENT de las tablas volcadas
|
98 |
+
--
|
99 |
+
|
100 |
+
--
|
101 |
+
-- AUTO_INCREMENT de la tabla `my_table`
|
102 |
+
--
|
103 |
+
ALTER TABLE `my_table`
|
104 |
+
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
105 |
+
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
106 |
+
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
107 |
+
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
vendor/ifsnop/mysqldump-php/tests/test008.src.sql
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
DROP DATABASE IF EXISTS `test008`;
|
2 |
+
CREATE DATABASE `test008`;
|
3 |
+
USE `test008`;
|
4 |
+
|
5 |
+
-- MySQL dump 10.13 Distrib 5.5.43, for debian-linux-gnu (x86_64)
|
6 |
+
--
|
7 |
+
-- Host: 192.168.0.34 Database: test007
|
8 |
+
-- ------------------------------------------------------
|
9 |
+
-- Server version 5.5.43-0+deb7u1-log
|
10 |
+
|
11 |
+
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
12 |
+
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
13 |
+
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
14 |
+
/*!40101 SET NAMES utf8 */;
|
15 |
+
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
16 |
+
/*!40103 SET TIME_ZONE='+00:00' */;
|
17 |
+
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
18 |
+
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
19 |
+
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
20 |
+
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
21 |
+
|
22 |
+
--
|
23 |
+
-- Table structure for table `fields`
|
24 |
+
--
|
25 |
+
|
26 |
+
DROP TABLE IF EXISTS `fields`;
|
27 |
+
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
28 |
+
/*!40101 SET character_set_client = utf8 */;
|
29 |
+
CREATE TABLE `fields` (
|
30 |
+
`id` int(11) NOT NULL,
|
31 |
+
`name` varchar(128) NOT NULL,
|
32 |
+
`form_id` int(11) NOT NULL,
|
33 |
+
PRIMARY KEY (`id`),
|
34 |
+
KEY `form_id` (`form_id`),
|
35 |
+
CONSTRAINT `fields to forms` FOREIGN KEY (`form_id`) REFERENCES `forms` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
36 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
37 |
+
/*!40101 SET character_set_client = @saved_cs_client */;
|
38 |
+
|
39 |
+
--
|
40 |
+
-- Dumping data for table `fields`
|
41 |
+
--
|
42 |
+
|
43 |
+
LOCK TABLES `fields` WRITE;
|
44 |
+
/*!40000 ALTER TABLE `fields` DISABLE KEYS */;
|
45 |
+
/*!40000 ALTER TABLE `fields` ENABLE KEYS */;
|
46 |
+
UNLOCK TABLES;
|
47 |
+
|
48 |
+
--
|
49 |
+
-- Table structure for table `forms`
|
50 |
+
--
|
51 |
+
|
52 |
+
DROP TABLE IF EXISTS `forms`;
|
53 |
+
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
54 |
+
/*!40101 SET character_set_client = utf8 */;
|
55 |
+
CREATE TABLE `forms` (
|
56 |
+
`id` int(11) NOT NULL,
|
57 |
+
`name` varchar(128) NOT NULL,
|
58 |
+
PRIMARY KEY (`id`)
|
59 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
60 |
+
/*!40101 SET character_set_client = @saved_cs_client */;
|
61 |
+
|
62 |
+
--
|
63 |
+
-- Dumping data for table `forms`
|
64 |
+
--
|
65 |
+
|
66 |
+
LOCK TABLES `forms` WRITE;
|
67 |
+
/*!40000 ALTER TABLE `forms` DISABLE KEYS */;
|
68 |
+
/*!40000 ALTER TABLE `forms` ENABLE KEYS */;
|
69 |
+
UNLOCK TABLES;
|
70 |
+
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
71 |
+
|
72 |
+
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
73 |
+
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
74 |
+
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
75 |
+
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
76 |
+
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
77 |
+
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
78 |
+
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
79 |
+
|
80 |
+
-- Dump completed on 2016-12-27 22:39:51
|
vendor/ifsnop/mysqldump-php/tests/test009.src.sql
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
DROP DATABASE IF EXISTS `test009`;
|
2 |
+
CREATE DATABASE `test009`;
|
3 |
+
USE `test009`;
|
4 |
+
|
5 |
+
-- MySQL dump 10.15 Distrib 10.0.28-MariaDB, for debian-linux-gnu (x86_64)
|
6 |
+
--
|
7 |
+
-- Host: localhost Database: localhost
|
8 |
+
-- ------------------------------------------------------
|
9 |
+
-- Server version 10.0.28-MariaDB-0ubuntu0.16.04.1
|
10 |
+
|
11 |
+
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
12 |
+
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
13 |
+
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
14 |
+
/*!40101 SET NAMES utf8 */;
|
15 |
+
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
16 |
+
/*!40103 SET TIME_ZONE='+00:00' */;
|
17 |
+
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
18 |
+
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
19 |
+
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
20 |
+
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
21 |
+
|
22 |
+
--
|
23 |
+
-- Table structure for table `increments`
|
24 |
+
--
|
25 |
+
|
26 |
+
DROP TABLE IF EXISTS `increments`;
|
27 |
+
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
28 |
+
/*!40101 SET character_set_client = utf8 */;
|
29 |
+
CREATE TABLE `increments` (
|
30 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
31 |
+
PRIMARY KEY (`id`)
|
32 |
+
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
|
33 |
+
/*!40101 SET character_set_client = @saved_cs_client */;
|
34 |
+
|
35 |
+
--
|
36 |
+
-- Dumping data for table `increments`
|
37 |
+
--
|
38 |
+
|
39 |
+
LOCK TABLES `increments` WRITE;
|
40 |
+
/*!40000 ALTER TABLE `increments` DISABLE KEYS */;
|
41 |
+
INSERT INTO `increments` VALUES (1);
|
42 |
+
INSERT INTO `increments` VALUES (2);
|
43 |
+
INSERT INTO `increments` VALUES (3);
|
44 |
+
INSERT INTO `increments` VALUES (4);
|
45 |
+
/*!40000 ALTER TABLE `increments` ENABLE KEYS */;
|
46 |
+
UNLOCK TABLES;
|
47 |
+
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
48 |
+
|
49 |
+
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
50 |
+
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
51 |
+
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
52 |
+
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
53 |
+
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
54 |
+
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
55 |
+
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
56 |
+
|
57 |
+
-- Dump completed on 2017-03-02 13:23:17
|
vendor/ifsnop/mysqldump-php/tests/test010.src.sql
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
DROP DATABASE IF EXISTS `test010`;
|
2 |
+
CREATE DATABASE `test010`;
|
3 |
+
USE `test010`;
|
4 |
+
|
5 |
+
-- MySQL dump 10.13 Distrib 5.7.17, for Linux (x86_64)
|
6 |
+
--
|
7 |
+
-- Host: localhost Database: test010
|
8 |
+
-- ------------------------------------------------------
|
9 |
+
-- Server version 5.7.17
|
10 |
+
|
11 |
+
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
12 |
+
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
13 |
+
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
14 |
+
/*!40101 SET NAMES utf8 */;
|
15 |
+
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
16 |
+
/*!40103 SET TIME_ZONE='+00:00' */;
|
17 |
+
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
18 |
+
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
19 |
+
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
20 |
+
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
21 |
+
|
22 |
+
--
|
23 |
+
-- Dumping events for database 'test010'
|
24 |
+
--
|
25 |
+
/*!50106 SET @save_time_zone= @@TIME_ZONE */ ;
|
26 |
+
/*!50106 DROP EVENT IF EXISTS `e_test010` */;
|
27 |
+
DELIMITER ;;
|
28 |
+
/*!50003 SET @saved_cs_client = @@character_set_client */ ;;
|
29 |
+
/*!50003 SET @saved_cs_results = @@character_set_results */ ;;
|
30 |
+
/*!50003 SET @saved_col_connection = @@collation_connection */ ;;
|
31 |
+
/*!50003 SET character_set_client = utf8 */ ;;
|
32 |
+
/*!50003 SET character_set_results = utf8 */ ;;
|
33 |
+
/*!50003 SET collation_connection = utf8_general_ci */ ;;
|
34 |
+
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;;
|
35 |
+
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;;
|
36 |
+
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
|
37 |
+
/*!50003 SET time_zone = 'SYSTEM' */ ;;
|
38 |
+
/*!50106 CREATE*/ /*!50117 DEFINER=`travis`@`%`*/ /*!50106 EVENT `e_test010` ON SCHEDULE AT '2030-01-01 23:59:00' ON COMPLETION NOT PRESERVE ENABLE DO INSERT INTO test010.test VALUES (NOW()) */ ;;
|
39 |
+
/*!50003 SET time_zone = @saved_time_zone */ ;;
|
40 |
+
/*!50003 SET sql_mode = @saved_sql_mode */ ;;
|
41 |
+
/*!50003 SET character_set_client = @saved_cs_client */ ;;
|
42 |
+
/*!50003 SET character_set_results = @saved_cs_results */ ;;
|
43 |
+
/*!50003 SET collation_connection = @saved_col_connection */ ;;
|
44 |
+
DELIMITER ;
|
45 |
+
/*!50106 SET TIME_ZONE= @save_time_zone */ ;
|
46 |
+
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
47 |
+
|
48 |
+
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
49 |
+
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
50 |
+
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
51 |
+
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
52 |
+
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
53 |
+
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
54 |
+
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
55 |
+
|
56 |
+
-- Dump completed on 2017-03-20 21:52:21
|
vendor/ifsnop/mysqldump-php/tests/test011.src.sql
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
DROP DATABASE IF EXISTS `test011`;
|
2 |
+
CREATE DATABASE `test011`;
|
3 |
+
USE `test011`;
|
4 |
+
|
5 |
+
-- MySQL dump 10.13 Distrib 5.7.15, for Linux (x86_64)
|
6 |
+
--
|
7 |
+
-- Host: localhost Database: test
|
8 |
+
-- ------------------------------------------------------
|
9 |
+
-- Server version 5.7.15
|
10 |
+
|
11 |
+
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
12 |
+
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
13 |
+
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
14 |
+
/*!40101 SET NAMES utf8 */;
|
15 |
+
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
16 |
+
/*!40103 SET TIME_ZONE='+00:00' */;
|
17 |
+
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
18 |
+
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
19 |
+
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
20 |
+
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
21 |
+
|
22 |
+
--
|
23 |
+
-- Table structure for table `test011`
|
24 |
+
--
|
25 |
+
|
26 |
+
DROP TABLE IF EXISTS `test011`;
|
27 |
+
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
28 |
+
/*!40101 SET character_set_client = utf8 */;
|
29 |
+
CREATE TABLE `test011` (
|
30 |
+
`id` int(11) NOT NULL,
|
31 |
+
`hash` char(32) CHARACTER SET ascii COLLATE ascii_bin GENERATED ALWAYS AS (md5(`id`)) STORED NOT NULL
|
32 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
|
33 |
+
/*!40101 SET character_set_client = @saved_cs_client */;
|
34 |
+
|
35 |
+
--
|
36 |
+
-- Dumping data for table `test011`
|
37 |
+
--
|
38 |
+
|
39 |
+
LOCK TABLES `test011` WRITE;
|
40 |
+
/*!40000 ALTER TABLE `test011` DISABLE KEYS */;
|
41 |
+
INSERT INTO `test011` (`id`) VALUES (159413),(294775);
|
42 |
+
/*!40000 ALTER TABLE `test011` ENABLE KEYS */;
|
43 |
+
UNLOCK TABLES;
|
44 |
+
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
45 |
+
|
46 |
+
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
47 |
+
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
48 |
+
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
49 |
+
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
50 |
+
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
51 |
+
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
52 |
+
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
vendor/symfony/finder/.gitignore
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
vendor/
|
2 |
-
composer.lock
|
3 |
-
phpunit.xml
|
|
|
|
|
|
vendor/symfony/finder/README.md
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
Finder Component
|
2 |
-
================
|
3 |
-
|
4 |
-
The Finder component finds files and directories via an intuitive fluent
|
5 |
-
interface.
|
6 |
-
|
7 |
-
Resources
|
8 |
-
---------
|
9 |
-
|
10 |
-
* [Documentation](https://symfony.com/doc/current/components/finder.html)
|
11 |
-
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
|
12 |
-
* [Report issues](https://github.com/symfony/symfony/issues) and
|
13 |
-
[send Pull Requests](https://github.com/symfony/symfony/pulls)
|
14 |
-
in the [main Symfony repository](https://github.com/symfony/symfony)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/BsdFinderTest.php
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests;
|
13 |
-
|
14 |
-
use Symfony\Component\Finder\Adapter\BsdFindAdapter;
|
15 |
-
use Symfony\Component\Finder\Finder;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* @group legacy
|
19 |
-
*/
|
20 |
-
class BsdFinderTest extends FinderTest
|
21 |
-
{
|
22 |
-
public function testSymlinksNotResolved()
|
23 |
-
{
|
24 |
-
$this->markTestSkipped('Symlinks are always resolved using the BsdFinderAdapter.');
|
25 |
-
}
|
26 |
-
|
27 |
-
public function testBackPathNotNormalized()
|
28 |
-
{
|
29 |
-
$this->markTestSkipped('Paths are always normalized using the BsdFinderAdapter.');
|
30 |
-
}
|
31 |
-
|
32 |
-
protected function buildFinder()
|
33 |
-
{
|
34 |
-
$adapter = new BsdFindAdapter();
|
35 |
-
|
36 |
-
if (!$adapter->isSupported()) {
|
37 |
-
$this->markTestSkipped(\get_class($adapter).' is not supported.');
|
38 |
-
}
|
39 |
-
|
40 |
-
return Finder::create()
|
41 |
-
->removeAdapters()
|
42 |
-
->addAdapter($adapter);
|
43 |
-
}
|
44 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Comparator/ComparatorTest.php
DELETED
@@ -1,65 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Comparator;
|
13 |
-
|
14 |
-
use PHPUnit\Framework\TestCase;
|
15 |
-
use Symfony\Component\Finder\Comparator\Comparator;
|
16 |
-
|
17 |
-
class ComparatorTest extends TestCase
|
18 |
-
{
|
19 |
-
public function testGetSetOperator()
|
20 |
-
{
|
21 |
-
$comparator = new Comparator();
|
22 |
-
try {
|
23 |
-
$comparator->setOperator('foo');
|
24 |
-
$this->fail('->setOperator() throws an \InvalidArgumentException if the operator is not valid.');
|
25 |
-
} catch (\Exception $e) {
|
26 |
-
$this->assertInstanceOf('InvalidArgumentException', $e, '->setOperator() throws an \InvalidArgumentException if the operator is not valid.');
|
27 |
-
}
|
28 |
-
|
29 |
-
$comparator = new Comparator();
|
30 |
-
$comparator->setOperator('>');
|
31 |
-
$this->assertEquals('>', $comparator->getOperator(), '->getOperator() returns the current operator');
|
32 |
-
}
|
33 |
-
|
34 |
-
public function testGetSetTarget()
|
35 |
-
{
|
36 |
-
$comparator = new Comparator();
|
37 |
-
$comparator->setTarget(8);
|
38 |
-
$this->assertEquals(8, $comparator->getTarget(), '->getTarget() returns the target');
|
39 |
-
}
|
40 |
-
|
41 |
-
/**
|
42 |
-
* @dataProvider getTestData
|
43 |
-
*/
|
44 |
-
public function testTest($operator, $target, $match, $noMatch)
|
45 |
-
{
|
46 |
-
$c = new Comparator();
|
47 |
-
$c->setOperator($operator);
|
48 |
-
$c->setTarget($target);
|
49 |
-
|
50 |
-
foreach ($match as $m) {
|
51 |
-
$this->assertTrue($c->test($m), '->test() tests a string against the expression');
|
52 |
-
}
|
53 |
-
|
54 |
-
foreach ($noMatch as $m) {
|
55 |
-
$this->assertFalse($c->test($m), '->test() tests a string against the expression');
|
56 |
-
}
|
57 |
-
}
|
58 |
-
|
59 |
-
public function getTestData()
|
60 |
-
{
|
61 |
-
return array(
|
62 |
-
array('<', '1000', array('500', '999'), array('1000', '1500')),
|
63 |
-
);
|
64 |
-
}
|
65 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Comparator/DateComparatorTest.php
DELETED
@@ -1,64 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Comparator;
|
13 |
-
|
14 |
-
use PHPUnit\Framework\TestCase;
|
15 |
-
use Symfony\Component\Finder\Comparator\DateComparator;
|
16 |
-
|
17 |
-
class DateComparatorTest extends TestCase
|
18 |
-
{
|
19 |
-
public function testConstructor()
|
20 |
-
{
|
21 |
-
try {
|
22 |
-
new DateComparator('foobar');
|
23 |
-
$this->fail('__construct() throws an \InvalidArgumentException if the test expression is not valid.');
|
24 |
-
} catch (\Exception $e) {
|
25 |
-
$this->assertInstanceOf('InvalidArgumentException', $e, '__construct() throws an \InvalidArgumentException if the test expression is not valid.');
|
26 |
-
}
|
27 |
-
|
28 |
-
try {
|
29 |
-
new DateComparator('');
|
30 |
-
$this->fail('__construct() throws an \InvalidArgumentException if the test expression is not valid.');
|
31 |
-
} catch (\Exception $e) {
|
32 |
-
$this->assertInstanceOf('InvalidArgumentException', $e, '__construct() throws an \InvalidArgumentException if the test expression is not valid.');
|
33 |
-
}
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
* @dataProvider getTestData
|
38 |
-
*/
|
39 |
-
public function testTest($test, $match, $noMatch)
|
40 |
-
{
|
41 |
-
$c = new DateComparator($test);
|
42 |
-
|
43 |
-
foreach ($match as $m) {
|
44 |
-
$this->assertTrue($c->test($m), '->test() tests a string against the expression');
|
45 |
-
}
|
46 |
-
|
47 |
-
foreach ($noMatch as $m) {
|
48 |
-
$this->assertFalse($c->test($m), '->test() tests a string against the expression');
|
49 |
-
}
|
50 |
-
}
|
51 |
-
|
52 |
-
public function getTestData()
|
53 |
-
{
|
54 |
-
return array(
|
55 |
-
array('< 2005-10-10', array(strtotime('2005-10-09')), array(strtotime('2005-10-15'))),
|
56 |
-
array('until 2005-10-10', array(strtotime('2005-10-09')), array(strtotime('2005-10-15'))),
|
57 |
-
array('before 2005-10-10', array(strtotime('2005-10-09')), array(strtotime('2005-10-15'))),
|
58 |
-
array('> 2005-10-10', array(strtotime('2005-10-15')), array(strtotime('2005-10-09'))),
|
59 |
-
array('after 2005-10-10', array(strtotime('2005-10-15')), array(strtotime('2005-10-09'))),
|
60 |
-
array('since 2005-10-10', array(strtotime('2005-10-15')), array(strtotime('2005-10-09'))),
|
61 |
-
array('!= 2005-10-10', array(strtotime('2005-10-11')), array(strtotime('2005-10-10'))),
|
62 |
-
);
|
63 |
-
}
|
64 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Comparator/NumberComparatorTest.php
DELETED
@@ -1,108 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Comparator;
|
13 |
-
|
14 |
-
use PHPUnit\Framework\TestCase;
|
15 |
-
use Symfony\Component\Finder\Comparator\NumberComparator;
|
16 |
-
|
17 |
-
class NumberComparatorTest extends TestCase
|
18 |
-
{
|
19 |
-
/**
|
20 |
-
* @dataProvider getConstructorTestData
|
21 |
-
*/
|
22 |
-
public function testConstructor($successes, $failures)
|
23 |
-
{
|
24 |
-
foreach ($successes as $s) {
|
25 |
-
new NumberComparator($s);
|
26 |
-
}
|
27 |
-
|
28 |
-
foreach ($failures as $f) {
|
29 |
-
try {
|
30 |
-
new NumberComparator($f);
|
31 |
-
$this->fail('__construct() throws an \InvalidArgumentException if the test expression is not valid.');
|
32 |
-
} catch (\Exception $e) {
|
33 |
-
$this->assertInstanceOf('InvalidArgumentException', $e, '__construct() throws an \InvalidArgumentException if the test expression is not valid.');
|
34 |
-
}
|
35 |
-
}
|
36 |
-
}
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @dataProvider getTestData
|
40 |
-
*/
|
41 |
-
public function testTest($test, $match, $noMatch)
|
42 |
-
{
|
43 |
-
$c = new NumberComparator($test);
|
44 |
-
|
45 |
-
foreach ($match as $m) {
|
46 |
-
$this->assertTrue($c->test($m), '->test() tests a string against the expression');
|
47 |
-
}
|
48 |
-
|
49 |
-
foreach ($noMatch as $m) {
|
50 |
-
$this->assertFalse($c->test($m), '->test() tests a string against the expression');
|
51 |
-
}
|
52 |
-
}
|
53 |
-
|
54 |
-
public function getTestData()
|
55 |
-
{
|
56 |
-
return array(
|
57 |
-
array('< 1000', array('500', '999'), array('1000', '1500')),
|
58 |
-
|
59 |
-
array('< 1K', array('500', '999'), array('1000', '1500')),
|
60 |
-
array('<1k', array('500', '999'), array('1000', '1500')),
|
61 |
-
array(' < 1 K ', array('500', '999'), array('1000', '1500')),
|
62 |
-
array('<= 1K', array('1000'), array('1001')),
|
63 |
-
array('> 1K', array('1001'), array('1000')),
|
64 |
-
array('>= 1K', array('1000'), array('999')),
|
65 |
-
|
66 |
-
array('< 1KI', array('500', '1023'), array('1024', '1500')),
|
67 |
-
array('<= 1KI', array('1024'), array('1025')),
|
68 |
-
array('> 1KI', array('1025'), array('1024')),
|
69 |
-
array('>= 1KI', array('1024'), array('1023')),
|
70 |
-
|
71 |
-
array('1KI', array('1024'), array('1023', '1025')),
|
72 |
-
array('==1KI', array('1024'), array('1023', '1025')),
|
73 |
-
|
74 |
-
array('==1m', array('1000000'), array('999999', '1000001')),
|
75 |
-
array('==1mi', array(1024 * 1024), array(1024 * 1024 - 1, 1024 * 1024 + 1)),
|
76 |
-
|
77 |
-
array('==1g', array('1000000000'), array('999999999', '1000000001')),
|
78 |
-
array('==1gi', array(1024 * 1024 * 1024), array(1024 * 1024 * 1024 - 1, 1024 * 1024 * 1024 + 1)),
|
79 |
-
|
80 |
-
array('!= 1000', array('500', '999'), array('1000')),
|
81 |
-
);
|
82 |
-
}
|
83 |
-
|
84 |
-
public function getConstructorTestData()
|
85 |
-
{
|
86 |
-
return array(
|
87 |
-
array(
|
88 |
-
array(
|
89 |
-
'1', '0',
|
90 |
-
'3.5', '33.55', '123.456', '123456.78',
|
91 |
-
'.1', '.123',
|
92 |
-
'.0', '0.0',
|
93 |
-
'1.', '0.', '123.',
|
94 |
-
'==1', '!=1', '<1', '>1', '<=1', '>=1',
|
95 |
-
'==1k', '==1ki', '==1m', '==1mi', '==1g', '==1gi',
|
96 |
-
'1k', '1ki', '1m', '1mi', '1g', '1gi',
|
97 |
-
),
|
98 |
-
array(
|
99 |
-
false, null, '',
|
100 |
-
' ', 'foobar',
|
101 |
-
'=1', '===1',
|
102 |
-
'0 . 1', '123 .45', '234. 567',
|
103 |
-
'..', '.0.', '0.1.2',
|
104 |
-
),
|
105 |
-
),
|
106 |
-
);
|
107 |
-
}
|
108 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Expression/ExpressionTest.php
DELETED
@@ -1,72 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Expression;
|
13 |
-
|
14 |
-
use PHPUnit\Framework\TestCase;
|
15 |
-
use Symfony\Component\Finder\Expression\Expression;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* @group legacy
|
19 |
-
*/
|
20 |
-
class ExpressionTest extends TestCase
|
21 |
-
{
|
22 |
-
/**
|
23 |
-
* @dataProvider getTypeGuesserData
|
24 |
-
*/
|
25 |
-
public function testTypeGuesser($expr, $type)
|
26 |
-
{
|
27 |
-
$this->assertEquals($type, Expression::create($expr)->getType());
|
28 |
-
}
|
29 |
-
|
30 |
-
/**
|
31 |
-
* @dataProvider getCaseSensitiveData
|
32 |
-
*/
|
33 |
-
public function testCaseSensitive($expr, $isCaseSensitive)
|
34 |
-
{
|
35 |
-
$this->assertEquals($isCaseSensitive, Expression::create($expr)->isCaseSensitive());
|
36 |
-
}
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @dataProvider getRegexRenderingData
|
40 |
-
*/
|
41 |
-
public function testRegexRendering($expr, $body)
|
42 |
-
{
|
43 |
-
$this->assertEquals($body, Expression::create($expr)->renderPattern());
|
44 |
-
}
|
45 |
-
|
46 |
-
public function getTypeGuesserData()
|
47 |
-
{
|
48 |
-
return array(
|
49 |
-
array('{foo}', Expression::TYPE_REGEX),
|
50 |
-
array('/foo/', Expression::TYPE_REGEX),
|
51 |
-
array('foo', Expression::TYPE_GLOB),
|
52 |
-
array('foo*', Expression::TYPE_GLOB),
|
53 |
-
);
|
54 |
-
}
|
55 |
-
|
56 |
-
public function getCaseSensitiveData()
|
57 |
-
{
|
58 |
-
return array(
|
59 |
-
array('{foo}m', true),
|
60 |
-
array('/foo/i', false),
|
61 |
-
array('foo*', true),
|
62 |
-
);
|
63 |
-
}
|
64 |
-
|
65 |
-
public function getRegexRenderingData()
|
66 |
-
{
|
67 |
-
return array(
|
68 |
-
array('{foo}m', 'foo'),
|
69 |
-
array('/foo/i', 'foo'),
|
70 |
-
);
|
71 |
-
}
|
72 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Expression/GlobTest.php
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Expression;
|
13 |
-
|
14 |
-
use PHPUnit\Framework\TestCase;
|
15 |
-
use Symfony\Component\Finder\Expression\Expression;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* @group legacy
|
19 |
-
*/
|
20 |
-
class GlobTest extends TestCase
|
21 |
-
{
|
22 |
-
/**
|
23 |
-
* @dataProvider getToRegexData
|
24 |
-
*/
|
25 |
-
public function testGlobToRegex($glob, $match, $noMatch)
|
26 |
-
{
|
27 |
-
foreach ($match as $m) {
|
28 |
-
$this->assertRegExp(Expression::create($glob)->getRegex()->render(), $m, '::toRegex() converts a glob to a regexp');
|
29 |
-
}
|
30 |
-
|
31 |
-
foreach ($noMatch as $m) {
|
32 |
-
$this->assertNotRegExp(Expression::create($glob)->getRegex()->render(), $m, '::toRegex() converts a glob to a regexp');
|
33 |
-
}
|
34 |
-
}
|
35 |
-
|
36 |
-
public function getToRegexData()
|
37 |
-
{
|
38 |
-
return array(
|
39 |
-
array('', array(''), array('f', '/')),
|
40 |
-
array('*', array('foo'), array('foo/', '/foo')),
|
41 |
-
array('foo.*', array('foo.php', 'foo.a', 'foo.'), array('fooo.php', 'foo.php/foo')),
|
42 |
-
array('fo?', array('foo', 'fot'), array('fooo', 'ffoo', 'fo/')),
|
43 |
-
array('fo{o,t}', array('foo', 'fot'), array('fob', 'fo/')),
|
44 |
-
array('foo(bar|foo)', array('foo(bar|foo)'), array('foobar', 'foofoo')),
|
45 |
-
array('foo,bar', array('foo,bar'), array('foo', 'bar')),
|
46 |
-
array('fo{o,\\,}', array('foo', 'fo,'), array()),
|
47 |
-
array('fo{o,\\\\}', array('foo', 'fo\\'), array()),
|
48 |
-
array('/foo', array('/foo'), array('foo')),
|
49 |
-
);
|
50 |
-
}
|
51 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Expression/RegexTest.php
DELETED
@@ -1,147 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Expression;
|
13 |
-
|
14 |
-
use PHPUnit\Framework\TestCase;
|
15 |
-
use Symfony\Component\Finder\Expression\Expression;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* @group legacy
|
19 |
-
*/
|
20 |
-
class RegexTest extends TestCase
|
21 |
-
{
|
22 |
-
/**
|
23 |
-
* @dataProvider getHasFlagsData
|
24 |
-
*/
|
25 |
-
public function testHasFlags($regex, $start, $end)
|
26 |
-
{
|
27 |
-
$expr = new Expression($regex);
|
28 |
-
|
29 |
-
$this->assertEquals($start, $expr->getRegex()->hasStartFlag());
|
30 |
-
$this->assertEquals($end, $expr->getRegex()->hasEndFlag());
|
31 |
-
}
|
32 |
-
|
33 |
-
/**
|
34 |
-
* @dataProvider getHasJokersData
|
35 |
-
*/
|
36 |
-
public function testHasJokers($regex, $start, $end)
|
37 |
-
{
|
38 |
-
$expr = new Expression($regex);
|
39 |
-
|
40 |
-
$this->assertEquals($start, $expr->getRegex()->hasStartJoker());
|
41 |
-
$this->assertEquals($end, $expr->getRegex()->hasEndJoker());
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* @dataProvider getSetFlagsData
|
46 |
-
*/
|
47 |
-
public function testSetFlags($regex, $start, $end, $expected)
|
48 |
-
{
|
49 |
-
$expr = new Expression($regex);
|
50 |
-
$expr->getRegex()->setStartFlag($start)->setEndFlag($end);
|
51 |
-
|
52 |
-
$this->assertEquals($expected, $expr->render());
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* @dataProvider getSetJokersData
|
57 |
-
*/
|
58 |
-
public function testSetJokers($regex, $start, $end, $expected)
|
59 |
-
{
|
60 |
-
$expr = new Expression($regex);
|
61 |
-
$expr->getRegex()->setStartJoker($start)->setEndJoker($end);
|
62 |
-
|
63 |
-
$this->assertEquals($expected, $expr->render());
|
64 |
-
}
|
65 |
-
|
66 |
-
public function testOptions()
|
67 |
-
{
|
68 |
-
$expr = new Expression('~abc~is');
|
69 |
-
$expr->getRegex()->removeOption('i')->addOption('m');
|
70 |
-
|
71 |
-
$this->assertEquals('~abc~sm', $expr->render());
|
72 |
-
}
|
73 |
-
|
74 |
-
public function testMixFlagsAndJokers()
|
75 |
-
{
|
76 |
-
$expr = new Expression('~^.*abc.*$~is');
|
77 |
-
|
78 |
-
$expr->getRegex()->setStartFlag(false)->setEndFlag(false)->setStartJoker(false)->setEndJoker(false);
|
79 |
-
$this->assertEquals('~abc~is', $expr->render());
|
80 |
-
|
81 |
-
$expr->getRegex()->setStartFlag(true)->setEndFlag(true)->setStartJoker(true)->setEndJoker(true);
|
82 |
-
$this->assertEquals('~^.*abc.*$~is', $expr->render());
|
83 |
-
}
|
84 |
-
|
85 |
-
/**
|
86 |
-
* @dataProvider getReplaceJokersTestData
|
87 |
-
*/
|
88 |
-
public function testReplaceJokers($regex, $expected)
|
89 |
-
{
|
90 |
-
$expr = new Expression($regex);
|
91 |
-
$expr = $expr->getRegex()->replaceJokers('@');
|
92 |
-
|
93 |
-
$this->assertEquals($expected, $expr->renderPattern());
|
94 |
-
}
|
95 |
-
|
96 |
-
public function getHasFlagsData()
|
97 |
-
{
|
98 |
-
return array(
|
99 |
-
array('~^abc~', true, false),
|
100 |
-
array('~abc$~', false, true),
|
101 |
-
array('~abc~', false, false),
|
102 |
-
array('~^abc$~', true, true),
|
103 |
-
array('~^abc\\$~', true, false),
|
104 |
-
);
|
105 |
-
}
|
106 |
-
|
107 |
-
public function getHasJokersData()
|
108 |
-
{
|
109 |
-
return array(
|
110 |
-
array('~.*abc~', true, false),
|
111 |
-
array('~abc.*~', false, true),
|
112 |
-
array('~abc~', false, false),
|
113 |
-
array('~.*abc.*~', true, true),
|
114 |
-
array('~.*abc\\.*~', true, false),
|
115 |
-
);
|
116 |
-
}
|
117 |
-
|
118 |
-
public function getSetFlagsData()
|
119 |
-
{
|
120 |
-
return array(
|
121 |
-
array('~abc~', true, false, '~^abc~'),
|
122 |
-
array('~abc~', false, true, '~abc$~'),
|
123 |
-
array('~abc~', false, false, '~abc~'),
|
124 |
-
array('~abc~', true, true, '~^abc$~'),
|
125 |
-
);
|
126 |
-
}
|
127 |
-
|
128 |
-
public function getSetJokersData()
|
129 |
-
{
|
130 |
-
return array(
|
131 |
-
array('~abc~', true, false, '~.*abc~'),
|
132 |
-
array('~abc~', false, true, '~abc.*~'),
|
133 |
-
array('~abc~', false, false, '~abc~'),
|
134 |
-
array('~abc~', true, true, '~.*abc.*~'),
|
135 |
-
);
|
136 |
-
}
|
137 |
-
|
138 |
-
public function getReplaceJokersTestData()
|
139 |
-
{
|
140 |
-
return array(
|
141 |
-
array('~.abc~', '@abc'),
|
142 |
-
array('~\\.abc~', '\\.abc'),
|
143 |
-
array('~\\\\.abc~', '\\\\@abc'),
|
144 |
-
array('~\\\\\\.abc~', '\\\\\\.abc'),
|
145 |
-
);
|
146 |
-
}
|
147 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/FakeAdapter/DummyAdapter.php
DELETED
@@ -1,57 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\FakeAdapter;
|
13 |
-
|
14 |
-
use Symfony\Component\Finder\Adapter\AbstractAdapter;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* @author Jean-François Simon <contact@jfsimon.fr>
|
18 |
-
*/
|
19 |
-
class DummyAdapter extends AbstractAdapter
|
20 |
-
{
|
21 |
-
/**
|
22 |
-
* @var \Iterator
|
23 |
-
*/
|
24 |
-
private $iterator;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* @param \Iterator $iterator
|
28 |
-
*/
|
29 |
-
public function __construct(\Iterator $iterator)
|
30 |
-
{
|
31 |
-
$this->iterator = $iterator;
|
32 |
-
}
|
33 |
-
|
34 |
-
/**
|
35 |
-
* {@inheritdoc}
|
36 |
-
*/
|
37 |
-
public function searchInDirectory($dir)
|
38 |
-
{
|
39 |
-
return $this->iterator;
|
40 |
-
}
|
41 |
-
|
42 |
-
/**
|
43 |
-
* {@inheritdoc}
|
44 |
-
*/
|
45 |
-
public function getName()
|
46 |
-
{
|
47 |
-
return 'yes';
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* {@inheritdoc}
|
52 |
-
*/
|
53 |
-
protected function canBeUsed()
|
54 |
-
{
|
55 |
-
return true;
|
56 |
-
}
|
57 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/FakeAdapter/FailingAdapter.php
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\FakeAdapter;
|
13 |
-
|
14 |
-
use Symfony\Component\Finder\Adapter\AbstractAdapter;
|
15 |
-
use Symfony\Component\Finder\Exception\AdapterFailureException;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* @author Jean-François Simon <contact@jfsimon.fr>
|
19 |
-
*/
|
20 |
-
class FailingAdapter extends AbstractAdapter
|
21 |
-
{
|
22 |
-
/**
|
23 |
-
* {@inheritdoc}
|
24 |
-
*/
|
25 |
-
public function searchInDirectory($dir)
|
26 |
-
{
|
27 |
-
throw new AdapterFailureException($this);
|
28 |
-
}
|
29 |
-
|
30 |
-
/**
|
31 |
-
* {@inheritdoc}
|
32 |
-
*/
|
33 |
-
public function getName()
|
34 |
-
{
|
35 |
-
return 'failing';
|
36 |
-
}
|
37 |
-
|
38 |
-
/**
|
39 |
-
* {@inheritdoc}
|
40 |
-
*/
|
41 |
-
protected function canBeUsed()
|
42 |
-
{
|
43 |
-
return true;
|
44 |
-
}
|
45 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/FakeAdapter/NamedAdapter.php
DELETED
@@ -1,57 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\FakeAdapter;
|
13 |
-
|
14 |
-
use Symfony\Component\Finder\Adapter\AbstractAdapter;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* @author Jean-François Simon <contact@jfsimon.fr>
|
18 |
-
*/
|
19 |
-
class NamedAdapter extends AbstractAdapter
|
20 |
-
{
|
21 |
-
/**
|
22 |
-
* @var string
|
23 |
-
*/
|
24 |
-
private $name;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* @param string $name
|
28 |
-
*/
|
29 |
-
public function __construct($name)
|
30 |
-
{
|
31 |
-
$this->name = $name;
|
32 |
-
}
|
33 |
-
|
34 |
-
/**
|
35 |
-
* {@inheritdoc}
|
36 |
-
*/
|
37 |
-
public function searchInDirectory($dir)
|
38 |
-
{
|
39 |
-
return new \ArrayIterator(array());
|
40 |
-
}
|
41 |
-
|
42 |
-
/**
|
43 |
-
* {@inheritdoc}
|
44 |
-
*/
|
45 |
-
public function getName()
|
46 |
-
{
|
47 |
-
return $this->name;
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* {@inheritdoc}
|
52 |
-
*/
|
53 |
-
protected function canBeUsed()
|
54 |
-
{
|
55 |
-
return true;
|
56 |
-
}
|
57 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/FakeAdapter/UnsupportedAdapter.php
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\FakeAdapter;
|
13 |
-
|
14 |
-
use Symfony\Component\Finder\Adapter\AbstractAdapter;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* @author Jean-François Simon <contact@jfsimon.fr>
|
18 |
-
*/
|
19 |
-
class UnsupportedAdapter extends AbstractAdapter
|
20 |
-
{
|
21 |
-
/**
|
22 |
-
* {@inheritdoc}
|
23 |
-
*/
|
24 |
-
public function searchInDirectory($dir)
|
25 |
-
{
|
26 |
-
return new \ArrayIterator(array());
|
27 |
-
}
|
28 |
-
|
29 |
-
/**
|
30 |
-
* {@inheritdoc}
|
31 |
-
*/
|
32 |
-
public function getName()
|
33 |
-
{
|
34 |
-
return 'unsupported';
|
35 |
-
}
|
36 |
-
|
37 |
-
/**
|
38 |
-
* {@inheritdoc}
|
39 |
-
*/
|
40 |
-
protected function canBeUsed()
|
41 |
-
{
|
42 |
-
return false;
|
43 |
-
}
|
44 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/FinderTest.php
DELETED
@@ -1,787 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests;
|
13 |
-
|
14 |
-
use Symfony\Component\Finder\Adapter\AdapterInterface;
|
15 |
-
use Symfony\Component\Finder\Adapter\PhpAdapter;
|
16 |
-
use Symfony\Component\Finder\Finder;
|
17 |
-
|
18 |
-
class FinderTest extends Iterator\RealIteratorTestCase
|
19 |
-
{
|
20 |
-
public function testCreate()
|
21 |
-
{
|
22 |
-
$this->assertInstanceOf('Symfony\Component\Finder\Finder', Finder::create());
|
23 |
-
}
|
24 |
-
|
25 |
-
public function testDirectories()
|
26 |
-
{
|
27 |
-
$finder = $this->buildFinder();
|
28 |
-
$this->assertSame($finder, $finder->directories());
|
29 |
-
$this->assertIterator($this->toAbsolute(array('foo', 'toto')), $finder->in(self::$tmpDir)->getIterator());
|
30 |
-
|
31 |
-
$finder = $this->buildFinder();
|
32 |
-
$finder->directories();
|
33 |
-
$finder->files();
|
34 |
-
$finder->directories();
|
35 |
-
$this->assertIterator($this->toAbsolute(array('foo', 'toto')), $finder->in(self::$tmpDir)->getIterator());
|
36 |
-
}
|
37 |
-
|
38 |
-
public function testFiles()
|
39 |
-
{
|
40 |
-
$finder = $this->buildFinder();
|
41 |
-
$this->assertSame($finder, $finder->files());
|
42 |
-
$this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php', 'test.py', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
43 |
-
|
44 |
-
$finder = $this->buildFinder();
|
45 |
-
$finder->files();
|
46 |
-
$finder->directories();
|
47 |
-
$finder->files();
|
48 |
-
$this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php', 'test.py', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
49 |
-
}
|
50 |
-
|
51 |
-
public function testRemoveTrailingSlash()
|
52 |
-
{
|
53 |
-
$finder = $this->buildFinder();
|
54 |
-
|
55 |
-
$expected = $this->toAbsolute(array('foo/bar.tmp', 'test.php', 'test.py', 'foo bar'));
|
56 |
-
$in = self::$tmpDir.'//';
|
57 |
-
|
58 |
-
$this->assertIterator($expected, $finder->in($in)->files()->getIterator());
|
59 |
-
}
|
60 |
-
|
61 |
-
public function testSymlinksNotResolved()
|
62 |
-
{
|
63 |
-
if ('\\' === \DIRECTORY_SEPARATOR) {
|
64 |
-
$this->markTestSkipped('symlinks are not supported on Windows');
|
65 |
-
}
|
66 |
-
|
67 |
-
$finder = $this->buildFinder();
|
68 |
-
|
69 |
-
symlink($this->toAbsolute('foo'), $this->toAbsolute('baz'));
|
70 |
-
$expected = $this->toAbsolute(array('baz/bar.tmp'));
|
71 |
-
$in = self::$tmpDir.'/baz/';
|
72 |
-
try {
|
73 |
-
$this->assertIterator($expected, $finder->in($in)->files()->getIterator());
|
74 |
-
unlink($this->toAbsolute('baz'));
|
75 |
-
} catch (\Exception $e) {
|
76 |
-
unlink($this->toAbsolute('baz'));
|
77 |
-
throw $e;
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
81 |
-
public function testBackPathNotNormalized()
|
82 |
-
{
|
83 |
-
$finder = $this->buildFinder();
|
84 |
-
|
85 |
-
$expected = $this->toAbsolute(array('foo/../foo/bar.tmp'));
|
86 |
-
$in = self::$tmpDir.'/foo/../foo/';
|
87 |
-
$this->assertIterator($expected, $finder->in($in)->files()->getIterator());
|
88 |
-
}
|
89 |
-
|
90 |
-
public function testDepth()
|
91 |
-
{
|
92 |
-
$finder = $this->buildFinder();
|
93 |
-
$this->assertSame($finder, $finder->depth('< 1'));
|
94 |
-
$this->assertIterator($this->toAbsolute(array('foo', 'test.php', 'test.py', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
95 |
-
|
96 |
-
$finder = $this->buildFinder();
|
97 |
-
$this->assertSame($finder, $finder->depth('<= 0'));
|
98 |
-
$this->assertIterator($this->toAbsolute(array('foo', 'test.php', 'test.py', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
99 |
-
|
100 |
-
$finder = $this->buildFinder();
|
101 |
-
$this->assertSame($finder, $finder->depth('>= 1'));
|
102 |
-
$this->assertIterator($this->toAbsolute(array('foo/bar.tmp')), $finder->in(self::$tmpDir)->getIterator());
|
103 |
-
|
104 |
-
$finder = $this->buildFinder();
|
105 |
-
$finder->depth('< 1')->depth('>= 1');
|
106 |
-
$this->assertIterator(array(), $finder->in(self::$tmpDir)->getIterator());
|
107 |
-
}
|
108 |
-
|
109 |
-
public function testName()
|
110 |
-
{
|
111 |
-
$finder = $this->buildFinder();
|
112 |
-
$this->assertSame($finder, $finder->name('*.php'));
|
113 |
-
$this->assertIterator($this->toAbsolute(array('test.php')), $finder->in(self::$tmpDir)->getIterator());
|
114 |
-
|
115 |
-
$finder = $this->buildFinder();
|
116 |
-
$finder->name('test.ph*');
|
117 |
-
$finder->name('test.py');
|
118 |
-
$this->assertIterator($this->toAbsolute(array('test.php', 'test.py')), $finder->in(self::$tmpDir)->getIterator());
|
119 |
-
|
120 |
-
$finder = $this->buildFinder();
|
121 |
-
$finder->name('~^test~i');
|
122 |
-
$this->assertIterator($this->toAbsolute(array('test.php', 'test.py')), $finder->in(self::$tmpDir)->getIterator());
|
123 |
-
|
124 |
-
$finder = $this->buildFinder();
|
125 |
-
$finder->name('~\\.php$~i');
|
126 |
-
$this->assertIterator($this->toAbsolute(array('test.php')), $finder->in(self::$tmpDir)->getIterator());
|
127 |
-
|
128 |
-
$finder = $this->buildFinder();
|
129 |
-
$finder->name('test.p{hp,y}');
|
130 |
-
$this->assertIterator($this->toAbsolute(array('test.php', 'test.py')), $finder->in(self::$tmpDir)->getIterator());
|
131 |
-
}
|
132 |
-
|
133 |
-
public function testNotName()
|
134 |
-
{
|
135 |
-
$finder = $this->buildFinder();
|
136 |
-
$this->assertSame($finder, $finder->notName('*.php'));
|
137 |
-
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.py', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
138 |
-
|
139 |
-
$finder = $this->buildFinder();
|
140 |
-
$finder->notName('*.php');
|
141 |
-
$finder->notName('*.py');
|
142 |
-
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
143 |
-
|
144 |
-
$finder = $this->buildFinder();
|
145 |
-
$finder->name('test.ph*');
|
146 |
-
$finder->name('test.py');
|
147 |
-
$finder->notName('*.php');
|
148 |
-
$finder->notName('*.py');
|
149 |
-
$this->assertIterator(array(), $finder->in(self::$tmpDir)->getIterator());
|
150 |
-
|
151 |
-
$finder = $this->buildFinder();
|
152 |
-
$finder->name('test.ph*');
|
153 |
-
$finder->name('test.py');
|
154 |
-
$finder->notName('*.p{hp,y}');
|
155 |
-
$this->assertIterator(array(), $finder->in(self::$tmpDir)->getIterator());
|
156 |
-
}
|
157 |
-
|
158 |
-
/**
|
159 |
-
* @dataProvider getRegexNameTestData
|
160 |
-
*/
|
161 |
-
public function testRegexName($regex)
|
162 |
-
{
|
163 |
-
$finder = $this->buildFinder();
|
164 |
-
$finder->name($regex);
|
165 |
-
$this->assertIterator($this->toAbsolute(array('test.py', 'test.php')), $finder->in(self::$tmpDir)->getIterator());
|
166 |
-
}
|
167 |
-
|
168 |
-
public function testSize()
|
169 |
-
{
|
170 |
-
$finder = $this->buildFinder();
|
171 |
-
$this->assertSame($finder, $finder->files()->size('< 1K')->size('> 500'));
|
172 |
-
$this->assertIterator($this->toAbsolute(array('test.php')), $finder->in(self::$tmpDir)->getIterator());
|
173 |
-
}
|
174 |
-
|
175 |
-
public function testDate()
|
176 |
-
{
|
177 |
-
$finder = $this->buildFinder();
|
178 |
-
$this->assertSame($finder, $finder->files()->date('until last month'));
|
179 |
-
$this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php')), $finder->in(self::$tmpDir)->getIterator());
|
180 |
-
}
|
181 |
-
|
182 |
-
public function testExclude()
|
183 |
-
{
|
184 |
-
$finder = $this->buildFinder();
|
185 |
-
$this->assertSame($finder, $finder->exclude('foo'));
|
186 |
-
$this->assertIterator($this->toAbsolute(array('test.php', 'test.py', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
187 |
-
}
|
188 |
-
|
189 |
-
public function testIgnoreVCS()
|
190 |
-
{
|
191 |
-
$finder = $this->buildFinder();
|
192 |
-
$this->assertSame($finder, $finder->ignoreVCS(false)->ignoreDotFiles(false));
|
193 |
-
$this->assertIterator($this->toAbsolute(array('.git', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'toto/.git', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
194 |
-
|
195 |
-
$finder = $this->buildFinder();
|
196 |
-
$finder->ignoreVCS(false)->ignoreVCS(false)->ignoreDotFiles(false);
|
197 |
-
$this->assertIterator($this->toAbsolute(array('.git', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'toto/.git', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
198 |
-
|
199 |
-
$finder = $this->buildFinder();
|
200 |
-
$this->assertSame($finder, $finder->ignoreVCS(true)->ignoreDotFiles(false));
|
201 |
-
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
202 |
-
}
|
203 |
-
|
204 |
-
public function testIgnoreDotFiles()
|
205 |
-
{
|
206 |
-
$finder = $this->buildFinder();
|
207 |
-
$this->assertSame($finder, $finder->ignoreDotFiles(false)->ignoreVCS(false));
|
208 |
-
$this->assertIterator($this->toAbsolute(array('.git', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'toto/.git', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
209 |
-
|
210 |
-
$finder = $this->buildFinder();
|
211 |
-
$finder->ignoreDotFiles(false)->ignoreDotFiles(false)->ignoreVCS(false);
|
212 |
-
$this->assertIterator($this->toAbsolute(array('.git', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'toto/.git', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
213 |
-
|
214 |
-
$finder = $this->buildFinder();
|
215 |
-
$this->assertSame($finder, $finder->ignoreDotFiles(true)->ignoreVCS(false));
|
216 |
-
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
217 |
-
}
|
218 |
-
|
219 |
-
public function testSortByName()
|
220 |
-
{
|
221 |
-
$finder = $this->buildFinder();
|
222 |
-
$this->assertSame($finder, $finder->sortByName());
|
223 |
-
$this->assertIterator($this->toAbsolute(array('foo', 'foo bar', 'foo/bar.tmp', 'test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());
|
224 |
-
}
|
225 |
-
|
226 |
-
public function testSortByType()
|
227 |
-
{
|
228 |
-
$finder = $this->buildFinder();
|
229 |
-
$this->assertSame($finder, $finder->sortByType());
|
230 |
-
$this->assertIterator($this->toAbsolute(array('foo', 'foo bar', 'toto', 'foo/bar.tmp', 'test.php', 'test.py')), $finder->in(self::$tmpDir)->getIterator());
|
231 |
-
}
|
232 |
-
|
233 |
-
public function testSortByAccessedTime()
|
234 |
-
{
|
235 |
-
$finder = $this->buildFinder();
|
236 |
-
$this->assertSame($finder, $finder->sortByAccessedTime());
|
237 |
-
$this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php', 'toto', 'test.py', 'foo', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
238 |
-
}
|
239 |
-
|
240 |
-
public function testSortByChangedTime()
|
241 |
-
{
|
242 |
-
$finder = $this->buildFinder();
|
243 |
-
$this->assertSame($finder, $finder->sortByChangedTime());
|
244 |
-
$this->assertIterator($this->toAbsolute(array('toto', 'test.py', 'test.php', 'foo/bar.tmp', 'foo', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
245 |
-
}
|
246 |
-
|
247 |
-
public function testSortByModifiedTime()
|
248 |
-
{
|
249 |
-
$finder = $this->buildFinder();
|
250 |
-
$this->assertSame($finder, $finder->sortByModifiedTime());
|
251 |
-
$this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php', 'toto', 'test.py', 'foo', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
252 |
-
}
|
253 |
-
|
254 |
-
public function testSort()
|
255 |
-
{
|
256 |
-
$finder = $this->buildFinder();
|
257 |
-
$this->assertSame($finder, $finder->sort(function (\SplFileInfo $a, \SplFileInfo $b) { return strcmp($a->getRealPath(), $b->getRealPath()); }));
|
258 |
-
$this->assertIterator($this->toAbsolute(array('foo', 'foo bar', 'foo/bar.tmp', 'test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());
|
259 |
-
}
|
260 |
-
|
261 |
-
public function testFilter()
|
262 |
-
{
|
263 |
-
$finder = $this->buildFinder();
|
264 |
-
$this->assertSame($finder, $finder->filter(function (\SplFileInfo $f) { return false !== strpos($f, 'test'); }));
|
265 |
-
$this->assertIterator($this->toAbsolute(array('test.php', 'test.py')), $finder->in(self::$tmpDir)->getIterator());
|
266 |
-
}
|
267 |
-
|
268 |
-
public function testFollowLinks()
|
269 |
-
{
|
270 |
-
if ('\\' == \DIRECTORY_SEPARATOR) {
|
271 |
-
$this->markTestSkipped('symlinks are not supported on Windows');
|
272 |
-
}
|
273 |
-
|
274 |
-
$finder = $this->buildFinder();
|
275 |
-
$this->assertSame($finder, $finder->followLinks());
|
276 |
-
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
277 |
-
}
|
278 |
-
|
279 |
-
public function testIn()
|
280 |
-
{
|
281 |
-
$finder = $this->buildFinder();
|
282 |
-
$iterator = $finder->files()->name('*.php')->depth('< 1')->in(array(self::$tmpDir, __DIR__))->getIterator();
|
283 |
-
|
284 |
-
$expected = array(
|
285 |
-
self::$tmpDir.\DIRECTORY_SEPARATOR.'test.php',
|
286 |
-
__DIR__.\DIRECTORY_SEPARATOR.'BsdFinderTest.php',
|
287 |
-
__DIR__.\DIRECTORY_SEPARATOR.'FinderTest.php',
|
288 |
-
__DIR__.\DIRECTORY_SEPARATOR.'GnuFinderTest.php',
|
289 |
-
__DIR__.\DIRECTORY_SEPARATOR.'PhpFinderTest.php',
|
290 |
-
__DIR__.\DIRECTORY_SEPARATOR.'GlobTest.php',
|
291 |
-
);
|
292 |
-
|
293 |
-
$this->assertIterator($expected, $iterator);
|
294 |
-
}
|
295 |
-
|
296 |
-
/**
|
297 |
-
* @expectedException \InvalidArgumentException
|
298 |
-
*/
|
299 |
-
public function testInWithNonExistentDirectory()
|
300 |
-
{
|
301 |
-
$finder = new Finder();
|
302 |
-
$finder->in('foobar');
|
303 |
-
}
|
304 |
-
|
305 |
-
public function testInWithGlob()
|
306 |
-
{
|
307 |
-
$finder = $this->buildFinder();
|
308 |
-
$finder->in(array(__DIR__.'/Fixtures/*/B/C/', __DIR__.'/Fixtures/*/*/B/C/'))->getIterator();
|
309 |
-
|
310 |
-
$this->assertIterator($this->toAbsoluteFixtures(array('A/B/C/abc.dat', 'copy/A/B/C/abc.dat.copy')), $finder);
|
311 |
-
}
|
312 |
-
|
313 |
-
/**
|
314 |
-
* @expectedException \InvalidArgumentException
|
315 |
-
*/
|
316 |
-
public function testInWithNonDirectoryGlob()
|
317 |
-
{
|
318 |
-
$finder = new Finder();
|
319 |
-
$finder->in(__DIR__.'/Fixtures/A/a*');
|
320 |
-
}
|
321 |
-
|
322 |
-
public function testInWithGlobBrace()
|
323 |
-
{
|
324 |
-
$finder = $this->buildFinder();
|
325 |
-
$finder->in(array(__DIR__.'/Fixtures/{A,copy/A}/B/C'))->getIterator();
|
326 |
-
|
327 |
-
$this->assertIterator($this->toAbsoluteFixtures(array('A/B/C/abc.dat', 'copy/A/B/C/abc.dat.copy')), $finder);
|
328 |
-
}
|
329 |
-
|
330 |
-
/**
|
331 |
-
* @expectedException \LogicException
|
332 |
-
*/
|
333 |
-
public function testGetIteratorWithoutIn()
|
334 |
-
{
|
335 |
-
$finder = Finder::create();
|
336 |
-
$finder->getIterator();
|
337 |
-
}
|
338 |
-
|
339 |
-
public function testGetIterator()
|
340 |
-
{
|
341 |
-
$finder = $this->buildFinder();
|
342 |
-
$dirs = array();
|
343 |
-
foreach ($finder->directories()->in(self::$tmpDir) as $dir) {
|
344 |
-
$dirs[] = (string) $dir;
|
345 |
-
}
|
346 |
-
|
347 |
-
$expected = $this->toAbsolute(array('foo', 'toto'));
|
348 |
-
|
349 |
-
sort($dirs);
|
350 |
-
sort($expected);
|
351 |
-
|
352 |
-
$this->assertEquals($expected, $dirs, 'implements the \IteratorAggregate interface');
|
353 |
-
|
354 |
-
$finder = $this->buildFinder();
|
355 |
-
$this->assertEquals(2, iterator_count($finder->directories()->in(self::$tmpDir)), 'implements the \IteratorAggregate interface');
|
356 |
-
|
357 |
-
$finder = $this->buildFinder();
|
358 |
-
$a = iterator_to_array($finder->directories()->in(self::$tmpDir));
|
359 |
-
$a = array_values(array_map('strval', $a));
|
360 |
-
sort($a);
|
361 |
-
$this->assertEquals($expected, $a, 'implements the \IteratorAggregate interface');
|
362 |
-
}
|
363 |
-
|
364 |
-
public function testRelativePath()
|
365 |
-
{
|
366 |
-
$finder = $this->buildFinder()->in(self::$tmpDir);
|
367 |
-
|
368 |
-
$paths = array();
|
369 |
-
|
370 |
-
foreach ($finder as $file) {
|
371 |
-
$paths[] = $file->getRelativePath();
|
372 |
-
}
|
373 |
-
|
374 |
-
$ref = array('', '', '', '', 'foo', '');
|
375 |
-
|
376 |
-
sort($ref);
|
377 |
-
sort($paths);
|
378 |
-
|
379 |
-
$this->assertEquals($ref, $paths);
|
380 |
-
}
|
381 |
-
|
382 |
-
public function testRelativePathname()
|
383 |
-
{
|
384 |
-
$finder = $this->buildFinder()->in(self::$tmpDir)->sortByName();
|
385 |
-
|
386 |
-
$paths = array();
|
387 |
-
|
388 |
-
foreach ($finder as $file) {
|
389 |
-
$paths[] = $file->getRelativePathname();
|
390 |
-
}
|
391 |
-
|
392 |
-
$ref = array('test.php', 'toto', 'test.py', 'foo', 'foo'.\DIRECTORY_SEPARATOR.'bar.tmp', 'foo bar');
|
393 |
-
|
394 |
-
sort($paths);
|
395 |
-
sort($ref);
|
396 |
-
|
397 |
-
$this->assertEquals($ref, $paths);
|
398 |
-
}
|
399 |
-
|
400 |
-
public function testAppendWithAFinder()
|
401 |
-
{
|
402 |
-
$finder = $this->buildFinder();
|
403 |
-
$finder->files()->in(self::$tmpDir.\DIRECTORY_SEPARATOR.'foo');
|
404 |
-
|
405 |
-
$finder1 = $this->buildFinder();
|
406 |
-
$finder1->directories()->in(self::$tmpDir);
|
407 |
-
|
408 |
-
$finder = $finder->append($finder1);
|
409 |
-
|
410 |
-
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'toto')), $finder->getIterator());
|
411 |
-
}
|
412 |
-
|
413 |
-
public function testAppendWithAnArray()
|
414 |
-
{
|
415 |
-
$finder = $this->buildFinder();
|
416 |
-
$finder->files()->in(self::$tmpDir.\DIRECTORY_SEPARATOR.'foo');
|
417 |
-
|
418 |
-
$finder->append($this->toAbsolute(array('foo', 'toto')));
|
419 |
-
|
420 |
-
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'toto')), $finder->getIterator());
|
421 |
-
}
|
422 |
-
|
423 |
-
public function testAppendReturnsAFinder()
|
424 |
-
{
|
425 |
-
$this->assertInstanceOf('Symfony\\Component\\Finder\\Finder', Finder::create()->append(array()));
|
426 |
-
}
|
427 |
-
|
428 |
-
public function testAppendDoesNotRequireIn()
|
429 |
-
{
|
430 |
-
$finder = $this->buildFinder();
|
431 |
-
$finder->in(self::$tmpDir.\DIRECTORY_SEPARATOR.'foo');
|
432 |
-
|
433 |
-
$finder1 = Finder::create()->append($finder);
|
434 |
-
|
435 |
-
$this->assertIterator(iterator_to_array($finder->getIterator()), $finder1->getIterator());
|
436 |
-
}
|
437 |
-
|
438 |
-
public function testCountDirectories()
|
439 |
-
{
|
440 |
-
$directory = Finder::create()->directories()->in(self::$tmpDir);
|
441 |
-
$i = 0;
|
442 |
-
|
443 |
-
foreach ($directory as $dir) {
|
444 |
-
++$i;
|
445 |
-
}
|
446 |
-
|
447 |
-
$this->assertCount($i, $directory);
|
448 |
-
}
|
449 |
-
|
450 |
-
public function testCountFiles()
|
451 |
-
{
|
452 |
-
$files = Finder::create()->files()->in(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
|
453 |
-
$i = 0;
|
454 |
-
|
455 |
-
foreach ($files as $file) {
|
456 |
-
++$i;
|
457 |
-
}
|
458 |
-
|
459 |
-
$this->assertCount($i, $files);
|
460 |
-
}
|
461 |
-
|
462 |
-
/**
|
463 |
-
* @expectedException \LogicException
|
464 |
-
*/
|
465 |
-
public function testCountWithoutIn()
|
466 |
-
{
|
467 |
-
$finder = Finder::create()->files();
|
468 |
-
\count($finder);
|
469 |
-
}
|
470 |
-
|
471 |
-
/**
|
472 |
-
* @dataProvider getContainsTestData
|
473 |
-
*/
|
474 |
-
public function testContains($matchPatterns, $noMatchPatterns, $expected)
|
475 |
-
{
|
476 |
-
$finder = $this->buildFinder();
|
477 |
-
$finder->in(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures')
|
478 |
-
->name('*.txt')->sortByName()
|
479 |
-
->contains($matchPatterns)
|
480 |
-
->notContains($noMatchPatterns);
|
481 |
-
|
482 |
-
$this->assertIterator($this->toAbsoluteFixtures($expected), $finder);
|
483 |
-
}
|
484 |
-
|
485 |
-
public function testContainsOnDirectory()
|
486 |
-
{
|
487 |
-
$finder = $this->buildFinder();
|
488 |
-
$finder->in(__DIR__)
|
489 |
-
->directories()
|
490 |
-
->name('Fixtures')
|
491 |
-
->contains('abc');
|
492 |
-
$this->assertIterator(array(), $finder);
|
493 |
-
}
|
494 |
-
|
495 |
-
public function testNotContainsOnDirectory()
|
496 |
-
{
|
497 |
-
$finder = $this->buildFinder();
|
498 |
-
$finder->in(__DIR__)
|
499 |
-
->directories()
|
500 |
-
->name('Fixtures')
|
501 |
-
->notContains('abc');
|
502 |
-
$this->assertIterator(array(), $finder);
|
503 |
-
}
|
504 |
-
|
505 |
-
/**
|
506 |
-
* Searching in multiple locations involves AppendIterator which does an unnecessary rewind which leaves FilterIterator
|
507 |
-
* with inner FilesystemIterator in an invalid state.
|
508 |
-
*
|
509 |
-
* @see https://bugs.php.net/68557
|
510 |
-
*/
|
511 |
-
public function testMultipleLocations()
|
512 |
-
{
|
513 |
-
$locations = array(
|
514 |
-
self::$tmpDir.'/',
|
515 |
-
self::$tmpDir.'/toto/',
|
516 |
-
);
|
517 |
-
|
518 |
-
// it is expected that there are test.py test.php in the tmpDir
|
519 |
-
$finder = new Finder();
|
520 |
-
$finder->in($locations)
|
521 |
-
// the default flag IGNORE_DOT_FILES fixes the problem indirectly
|
522 |
-
// so we set it to false for better isolation
|
523 |
-
->ignoreDotFiles(false)
|
524 |
-
->depth('< 1')->name('test.php');
|
525 |
-
|
526 |
-
$this->assertCount(1, $finder);
|
527 |
-
}
|
528 |
-
|
529 |
-
/**
|
530 |
-
* Searching in multiple locations with sub directories involves
|
531 |
-
* AppendIterator which does an unnecessary rewind which leaves
|
532 |
-
* FilterIterator with inner FilesystemIterator in an invalid state.
|
533 |
-
*
|
534 |
-
* @see https://bugs.php.net/68557
|
535 |
-
*/
|
536 |
-
public function testMultipleLocationsWithSubDirectories()
|
537 |
-
{
|
538 |
-
$locations = array(
|
539 |
-
__DIR__.'/Fixtures/one',
|
540 |
-
self::$tmpDir.\DIRECTORY_SEPARATOR.'toto',
|
541 |
-
);
|
542 |
-
|
543 |
-
$finder = $this->buildFinder();
|
544 |
-
$finder->in($locations)->depth('< 10')->name('*.neon');
|
545 |
-
|
546 |
-
$expected = array(
|
547 |
-
__DIR__.'/Fixtures/one'.\DIRECTORY_SEPARATOR.'b'.\DIRECTORY_SEPARATOR.'c.neon',
|
548 |
-
__DIR__.'/Fixtures/one'.\DIRECTORY_SEPARATOR.'b'.\DIRECTORY_SEPARATOR.'d.neon',
|
549 |
-
);
|
550 |
-
|
551 |
-
$this->assertIterator($expected, $finder);
|
552 |
-
$this->assertIteratorInForeach($expected, $finder);
|
553 |
-
}
|
554 |
-
|
555 |
-
/**
|
556 |
-
* Iterator keys must be the file pathname.
|
557 |
-
*/
|
558 |
-
public function testIteratorKeys()
|
559 |
-
{
|
560 |
-
$finder = $this->buildFinder()->in(self::$tmpDir);
|
561 |
-
foreach ($finder as $key => $file) {
|
562 |
-
$this->assertEquals($file->getPathname(), $key);
|
563 |
-
}
|
564 |
-
}
|
565 |
-
|
566 |
-
public function testRegexSpecialCharsLocationWithPathRestrictionContainingStartFlag()
|
567 |
-
{
|
568 |
-
$finder = $this->buildFinder();
|
569 |
-
$finder->in(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR.'r+e.gex[c]a(r)s')
|
570 |
-
->path('/^dir/');
|
571 |
-
|
572 |
-
$expected = array('r+e.gex[c]a(r)s'.\DIRECTORY_SEPARATOR.'dir', 'r+e.gex[c]a(r)s'.\DIRECTORY_SEPARATOR.'dir'.\DIRECTORY_SEPARATOR.'bar.dat');
|
573 |
-
$this->assertIterator($this->toAbsoluteFixtures($expected), $finder);
|
574 |
-
}
|
575 |
-
|
576 |
-
/**
|
577 |
-
* @group legacy
|
578 |
-
*/
|
579 |
-
public function testAdaptersOrdering()
|
580 |
-
{
|
581 |
-
$finder = Finder::create()
|
582 |
-
->removeAdapters()
|
583 |
-
->addAdapter(new FakeAdapter\NamedAdapter('a'), 0)
|
584 |
-
->addAdapter(new FakeAdapter\NamedAdapter('b'), -50)
|
585 |
-
->addAdapter(new FakeAdapter\NamedAdapter('c'), 50)
|
586 |
-
->addAdapter(new FakeAdapter\NamedAdapter('d'), -25)
|
587 |
-
->addAdapter(new FakeAdapter\NamedAdapter('e'), 25);
|
588 |
-
|
589 |
-
$this->assertEquals(
|
590 |
-
array('c', 'e', 'a', 'd', 'b'),
|
591 |
-
array_map(function (AdapterInterface $adapter) {
|
592 |
-
return $adapter->getName();
|
593 |
-
}, $finder->getAdapters())
|
594 |
-
);
|
595 |
-
}
|
596 |
-
|
597 |
-
/**
|
598 |
-
* @group legacy
|
599 |
-
*/
|
600 |
-
public function testAdaptersChaining()
|
601 |
-
{
|
602 |
-
$iterator = new \ArrayIterator(array());
|
603 |
-
$filenames = $this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto'));
|
604 |
-
foreach ($filenames as $file) {
|
605 |
-
$iterator->append(new \Symfony\Component\Finder\SplFileInfo($file, null, null));
|
606 |
-
}
|
607 |
-
|
608 |
-
$finder = Finder::create()
|
609 |
-
->removeAdapters()
|
610 |
-
->addAdapter(new FakeAdapter\UnsupportedAdapter(), 3)
|
611 |
-
->addAdapter(new FakeAdapter\FailingAdapter(), 2)
|
612 |
-
->addAdapter(new FakeAdapter\DummyAdapter($iterator), 1);
|
613 |
-
|
614 |
-
$this->assertIterator($filenames, $finder->in(sys_get_temp_dir())->getIterator());
|
615 |
-
}
|
616 |
-
|
617 |
-
public function getContainsTestData()
|
618 |
-
{
|
619 |
-
return array(
|
620 |
-
array('', '', array()),
|
621 |
-
array('foo', 'bar', array()),
|
622 |
-
array('', 'foobar', array('dolor.txt', 'ipsum.txt', 'lorem.txt')),
|
623 |
-
array('lorem ipsum dolor sit amet', 'foobar', array('lorem.txt')),
|
624 |
-
array('sit', 'bar', array('dolor.txt', 'ipsum.txt', 'lorem.txt')),
|
625 |
-
array('dolor sit amet', '@^L@m', array('dolor.txt', 'ipsum.txt')),
|
626 |
-
array('/^lorem ipsum dolor sit amet$/m', 'foobar', array('lorem.txt')),
|
627 |
-
array('lorem', 'foobar', array('lorem.txt')),
|
628 |
-
array('', 'lorem', array('dolor.txt', 'ipsum.txt')),
|
629 |
-
array('ipsum dolor sit amet', '/^IPSUM/m', array('lorem.txt')),
|
630 |
-
);
|
631 |
-
}
|
632 |
-
|
633 |
-
public function getRegexNameTestData()
|
634 |
-
{
|
635 |
-
return array(
|
636 |
-
array('~.+\\.p.+~i'),
|
637 |
-
array('~t.*s~i'),
|
638 |
-
);
|
639 |
-
}
|
640 |
-
|
641 |
-
/**
|
642 |
-
* @dataProvider getTestPathData
|
643 |
-
*/
|
644 |
-
public function testPath($matchPatterns, $noMatchPatterns, array $expected)
|
645 |
-
{
|
646 |
-
$finder = $this->buildFinder();
|
647 |
-
$finder->in(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures')
|
648 |
-
->path($matchPatterns)
|
649 |
-
->notPath($noMatchPatterns);
|
650 |
-
|
651 |
-
$this->assertIterator($this->toAbsoluteFixtures($expected), $finder);
|
652 |
-
}
|
653 |
-
|
654 |
-
/**
|
655 |
-
* @group legacy
|
656 |
-
*/
|
657 |
-
public function testAdapterSelection()
|
658 |
-
{
|
659 |
-
// test that by default, PhpAdapter is selected
|
660 |
-
$adapters = Finder::create()->getAdapters();
|
661 |
-
$this->assertInstanceOf('Symfony\Component\Finder\Adapter\PhpAdapter', $adapters[0]);
|
662 |
-
|
663 |
-
// test another adapter selection
|
664 |
-
$adapters = Finder::create()->setAdapter('gnu_find')->getAdapters();
|
665 |
-
$this->assertInstanceOf('Symfony\Component\Finder\Adapter\GnuFindAdapter', $adapters[0]);
|
666 |
-
|
667 |
-
// test that useBestAdapter method removes selection
|
668 |
-
$adapters = Finder::create()->useBestAdapter()->getAdapters();
|
669 |
-
$this->assertNotInstanceOf('Symfony\Component\Finder\Adapter\PhpAdapter', $adapters[0]);
|
670 |
-
}
|
671 |
-
|
672 |
-
public function getTestPathData()
|
673 |
-
{
|
674 |
-
return array(
|
675 |
-
array('', '', array()),
|
676 |
-
array('/^A\/B\/C/', '/C$/',
|
677 |
-
array('A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C'.\DIRECTORY_SEPARATOR.'abc.dat'),
|
678 |
-
),
|
679 |
-
array('/^A\/B/', 'foobar',
|
680 |
-
array(
|
681 |
-
'A'.\DIRECTORY_SEPARATOR.'B',
|
682 |
-
'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C',
|
683 |
-
'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'ab.dat',
|
684 |
-
'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C'.\DIRECTORY_SEPARATOR.'abc.dat',
|
685 |
-
),
|
686 |
-
),
|
687 |
-
array('A/B/C', 'foobar',
|
688 |
-
array(
|
689 |
-
'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C',
|
690 |
-
'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C'.\DIRECTORY_SEPARATOR.'abc.dat',
|
691 |
-
'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C',
|
692 |
-
'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C'.\DIRECTORY_SEPARATOR.'abc.dat.copy',
|
693 |
-
),
|
694 |
-
),
|
695 |
-
array('A/B', 'foobar',
|
696 |
-
array(
|
697 |
-
//dirs
|
698 |
-
'A'.\DIRECTORY_SEPARATOR.'B',
|
699 |
-
'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C',
|
700 |
-
'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'B',
|
701 |
-
'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C',
|
702 |
-
//files
|
703 |
-
'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'ab.dat',
|
704 |
-
'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C'.\DIRECTORY_SEPARATOR.'abc.dat',
|
705 |
-
'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'ab.dat.copy',
|
706 |
-
'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C'.\DIRECTORY_SEPARATOR.'abc.dat.copy',
|
707 |
-
),
|
708 |
-
),
|
709 |
-
array('/^with space\//', 'foobar',
|
710 |
-
array(
|
711 |
-
'with space'.\DIRECTORY_SEPARATOR.'foo.txt',
|
712 |
-
),
|
713 |
-
),
|
714 |
-
);
|
715 |
-
}
|
716 |
-
|
717 |
-
public function testAccessDeniedException()
|
718 |
-
{
|
719 |
-
if ('\\' === \DIRECTORY_SEPARATOR) {
|
720 |
-
$this->markTestSkipped('chmod is not supported on Windows');
|
721 |
-
}
|
722 |
-
|
723 |
-
$finder = $this->buildFinder();
|
724 |
-
$finder->files()->in(self::$tmpDir);
|
725 |
-
|
726 |
-
// make 'foo' directory non-readable
|
727 |
-
$testDir = self::$tmpDir.\DIRECTORY_SEPARATOR.'foo';
|
728 |
-
chmod($testDir, 0333);
|
729 |
-
|
730 |
-
if (false === $couldRead = is_readable($testDir)) {
|
731 |
-
try {
|
732 |
-
$this->assertIterator($this->toAbsolute(array('foo bar', 'test.php', 'test.py')), $finder->getIterator());
|
733 |
-
$this->fail('Finder should throw an exception when opening a non-readable directory.');
|
734 |
-
} catch (\Exception $e) {
|
735 |
-
$expectedExceptionClass = 'Symfony\\Component\\Finder\\Exception\\AccessDeniedException';
|
736 |
-
if ($e instanceof \PHPUnit_Framework_ExpectationFailedException) {
|
737 |
-
$this->fail(sprintf("Expected exception:\n%s\nGot:\n%s\nWith comparison failure:\n%s", $expectedExceptionClass, 'PHPUnit_Framework_ExpectationFailedException', $e->getComparisonFailure()->getExpectedAsString()));
|
738 |
-
}
|
739 |
-
|
740 |
-
if ($e instanceof \PHPUnit\Framework\ExpectationFailedException) {
|
741 |
-
$this->fail(sprintf("Expected exception:\n%s\nGot:\n%s\nWith comparison failure:\n%s", $expectedExceptionClass, '\PHPUnit\Framework\ExpectationFailedException', $e->getComparisonFailure()->getExpectedAsString()));
|
742 |
-
}
|
743 |
-
|
744 |
-
$this->assertInstanceOf($expectedExceptionClass, $e);
|
745 |
-
}
|
746 |
-
}
|
747 |
-
|
748 |
-
// restore original permissions
|
749 |
-
chmod($testDir, 0777);
|
750 |
-
clearstatcache($testDir);
|
751 |
-
|
752 |
-
if ($couldRead) {
|
753 |
-
$this->markTestSkipped('could read test files while test requires unreadable');
|
754 |
-
}
|
755 |
-
}
|
756 |
-
|
757 |
-
public function testIgnoredAccessDeniedException()
|
758 |
-
{
|
759 |
-
if ('\\' === \DIRECTORY_SEPARATOR) {
|
760 |
-
$this->markTestSkipped('chmod is not supported on Windows');
|
761 |
-
}
|
762 |
-
|
763 |
-
$finder = $this->buildFinder();
|
764 |
-
$finder->files()->ignoreUnreadableDirs()->in(self::$tmpDir);
|
765 |
-
|
766 |
-
// make 'foo' directory non-readable
|
767 |
-
$testDir = self::$tmpDir.\DIRECTORY_SEPARATOR.'foo';
|
768 |
-
chmod($testDir, 0333);
|
769 |
-
|
770 |
-
if (false === ($couldRead = is_readable($testDir))) {
|
771 |
-
$this->assertIterator($this->toAbsolute(array('foo bar', 'test.php', 'test.py')), $finder->getIterator());
|
772 |
-
}
|
773 |
-
|
774 |
-
// restore original permissions
|
775 |
-
chmod($testDir, 0777);
|
776 |
-
clearstatcache($testDir);
|
777 |
-
|
778 |
-
if ($couldRead) {
|
779 |
-
$this->markTestSkipped('could read test files while test requires unreadable');
|
780 |
-
}
|
781 |
-
}
|
782 |
-
|
783 |
-
protected function buildFinder()
|
784 |
-
{
|
785 |
-
return Finder::create();
|
786 |
-
}
|
787 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Fixtures/A/B/C/abc.dat
DELETED
File without changes
|
vendor/symfony/finder/Tests/Fixtures/A/B/ab.dat
DELETED
File without changes
|
vendor/symfony/finder/Tests/Fixtures/A/a.dat
DELETED
File without changes
|
vendor/symfony/finder/Tests/Fixtures/copy/A/B/C/abc.dat.copy
DELETED
File without changes
|
vendor/symfony/finder/Tests/Fixtures/copy/A/B/ab.dat.copy
DELETED
File without changes
|
vendor/symfony/finder/Tests/Fixtures/copy/A/a.dat.copy
DELETED
File without changes
|
vendor/symfony/finder/Tests/Fixtures/dolor.txt
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
dolor sit amet
|
2 |
-
DOLOR SIT AMET
|
|
|
|
vendor/symfony/finder/Tests/Fixtures/ipsum.txt
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
ipsum dolor sit amet
|
2 |
-
IPSUM DOLOR SIT AMET
|
|
|
|
vendor/symfony/finder/Tests/Fixtures/lorem.txt
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
lorem ipsum dolor sit amet
|
2 |
-
LOREM IPSUM DOLOR SIT AMET
|
|
|
|
vendor/symfony/finder/Tests/Fixtures/one/a
DELETED
File without changes
|
vendor/symfony/finder/Tests/Fixtures/one/b/c.neon
DELETED
File without changes
|
vendor/symfony/finder/Tests/Fixtures/one/b/d.neon
DELETED
File without changes
|
vendor/symfony/finder/Tests/Fixtures/r+e.gex[c]a(r)s/dir/bar.dat
DELETED
File without changes
|
vendor/symfony/finder/Tests/Fixtures/with space/foo.txt
DELETED
File without changes
|
vendor/symfony/finder/Tests/GlobTest.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests;
|
13 |
-
|
14 |
-
use PHPUnit\Framework\TestCase;
|
15 |
-
use Symfony\Component\Finder\Glob;
|
16 |
-
|
17 |
-
class GlobTest extends TestCase
|
18 |
-
{
|
19 |
-
public function testGlobToRegexDelimiters()
|
20 |
-
{
|
21 |
-
$this->assertEquals('#^(?=[^\.])\#$#', Glob::toRegex('#'));
|
22 |
-
$this->assertEquals('#^\.[^/]*$#', Glob::toRegex('.*'));
|
23 |
-
$this->assertEquals('^\.[^/]*$', Glob::toRegex('.*', true, true, ''));
|
24 |
-
$this->assertEquals('/^\.[^/]*$/', Glob::toRegex('.*', true, true, '/'));
|
25 |
-
}
|
26 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/GnuFinderTest.php
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests;
|
13 |
-
|
14 |
-
use Symfony\Component\Finder\Adapter\GnuFindAdapter;
|
15 |
-
use Symfony\Component\Finder\Finder;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* @group legacy
|
19 |
-
*/
|
20 |
-
class GnuFinderTest extends FinderTest
|
21 |
-
{
|
22 |
-
public function testSymlinksNotResolved()
|
23 |
-
{
|
24 |
-
$this->markTestSkipped('Symlinks are always resolved using the GnuFinderAdapter.');
|
25 |
-
}
|
26 |
-
|
27 |
-
public function testBackPathNotNormalized()
|
28 |
-
{
|
29 |
-
$this->markTestSkipped('Paths are always normalized using the GnuFinderAdapter.');
|
30 |
-
}
|
31 |
-
|
32 |
-
protected function buildFinder()
|
33 |
-
{
|
34 |
-
$adapter = new GnuFindAdapter();
|
35 |
-
|
36 |
-
if (!$adapter->isSupported()) {
|
37 |
-
$this->markTestSkipped(\get_class($adapter).' is not supported.');
|
38 |
-
}
|
39 |
-
|
40 |
-
return Finder::create()
|
41 |
-
->removeAdapters()
|
42 |
-
->addAdapter($adapter);
|
43 |
-
}
|
44 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Iterator/CustomFilterIteratorTest.php
DELETED
@@ -1,46 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Iterator;
|
13 |
-
|
14 |
-
use Symfony\Component\Finder\Iterator\CustomFilterIterator;
|
15 |
-
|
16 |
-
class CustomFilterIteratorTest extends IteratorTestCase
|
17 |
-
{
|
18 |
-
/**
|
19 |
-
* @expectedException \InvalidArgumentException
|
20 |
-
*/
|
21 |
-
public function testWithInvalidFilter()
|
22 |
-
{
|
23 |
-
new CustomFilterIterator(new Iterator(), array('foo'));
|
24 |
-
}
|
25 |
-
|
26 |
-
/**
|
27 |
-
* @dataProvider getAcceptData
|
28 |
-
*/
|
29 |
-
public function testAccept($filters, $expected)
|
30 |
-
{
|
31 |
-
$inner = new Iterator(array('test.php', 'test.py', 'foo.php'));
|
32 |
-
|
33 |
-
$iterator = new CustomFilterIterator($inner, $filters);
|
34 |
-
|
35 |
-
$this->assertIterator($expected, $iterator);
|
36 |
-
}
|
37 |
-
|
38 |
-
public function getAcceptData()
|
39 |
-
{
|
40 |
-
return array(
|
41 |
-
array(array(function (\SplFileInfo $fileinfo) { return false; }), array()),
|
42 |
-
array(array(function (\SplFileInfo $fileinfo) { return 0 === strpos($fileinfo, 'test'); }), array('test.php', 'test.py')),
|
43 |
-
array(array('is_dir'), array()),
|
44 |
-
);
|
45 |
-
}
|
46 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Iterator/DateRangeFilterIteratorTest.php
DELETED
@@ -1,74 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Iterator;
|
13 |
-
|
14 |
-
use Symfony\Component\Finder\Comparator\DateComparator;
|
15 |
-
use Symfony\Component\Finder\Iterator\DateRangeFilterIterator;
|
16 |
-
|
17 |
-
class DateRangeFilterIteratorTest extends RealIteratorTestCase
|
18 |
-
{
|
19 |
-
/**
|
20 |
-
* @dataProvider getAcceptData
|
21 |
-
*/
|
22 |
-
public function testAccept($size, $expected)
|
23 |
-
{
|
24 |
-
$files = self::$files;
|
25 |
-
$files[] = self::toAbsolute('doesnotexist');
|
26 |
-
$inner = new Iterator($files);
|
27 |
-
|
28 |
-
$iterator = new DateRangeFilterIterator($inner, $size);
|
29 |
-
|
30 |
-
$this->assertIterator($expected, $iterator);
|
31 |
-
}
|
32 |
-
|
33 |
-
public function getAcceptData()
|
34 |
-
{
|
35 |
-
$since20YearsAgo = array(
|
36 |
-
'.git',
|
37 |
-
'test.py',
|
38 |
-
'foo',
|
39 |
-
'foo/bar.tmp',
|
40 |
-
'test.php',
|
41 |
-
'toto',
|
42 |
-
'toto/.git',
|
43 |
-
'.bar',
|
44 |
-
'.foo',
|
45 |
-
'.foo/.bar',
|
46 |
-
'foo bar',
|
47 |
-
'.foo/bar',
|
48 |
-
);
|
49 |
-
|
50 |
-
$since2MonthsAgo = array(
|
51 |
-
'.git',
|
52 |
-
'test.py',
|
53 |
-
'foo',
|
54 |
-
'toto',
|
55 |
-
'toto/.git',
|
56 |
-
'.bar',
|
57 |
-
'.foo',
|
58 |
-
'.foo/.bar',
|
59 |
-
'foo bar',
|
60 |
-
'.foo/bar',
|
61 |
-
);
|
62 |
-
|
63 |
-
$untilLastMonth = array(
|
64 |
-
'foo/bar.tmp',
|
65 |
-
'test.php',
|
66 |
-
);
|
67 |
-
|
68 |
-
return array(
|
69 |
-
array(array(new DateComparator('since 20 years ago')), $this->toAbsolute($since20YearsAgo)),
|
70 |
-
array(array(new DateComparator('since 2 months ago')), $this->toAbsolute($since2MonthsAgo)),
|
71 |
-
array(array(new DateComparator('until last month')), $this->toAbsolute($untilLastMonth)),
|
72 |
-
);
|
73 |
-
}
|
74 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Iterator/DepthRangeFilterIteratorTest.php
DELETED
@@ -1,83 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Iterator;
|
13 |
-
|
14 |
-
use Symfony\Component\Finder\Iterator\DepthRangeFilterIterator;
|
15 |
-
|
16 |
-
class DepthRangeFilterIteratorTest extends RealIteratorTestCase
|
17 |
-
{
|
18 |
-
/**
|
19 |
-
* @dataProvider getAcceptData
|
20 |
-
*/
|
21 |
-
public function testAccept($minDepth, $maxDepth, $expected)
|
22 |
-
{
|
23 |
-
$inner = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->toAbsolute(), \FilesystemIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST);
|
24 |
-
|
25 |
-
$iterator = new DepthRangeFilterIterator($inner, $minDepth, $maxDepth);
|
26 |
-
|
27 |
-
$actual = array_keys(iterator_to_array($iterator));
|
28 |
-
sort($expected);
|
29 |
-
sort($actual);
|
30 |
-
$this->assertEquals($expected, $actual);
|
31 |
-
}
|
32 |
-
|
33 |
-
public function getAcceptData()
|
34 |
-
{
|
35 |
-
$lessThan1 = array(
|
36 |
-
'.git',
|
37 |
-
'test.py',
|
38 |
-
'foo',
|
39 |
-
'test.php',
|
40 |
-
'toto',
|
41 |
-
'.foo',
|
42 |
-
'.bar',
|
43 |
-
'foo bar',
|
44 |
-
);
|
45 |
-
|
46 |
-
$lessThanOrEqualTo1 = array(
|
47 |
-
'.git',
|
48 |
-
'test.py',
|
49 |
-
'foo',
|
50 |
-
'foo/bar.tmp',
|
51 |
-
'test.php',
|
52 |
-
'toto',
|
53 |
-
'toto/.git',
|
54 |
-
'.foo',
|
55 |
-
'.foo/.bar',
|
56 |
-
'.bar',
|
57 |
-
'foo bar',
|
58 |
-
'.foo/bar',
|
59 |
-
);
|
60 |
-
|
61 |
-
$graterThanOrEqualTo1 = array(
|
62 |
-
'toto/.git',
|
63 |
-
'foo/bar.tmp',
|
64 |
-
'.foo/.bar',
|
65 |
-
'.foo/bar',
|
66 |
-
);
|
67 |
-
|
68 |
-
$equalTo1 = array(
|
69 |
-
'toto/.git',
|
70 |
-
'foo/bar.tmp',
|
71 |
-
'.foo/.bar',
|
72 |
-
'.foo/bar',
|
73 |
-
);
|
74 |
-
|
75 |
-
return array(
|
76 |
-
array(0, 0, $this->toAbsolute($lessThan1)),
|
77 |
-
array(0, 1, $this->toAbsolute($lessThanOrEqualTo1)),
|
78 |
-
array(2, PHP_INT_MAX, array()),
|
79 |
-
array(1, PHP_INT_MAX, $this->toAbsolute($graterThanOrEqualTo1)),
|
80 |
-
array(1, 1, $this->toAbsolute($equalTo1)),
|
81 |
-
);
|
82 |
-
}
|
83 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Iterator/ExcludeDirectoryFilterIteratorTest.php
DELETED
@@ -1,80 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Iterator;
|
13 |
-
|
14 |
-
use Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator;
|
15 |
-
use Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator;
|
16 |
-
|
17 |
-
class ExcludeDirectoryFilterIteratorTest extends RealIteratorTestCase
|
18 |
-
{
|
19 |
-
/**
|
20 |
-
* @dataProvider getAcceptData
|
21 |
-
*/
|
22 |
-
public function testAccept($directories, $expected)
|
23 |
-
{
|
24 |
-
$inner = new \RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->toAbsolute(), \FilesystemIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST);
|
25 |
-
|
26 |
-
$iterator = new ExcludeDirectoryFilterIterator($inner, $directories);
|
27 |
-
|
28 |
-
$this->assertIterator($expected, $iterator);
|
29 |
-
}
|
30 |
-
|
31 |
-
public function getAcceptData()
|
32 |
-
{
|
33 |
-
$foo = array(
|
34 |
-
'.bar',
|
35 |
-
'.foo',
|
36 |
-
'.foo/.bar',
|
37 |
-
'.foo/bar',
|
38 |
-
'.git',
|
39 |
-
'test.py',
|
40 |
-
'test.php',
|
41 |
-
'toto',
|
42 |
-
'toto/.git',
|
43 |
-
'foo bar',
|
44 |
-
);
|
45 |
-
|
46 |
-
$fo = array(
|
47 |
-
'.bar',
|
48 |
-
'.foo',
|
49 |
-
'.foo/.bar',
|
50 |
-
'.foo/bar',
|
51 |
-
'.git',
|
52 |
-
'test.py',
|
53 |
-
'foo',
|
54 |
-
'foo/bar.tmp',
|
55 |
-
'test.php',
|
56 |
-
'toto',
|
57 |
-
'toto/.git',
|
58 |
-
'foo bar',
|
59 |
-
);
|
60 |
-
|
61 |
-
$toto = array(
|
62 |
-
'.bar',
|
63 |
-
'.foo',
|
64 |
-
'.foo/.bar',
|
65 |
-
'.foo/bar',
|
66 |
-
'.git',
|
67 |
-
'test.py',
|
68 |
-
'foo',
|
69 |
-
'foo/bar.tmp',
|
70 |
-
'test.php',
|
71 |
-
'foo bar',
|
72 |
-
);
|
73 |
-
|
74 |
-
return array(
|
75 |
-
array(array('foo'), $this->toAbsolute($foo)),
|
76 |
-
array(array('fo'), $this->toAbsolute($fo)),
|
77 |
-
array(array('toto/'), $this->toAbsolute($toto)),
|
78 |
-
);
|
79 |
-
}
|
80 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Iterator/FilePathsIteratorTest.php
DELETED
@@ -1,72 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Iterator;
|
13 |
-
|
14 |
-
use Symfony\Component\Finder\Iterator\FilePathsIterator;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* @group legacy
|
18 |
-
*/
|
19 |
-
class FilePathsIteratorTest extends RealIteratorTestCase
|
20 |
-
{
|
21 |
-
/**
|
22 |
-
* @dataProvider getSubPathData
|
23 |
-
*/
|
24 |
-
public function testSubPath($baseDir, array $paths, array $subPaths, array $subPathnames)
|
25 |
-
{
|
26 |
-
$iterator = new FilePathsIterator($paths, $baseDir);
|
27 |
-
|
28 |
-
foreach ($iterator as $index => $file) {
|
29 |
-
$this->assertEquals($paths[$index], $file->getPathname());
|
30 |
-
$this->assertEquals($subPaths[$index], $iterator->getSubPath());
|
31 |
-
$this->assertEquals($subPathnames[$index], $iterator->getSubPathname());
|
32 |
-
}
|
33 |
-
}
|
34 |
-
|
35 |
-
public function getSubPathData()
|
36 |
-
{
|
37 |
-
$tmpDir = sys_get_temp_dir().'/symfony_finder';
|
38 |
-
|
39 |
-
return array(
|
40 |
-
array(
|
41 |
-
$tmpDir,
|
42 |
-
array(
|
43 |
-
// paths
|
44 |
-
$tmpDir.\DIRECTORY_SEPARATOR.'.git' => $tmpDir.\DIRECTORY_SEPARATOR.'.git',
|
45 |
-
$tmpDir.\DIRECTORY_SEPARATOR.'test.py' => $tmpDir.\DIRECTORY_SEPARATOR.'test.py',
|
46 |
-
$tmpDir.\DIRECTORY_SEPARATOR.'foo' => $tmpDir.\DIRECTORY_SEPARATOR.'foo',
|
47 |
-
$tmpDir.\DIRECTORY_SEPARATOR.'foo'.\DIRECTORY_SEPARATOR.'bar.tmp' => $tmpDir.\DIRECTORY_SEPARATOR.'foo'.\DIRECTORY_SEPARATOR.'bar.tmp',
|
48 |
-
$tmpDir.\DIRECTORY_SEPARATOR.'test.php' => $tmpDir.\DIRECTORY_SEPARATOR.'test.php',
|
49 |
-
$tmpDir.\DIRECTORY_SEPARATOR.'toto' => $tmpDir.\DIRECTORY_SEPARATOR.'toto',
|
50 |
-
),
|
51 |
-
array(
|
52 |
-
// subPaths
|
53 |
-
$tmpDir.\DIRECTORY_SEPARATOR.'.git' => '',
|
54 |
-
$tmpDir.\DIRECTORY_SEPARATOR.'test.py' => '',
|
55 |
-
$tmpDir.\DIRECTORY_SEPARATOR.'foo' => '',
|
56 |
-
$tmpDir.\DIRECTORY_SEPARATOR.'foo'.\DIRECTORY_SEPARATOR.'bar.tmp' => 'foo',
|
57 |
-
$tmpDir.\DIRECTORY_SEPARATOR.'test.php' => '',
|
58 |
-
$tmpDir.\DIRECTORY_SEPARATOR.'toto' => '',
|
59 |
-
),
|
60 |
-
array(
|
61 |
-
// subPathnames
|
62 |
-
$tmpDir.\DIRECTORY_SEPARATOR.'.git' => '.git',
|
63 |
-
$tmpDir.\DIRECTORY_SEPARATOR.'test.py' => 'test.py',
|
64 |
-
$tmpDir.\DIRECTORY_SEPARATOR.'foo' => 'foo',
|
65 |
-
$tmpDir.\DIRECTORY_SEPARATOR.'foo'.\DIRECTORY_SEPARATOR.'bar.tmp' => 'foo'.\DIRECTORY_SEPARATOR.'bar.tmp',
|
66 |
-
$tmpDir.\DIRECTORY_SEPARATOR.'test.php' => 'test.php',
|
67 |
-
$tmpDir.\DIRECTORY_SEPARATOR.'toto' => 'toto',
|
68 |
-
),
|
69 |
-
),
|
70 |
-
);
|
71 |
-
}
|
72 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Iterator/FileTypeFilterIteratorTest.php
DELETED
@@ -1,73 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Iterator;
|
13 |
-
|
14 |
-
use Symfony\Component\Finder\Iterator\FileTypeFilterIterator;
|
15 |
-
|
16 |
-
class FileTypeFilterIteratorTest extends RealIteratorTestCase
|
17 |
-
{
|
18 |
-
/**
|
19 |
-
* @dataProvider getAcceptData
|
20 |
-
*/
|
21 |
-
public function testAccept($mode, $expected)
|
22 |
-
{
|
23 |
-
$inner = new InnerTypeIterator(self::$files);
|
24 |
-
|
25 |
-
$iterator = new FileTypeFilterIterator($inner, $mode);
|
26 |
-
|
27 |
-
$this->assertIterator($expected, $iterator);
|
28 |
-
}
|
29 |
-
|
30 |
-
public function getAcceptData()
|
31 |
-
{
|
32 |
-
$onlyFiles = array(
|
33 |
-
'test.py',
|
34 |
-
'foo/bar.tmp',
|
35 |
-
'test.php',
|
36 |
-
'.bar',
|
37 |
-
'.foo/.bar',
|
38 |
-
'.foo/bar',
|
39 |
-
'foo bar',
|
40 |
-
);
|
41 |
-
|
42 |
-
$onlyDirectories = array(
|
43 |
-
'.git',
|
44 |
-
'foo',
|
45 |
-
'toto',
|
46 |
-
'toto/.git',
|
47 |
-
'.foo',
|
48 |
-
);
|
49 |
-
|
50 |
-
return array(
|
51 |
-
array(FileTypeFilterIterator::ONLY_FILES, $this->toAbsolute($onlyFiles)),
|
52 |
-
array(FileTypeFilterIterator::ONLY_DIRECTORIES, $this->toAbsolute($onlyDirectories)),
|
53 |
-
);
|
54 |
-
}
|
55 |
-
}
|
56 |
-
|
57 |
-
class InnerTypeIterator extends \ArrayIterator
|
58 |
-
{
|
59 |
-
public function current()
|
60 |
-
{
|
61 |
-
return new \SplFileInfo(parent::current());
|
62 |
-
}
|
63 |
-
|
64 |
-
public function isFile()
|
65 |
-
{
|
66 |
-
return $this->current()->isFile();
|
67 |
-
}
|
68 |
-
|
69 |
-
public function isDir()
|
70 |
-
{
|
71 |
-
return $this->current()->isDir();
|
72 |
-
}
|
73 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Iterator/FilecontentFilterIteratorTest.php
DELETED
@@ -1,86 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Iterator;
|
13 |
-
|
14 |
-
use Symfony\Component\Finder\Iterator\FilecontentFilterIterator;
|
15 |
-
|
16 |
-
class FilecontentFilterIteratorTest extends IteratorTestCase
|
17 |
-
{
|
18 |
-
public function testAccept()
|
19 |
-
{
|
20 |
-
$inner = new MockFileListIterator(array('test.txt'));
|
21 |
-
$iterator = new FilecontentFilterIterator($inner, array(), array());
|
22 |
-
$this->assertIterator(array('test.txt'), $iterator);
|
23 |
-
}
|
24 |
-
|
25 |
-
public function testDirectory()
|
26 |
-
{
|
27 |
-
$inner = new MockFileListIterator(array('directory'));
|
28 |
-
$iterator = new FilecontentFilterIterator($inner, array('directory'), array());
|
29 |
-
$this->assertIterator(array(), $iterator);
|
30 |
-
}
|
31 |
-
|
32 |
-
public function testUnreadableFile()
|
33 |
-
{
|
34 |
-
$inner = new MockFileListIterator(array('file r-'));
|
35 |
-
$iterator = new FilecontentFilterIterator($inner, array('file r-'), array());
|
36 |
-
$this->assertIterator(array(), $iterator);
|
37 |
-
}
|
38 |
-
|
39 |
-
/**
|
40 |
-
* @dataProvider getTestFilterData
|
41 |
-
*/
|
42 |
-
public function testFilter(\Iterator $inner, array $matchPatterns, array $noMatchPatterns, array $resultArray)
|
43 |
-
{
|
44 |
-
$iterator = new FilecontentFilterIterator($inner, $matchPatterns, $noMatchPatterns);
|
45 |
-
$this->assertIterator($resultArray, $iterator);
|
46 |
-
}
|
47 |
-
|
48 |
-
public function getTestFilterData()
|
49 |
-
{
|
50 |
-
$inner = new MockFileListIterator();
|
51 |
-
|
52 |
-
$inner[] = new MockSplFileInfo(array(
|
53 |
-
'name' => 'a.txt',
|
54 |
-
'contents' => 'Lorem ipsum...',
|
55 |
-
'type' => 'file',
|
56 |
-
'mode' => 'r+', )
|
57 |
-
);
|
58 |
-
|
59 |
-
$inner[] = new MockSplFileInfo(array(
|
60 |
-
'name' => 'b.yml',
|
61 |
-
'contents' => 'dolor sit...',
|
62 |
-
'type' => 'file',
|
63 |
-
'mode' => 'r+', )
|
64 |
-
);
|
65 |
-
|
66 |
-
$inner[] = new MockSplFileInfo(array(
|
67 |
-
'name' => 'some/other/dir/third.php',
|
68 |
-
'contents' => 'amet...',
|
69 |
-
'type' => 'file',
|
70 |
-
'mode' => 'r+', )
|
71 |
-
);
|
72 |
-
|
73 |
-
$inner[] = new MockSplFileInfo(array(
|
74 |
-
'name' => 'unreadable-file.txt',
|
75 |
-
'contents' => false,
|
76 |
-
'type' => 'file',
|
77 |
-
'mode' => 'r+', )
|
78 |
-
);
|
79 |
-
|
80 |
-
return array(
|
81 |
-
array($inner, array('.'), array(), array('a.txt', 'b.yml', 'some/other/dir/third.php')),
|
82 |
-
array($inner, array('ipsum'), array(), array('a.txt')),
|
83 |
-
array($inner, array('i', 'amet'), array('Lorem', 'amet'), array('b.yml')),
|
84 |
-
);
|
85 |
-
}
|
86 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Iterator/FilenameFilterIteratorTest.php
DELETED
@@ -1,54 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Iterator;
|
13 |
-
|
14 |
-
use Symfony\Component\Finder\Iterator\FilenameFilterIterator;
|
15 |
-
|
16 |
-
class FilenameFilterIteratorTest extends IteratorTestCase
|
17 |
-
{
|
18 |
-
/**
|
19 |
-
* @dataProvider getAcceptData
|
20 |
-
*/
|
21 |
-
public function testAccept($matchPatterns, $noMatchPatterns, $expected)
|
22 |
-
{
|
23 |
-
$inner = new InnerNameIterator(array('test.php', 'test.py', 'foo.php'));
|
24 |
-
|
25 |
-
$iterator = new FilenameFilterIterator($inner, $matchPatterns, $noMatchPatterns);
|
26 |
-
|
27 |
-
$this->assertIterator($expected, $iterator);
|
28 |
-
}
|
29 |
-
|
30 |
-
public function getAcceptData()
|
31 |
-
{
|
32 |
-
return array(
|
33 |
-
array(array('test.*'), array(), array('test.php', 'test.py')),
|
34 |
-
array(array(), array('test.*'), array('foo.php')),
|
35 |
-
array(array('*.php'), array('test.*'), array('foo.php')),
|
36 |
-
array(array('*.php', '*.py'), array('foo.*'), array('test.php', 'test.py')),
|
37 |
-
array(array('/\.php$/'), array(), array('test.php', 'foo.php')),
|
38 |
-
array(array(), array('/\.php$/'), array('test.py')),
|
39 |
-
);
|
40 |
-
}
|
41 |
-
}
|
42 |
-
|
43 |
-
class InnerNameIterator extends \ArrayIterator
|
44 |
-
{
|
45 |
-
public function current()
|
46 |
-
{
|
47 |
-
return new \SplFileInfo(parent::current());
|
48 |
-
}
|
49 |
-
|
50 |
-
public function getFilename()
|
51 |
-
{
|
52 |
-
return parent::current();
|
53 |
-
}
|
54 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Iterator/FilterIteratorTest.php
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Iterator;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* @author Alex Bogomazov
|
16 |
-
*/
|
17 |
-
class FilterIteratorTest extends RealIteratorTestCase
|
18 |
-
{
|
19 |
-
public function testFilterFilesystemIterators()
|
20 |
-
{
|
21 |
-
$i = new \FilesystemIterator($this->toAbsolute());
|
22 |
-
|
23 |
-
// it is expected that there are test.py test.php in the tmpDir
|
24 |
-
$i = $this->getMockForAbstractClass('Symfony\Component\Finder\Iterator\FilterIterator', array($i));
|
25 |
-
$i->expects($this->any())
|
26 |
-
->method('accept')
|
27 |
-
->will($this->returnCallback(function () use ($i) {
|
28 |
-
return (bool) preg_match('/\.php/', (string) $i->current());
|
29 |
-
})
|
30 |
-
);
|
31 |
-
|
32 |
-
$c = 0;
|
33 |
-
foreach ($i as $item) {
|
34 |
-
++$c;
|
35 |
-
}
|
36 |
-
|
37 |
-
$this->assertEquals(1, $c);
|
38 |
-
|
39 |
-
$i->rewind();
|
40 |
-
|
41 |
-
$c = 0;
|
42 |
-
foreach ($i as $item) {
|
43 |
-
++$c;
|
44 |
-
}
|
45 |
-
|
46 |
-
// This would fail in php older than 5.5.23/5.6.7 with \FilterIterator
|
47 |
-
// but works with Symfony\Component\Finder\Iterator\FilterIterator
|
48 |
-
// see https://bugs.php.net/68557
|
49 |
-
$this->assertEquals(1, $c);
|
50 |
-
}
|
51 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Iterator/Iterator.php
DELETED
@@ -1,55 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Iterator;
|
13 |
-
|
14 |
-
class Iterator implements \Iterator
|
15 |
-
{
|
16 |
-
protected $values = array();
|
17 |
-
|
18 |
-
public function __construct(array $values = array())
|
19 |
-
{
|
20 |
-
foreach ($values as $value) {
|
21 |
-
$this->attach(new \SplFileInfo($value));
|
22 |
-
}
|
23 |
-
$this->rewind();
|
24 |
-
}
|
25 |
-
|
26 |
-
public function attach(\SplFileInfo $fileinfo)
|
27 |
-
{
|
28 |
-
$this->values[] = $fileinfo;
|
29 |
-
}
|
30 |
-
|
31 |
-
public function rewind()
|
32 |
-
{
|
33 |
-
reset($this->values);
|
34 |
-
}
|
35 |
-
|
36 |
-
public function valid()
|
37 |
-
{
|
38 |
-
return false !== $this->current();
|
39 |
-
}
|
40 |
-
|
41 |
-
public function next()
|
42 |
-
{
|
43 |
-
next($this->values);
|
44 |
-
}
|
45 |
-
|
46 |
-
public function current()
|
47 |
-
{
|
48 |
-
return current($this->values);
|
49 |
-
}
|
50 |
-
|
51 |
-
public function key()
|
52 |
-
{
|
53 |
-
return key($this->values);
|
54 |
-
}
|
55 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Iterator/IteratorTestCase.php
DELETED
@@ -1,100 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Iterator;
|
13 |
-
|
14 |
-
use PHPUnit\Framework\TestCase;
|
15 |
-
|
16 |
-
abstract class IteratorTestCase extends TestCase
|
17 |
-
{
|
18 |
-
protected function assertIterator($expected, \Traversable $iterator)
|
19 |
-
{
|
20 |
-
// set iterator_to_array $use_key to false to avoid values merge
|
21 |
-
// this made FinderTest::testAppendWithAnArray() fail with GnuFinderAdapter
|
22 |
-
$values = array_map(function (\SplFileInfo $fileinfo) { return str_replace('/', \DIRECTORY_SEPARATOR, $fileinfo->getPathname()); }, iterator_to_array($iterator, false));
|
23 |
-
|
24 |
-
$expected = array_map(function ($path) { return str_replace('/', \DIRECTORY_SEPARATOR, $path); }, $expected);
|
25 |
-
|
26 |
-
sort($values);
|
27 |
-
sort($expected);
|
28 |
-
|
29 |
-
$this->assertEquals($expected, array_values($values));
|
30 |
-
}
|
31 |
-
|
32 |
-
protected function assertOrderedIterator($expected, \Traversable $iterator)
|
33 |
-
{
|
34 |
-
$values = array_map(function (\SplFileInfo $fileinfo) { return $fileinfo->getPathname(); }, iterator_to_array($iterator));
|
35 |
-
|
36 |
-
$this->assertEquals($expected, array_values($values));
|
37 |
-
}
|
38 |
-
|
39 |
-
/**
|
40 |
-
* Same as assertOrderedIterator, but checks the order of groups of
|
41 |
-
* array elements.
|
42 |
-
*
|
43 |
-
* @param array $expected - an array of arrays. For any two subarrays
|
44 |
-
* $a and $b such that $a goes before $b in $expected, the method
|
45 |
-
* asserts that any element of $a goes before any element of $b
|
46 |
-
* in the sequence generated by $iterator
|
47 |
-
* @param \Traversable $iterator
|
48 |
-
*/
|
49 |
-
protected function assertOrderedIteratorForGroups($expected, \Traversable $iterator)
|
50 |
-
{
|
51 |
-
$values = array_values(array_map(function (\SplFileInfo $fileinfo) { return $fileinfo->getPathname(); }, iterator_to_array($iterator)));
|
52 |
-
|
53 |
-
foreach ($expected as $subarray) {
|
54 |
-
$temp = array();
|
55 |
-
while (\count($values) && \count($temp) < \count($subarray)) {
|
56 |
-
$temp[] = array_shift($values);
|
57 |
-
}
|
58 |
-
sort($temp);
|
59 |
-
sort($subarray);
|
60 |
-
$this->assertEquals($subarray, $temp);
|
61 |
-
}
|
62 |
-
}
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Same as IteratorTestCase::assertIterator with foreach usage.
|
66 |
-
*
|
67 |
-
* @param array $expected
|
68 |
-
* @param \Traversable $iterator
|
69 |
-
*/
|
70 |
-
protected function assertIteratorInForeach($expected, \Traversable $iterator)
|
71 |
-
{
|
72 |
-
$values = array();
|
73 |
-
foreach ($iterator as $file) {
|
74 |
-
$this->assertInstanceOf('Symfony\\Component\\Finder\\SplFileInfo', $file);
|
75 |
-
$values[] = $file->getPathname();
|
76 |
-
}
|
77 |
-
|
78 |
-
sort($values);
|
79 |
-
sort($expected);
|
80 |
-
|
81 |
-
$this->assertEquals($expected, array_values($values));
|
82 |
-
}
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Same as IteratorTestCase::assertOrderedIterator with foreach usage.
|
86 |
-
*
|
87 |
-
* @param array $expected
|
88 |
-
* @param \Traversable $iterator
|
89 |
-
*/
|
90 |
-
protected function assertOrderedIteratorInForeach($expected, \Traversable $iterator)
|
91 |
-
{
|
92 |
-
$values = array();
|
93 |
-
foreach ($iterator as $file) {
|
94 |
-
$this->assertInstanceOf('Symfony\\Component\\Finder\\SplFileInfo', $file);
|
95 |
-
$values[] = $file->getPathname();
|
96 |
-
}
|
97 |
-
|
98 |
-
$this->assertEquals($expected, array_values($values));
|
99 |
-
}
|
100 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Iterator/MockFileListIterator.php
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Iterator;
|
13 |
-
|
14 |
-
class MockFileListIterator extends \ArrayIterator
|
15 |
-
{
|
16 |
-
public function __construct(array $filesArray = array())
|
17 |
-
{
|
18 |
-
$files = array_map(function ($file) { return new MockSplFileInfo($file); }, $filesArray);
|
19 |
-
parent::__construct($files);
|
20 |
-
}
|
21 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Iterator/MockSplFileInfo.php
DELETED
@@ -1,132 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Iterator;
|
13 |
-
|
14 |
-
class MockSplFileInfo extends \SplFileInfo
|
15 |
-
{
|
16 |
-
const TYPE_DIRECTORY = 1;
|
17 |
-
const TYPE_FILE = 2;
|
18 |
-
const TYPE_UNKNOWN = 3;
|
19 |
-
|
20 |
-
private $contents = null;
|
21 |
-
private $mode = null;
|
22 |
-
private $type = null;
|
23 |
-
private $relativePath = null;
|
24 |
-
private $relativePathname = null;
|
25 |
-
|
26 |
-
public function __construct($param)
|
27 |
-
{
|
28 |
-
if (\is_string($param)) {
|
29 |
-
parent::__construct($param);
|
30 |
-
} elseif (\is_array($param)) {
|
31 |
-
$defaults = array(
|
32 |
-
'name' => 'file.txt',
|
33 |
-
'contents' => null,
|
34 |
-
'mode' => null,
|
35 |
-
'type' => null,
|
36 |
-
'relativePath' => null,
|
37 |
-
'relativePathname' => null,
|
38 |
-
);
|
39 |
-
$defaults = array_merge($defaults, $param);
|
40 |
-
parent::__construct($defaults['name']);
|
41 |
-
$this->setContents($defaults['contents']);
|
42 |
-
$this->setMode($defaults['mode']);
|
43 |
-
$this->setType($defaults['type']);
|
44 |
-
$this->setRelativePath($defaults['relativePath']);
|
45 |
-
$this->setRelativePathname($defaults['relativePathname']);
|
46 |
-
} else {
|
47 |
-
throw new \RuntimeException(sprintf('Incorrect parameter "%s"', $param));
|
48 |
-
}
|
49 |
-
}
|
50 |
-
|
51 |
-
public function isFile()
|
52 |
-
{
|
53 |
-
if (null === $this->type) {
|
54 |
-
return false !== strpos($this->getFilename(), 'file');
|
55 |
-
}
|
56 |
-
|
57 |
-
return self::TYPE_FILE === $this->type;
|
58 |
-
}
|
59 |
-
|
60 |
-
public function isDir()
|
61 |
-
{
|
62 |
-
if (null === $this->type) {
|
63 |
-
return false !== strpos($this->getFilename(), 'directory');
|
64 |
-
}
|
65 |
-
|
66 |
-
return self::TYPE_DIRECTORY === $this->type;
|
67 |
-
}
|
68 |
-
|
69 |
-
public function isReadable()
|
70 |
-
{
|
71 |
-
if (null === $this->mode) {
|
72 |
-
return preg_match('/r\+/', $this->getFilename());
|
73 |
-
}
|
74 |
-
|
75 |
-
return preg_match('/r\+/', $this->mode);
|
76 |
-
}
|
77 |
-
|
78 |
-
public function getContents()
|
79 |
-
{
|
80 |
-
return $this->contents;
|
81 |
-
}
|
82 |
-
|
83 |
-
public function setContents($contents)
|
84 |
-
{
|
85 |
-
$this->contents = $contents;
|
86 |
-
}
|
87 |
-
|
88 |
-
public function setMode($mode)
|
89 |
-
{
|
90 |
-
$this->mode = $mode;
|
91 |
-
}
|
92 |
-
|
93 |
-
public function setType($type)
|
94 |
-
{
|
95 |
-
if (\is_string($type)) {
|
96 |
-
switch ($type) {
|
97 |
-
case 'directory':
|
98 |
-
case 'd':
|
99 |
-
$this->type = self::TYPE_DIRECTORY;
|
100 |
-
break;
|
101 |
-
case 'file':
|
102 |
-
case 'f':
|
103 |
-
$this->type = self::TYPE_FILE;
|
104 |
-
break;
|
105 |
-
default:
|
106 |
-
$this->type = self::TYPE_UNKNOWN;
|
107 |
-
}
|
108 |
-
} else {
|
109 |
-
$this->type = $type;
|
110 |
-
}
|
111 |
-
}
|
112 |
-
|
113 |
-
public function setRelativePath($relativePath)
|
114 |
-
{
|
115 |
-
$this->relativePath = $relativePath;
|
116 |
-
}
|
117 |
-
|
118 |
-
public function setRelativePathname($relativePathname)
|
119 |
-
{
|
120 |
-
$this->relativePathname = $relativePathname;
|
121 |
-
}
|
122 |
-
|
123 |
-
public function getRelativePath()
|
124 |
-
{
|
125 |
-
return $this->relativePath;
|
126 |
-
}
|
127 |
-
|
128 |
-
public function getRelativePathname()
|
129 |
-
{
|
130 |
-
return $this->relativePathname;
|
131 |
-
}
|
132 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Iterator/MultiplePcreFilterIteratorTest.php
DELETED
@@ -1,71 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Iterator;
|
13 |
-
|
14 |
-
use PHPUnit\Framework\TestCase;
|
15 |
-
use Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator;
|
16 |
-
|
17 |
-
class MultiplePcreFilterIteratorTest extends TestCase
|
18 |
-
{
|
19 |
-
/**
|
20 |
-
* @dataProvider getIsRegexFixtures
|
21 |
-
*/
|
22 |
-
public function testIsRegex($string, $isRegex, $message)
|
23 |
-
{
|
24 |
-
$testIterator = new TestMultiplePcreFilterIterator();
|
25 |
-
$this->assertEquals($isRegex, $testIterator->isRegex($string), $message);
|
26 |
-
}
|
27 |
-
|
28 |
-
public function getIsRegexFixtures()
|
29 |
-
{
|
30 |
-
return array(
|
31 |
-
array('foo', false, 'string'),
|
32 |
-
array(' foo ', false, '" " is not a valid delimiter'),
|
33 |
-
array('\\foo\\', false, '"\\" is not a valid delimiter'),
|
34 |
-
array('afooa', false, '"a" is not a valid delimiter'),
|
35 |
-
array('//', false, 'the pattern should contain at least 1 character'),
|
36 |
-
array('/a/', true, 'valid regex'),
|
37 |
-
array('/foo/', true, 'valid regex'),
|
38 |
-
array('/foo/i', true, 'valid regex with a single modifier'),
|
39 |
-
array('/foo/imsxu', true, 'valid regex with multiple modifiers'),
|
40 |
-
array('#foo#', true, '"#" is a valid delimiter'),
|
41 |
-
array('{foo}', true, '"{,}" is a valid delimiter pair'),
|
42 |
-
array('[foo]', true, '"[,]" is a valid delimiter pair'),
|
43 |
-
array('(foo)', true, '"(,)" is a valid delimiter pair'),
|
44 |
-
array('<foo>', true, '"<,>" is a valid delimiter pair'),
|
45 |
-
array('*foo.*', false, '"*" is not considered as a valid delimiter'),
|
46 |
-
array('?foo.?', false, '"?" is not considered as a valid delimiter'),
|
47 |
-
);
|
48 |
-
}
|
49 |
-
}
|
50 |
-
|
51 |
-
class TestMultiplePcreFilterIterator extends MultiplePcreFilterIterator
|
52 |
-
{
|
53 |
-
public function __construct()
|
54 |
-
{
|
55 |
-
}
|
56 |
-
|
57 |
-
public function accept()
|
58 |
-
{
|
59 |
-
throw new \BadFunctionCallException('Not implemented');
|
60 |
-
}
|
61 |
-
|
62 |
-
public function isRegex($str)
|
63 |
-
{
|
64 |
-
return parent::isRegex($str);
|
65 |
-
}
|
66 |
-
|
67 |
-
public function toRegex($str)
|
68 |
-
{
|
69 |
-
throw new \BadFunctionCallException('Not implemented');
|
70 |
-
}
|
71 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Iterator/PathFilterIteratorTest.php
DELETED
@@ -1,82 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Iterator;
|
13 |
-
|
14 |
-
use Symfony\Component\Finder\Iterator\PathFilterIterator;
|
15 |
-
|
16 |
-
class PathFilterIteratorTest extends IteratorTestCase
|
17 |
-
{
|
18 |
-
/**
|
19 |
-
* @dataProvider getTestFilterData
|
20 |
-
*/
|
21 |
-
public function testFilter(\Iterator $inner, array $matchPatterns, array $noMatchPatterns, array $resultArray)
|
22 |
-
{
|
23 |
-
$iterator = new PathFilterIterator($inner, $matchPatterns, $noMatchPatterns);
|
24 |
-
$this->assertIterator($resultArray, $iterator);
|
25 |
-
}
|
26 |
-
|
27 |
-
public function getTestFilterData()
|
28 |
-
{
|
29 |
-
$inner = new MockFileListIterator();
|
30 |
-
|
31 |
-
//PATH: A/B/C/abc.dat
|
32 |
-
$inner[] = new MockSplFileInfo(array(
|
33 |
-
'name' => 'abc.dat',
|
34 |
-
'relativePathname' => 'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C'.\DIRECTORY_SEPARATOR.'abc.dat',
|
35 |
-
));
|
36 |
-
|
37 |
-
//PATH: A/B/ab.dat
|
38 |
-
$inner[] = new MockSplFileInfo(array(
|
39 |
-
'name' => 'ab.dat',
|
40 |
-
'relativePathname' => 'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'ab.dat',
|
41 |
-
));
|
42 |
-
|
43 |
-
//PATH: A/a.dat
|
44 |
-
$inner[] = new MockSplFileInfo(array(
|
45 |
-
'name' => 'a.dat',
|
46 |
-
'relativePathname' => 'A'.\DIRECTORY_SEPARATOR.'a.dat',
|
47 |
-
));
|
48 |
-
|
49 |
-
//PATH: copy/A/B/C/abc.dat.copy
|
50 |
-
$inner[] = new MockSplFileInfo(array(
|
51 |
-
'name' => 'abc.dat.copy',
|
52 |
-
'relativePathname' => 'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C'.\DIRECTORY_SEPARATOR.'abc.dat',
|
53 |
-
));
|
54 |
-
|
55 |
-
//PATH: copy/A/B/ab.dat.copy
|
56 |
-
$inner[] = new MockSplFileInfo(array(
|
57 |
-
'name' => 'ab.dat.copy',
|
58 |
-
'relativePathname' => 'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'ab.dat',
|
59 |
-
));
|
60 |
-
|
61 |
-
//PATH: copy/A/a.dat.copy
|
62 |
-
$inner[] = new MockSplFileInfo(array(
|
63 |
-
'name' => 'a.dat.copy',
|
64 |
-
'relativePathname' => 'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'a.dat',
|
65 |
-
));
|
66 |
-
|
67 |
-
return array(
|
68 |
-
array($inner, array('/^A/'), array(), array('abc.dat', 'ab.dat', 'a.dat')),
|
69 |
-
array($inner, array('/^A\/B/'), array(), array('abc.dat', 'ab.dat')),
|
70 |
-
array($inner, array('/^A\/B\/C/'), array(), array('abc.dat')),
|
71 |
-
array($inner, array('/A\/B\/C/'), array(), array('abc.dat', 'abc.dat.copy')),
|
72 |
-
|
73 |
-
array($inner, array('A'), array(), array('abc.dat', 'ab.dat', 'a.dat', 'abc.dat.copy', 'ab.dat.copy', 'a.dat.copy')),
|
74 |
-
array($inner, array('A/B'), array(), array('abc.dat', 'ab.dat', 'abc.dat.copy', 'ab.dat.copy')),
|
75 |
-
array($inner, array('A/B/C'), array(), array('abc.dat', 'abc.dat.copy')),
|
76 |
-
|
77 |
-
array($inner, array('copy/A'), array(), array('abc.dat.copy', 'ab.dat.copy', 'a.dat.copy')),
|
78 |
-
array($inner, array('copy/A/B'), array(), array('abc.dat.copy', 'ab.dat.copy')),
|
79 |
-
array($inner, array('copy/A/B/C'), array(), array('abc.dat.copy')),
|
80 |
-
);
|
81 |
-
}
|
82 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Iterator/RealIteratorTestCase.php
DELETED
@@ -1,119 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Iterator;
|
13 |
-
|
14 |
-
abstract class RealIteratorTestCase extends IteratorTestCase
|
15 |
-
{
|
16 |
-
protected static $tmpDir;
|
17 |
-
protected static $files;
|
18 |
-
|
19 |
-
public static function setUpBeforeClass()
|
20 |
-
{
|
21 |
-
self::$tmpDir = realpath(sys_get_temp_dir()).\DIRECTORY_SEPARATOR.'symfony_finder';
|
22 |
-
|
23 |
-
self::$files = array(
|
24 |
-
'.git/',
|
25 |
-
'.foo/',
|
26 |
-
'.foo/.bar',
|
27 |
-
'.foo/bar',
|
28 |
-
'.bar',
|
29 |
-
'test.py',
|
30 |
-
'foo/',
|
31 |
-
'foo/bar.tmp',
|
32 |
-
'test.php',
|
33 |
-
'toto/',
|
34 |
-
'toto/.git/',
|
35 |
-
'foo bar',
|
36 |
-
);
|
37 |
-
|
38 |
-
self::$files = self::toAbsolute(self::$files);
|
39 |
-
|
40 |
-
if (is_dir(self::$tmpDir)) {
|
41 |
-
self::tearDownAfterClass();
|
42 |
-
} else {
|
43 |
-
mkdir(self::$tmpDir);
|
44 |
-
}
|
45 |
-
|
46 |
-
foreach (self::$files as $file) {
|
47 |
-
if (\DIRECTORY_SEPARATOR === $file[\strlen($file) - 1]) {
|
48 |
-
mkdir($file);
|
49 |
-
} else {
|
50 |
-
touch($file);
|
51 |
-
}
|
52 |
-
}
|
53 |
-
|
54 |
-
file_put_contents(self::toAbsolute('test.php'), str_repeat(' ', 800));
|
55 |
-
file_put_contents(self::toAbsolute('test.py'), str_repeat(' ', 2000));
|
56 |
-
|
57 |
-
touch(self::toAbsolute('foo/bar.tmp'), strtotime('2005-10-15'));
|
58 |
-
touch(self::toAbsolute('test.php'), strtotime('2005-10-15'));
|
59 |
-
}
|
60 |
-
|
61 |
-
public static function tearDownAfterClass()
|
62 |
-
{
|
63 |
-
$paths = new \RecursiveIteratorIterator(
|
64 |
-
new \RecursiveDirectoryIterator(self::$tmpDir, \RecursiveDirectoryIterator::SKIP_DOTS),
|
65 |
-
\RecursiveIteratorIterator::CHILD_FIRST
|
66 |
-
);
|
67 |
-
|
68 |
-
foreach ($paths as $path) {
|
69 |
-
if ($path->isDir()) {
|
70 |
-
if ($path->isLink()) {
|
71 |
-
@unlink($path);
|
72 |
-
} else {
|
73 |
-
@rmdir($path);
|
74 |
-
}
|
75 |
-
} else {
|
76 |
-
@unlink($path);
|
77 |
-
}
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
81 |
-
protected static function toAbsolute($files = null)
|
82 |
-
{
|
83 |
-
/*
|
84 |
-
* Without the call to setUpBeforeClass() property can be null.
|
85 |
-
*/
|
86 |
-
if (!self::$tmpDir) {
|
87 |
-
self::$tmpDir = realpath(sys_get_temp_dir()).\DIRECTORY_SEPARATOR.'symfony_finder';
|
88 |
-
}
|
89 |
-
|
90 |
-
if (\is_array($files)) {
|
91 |
-
$f = array();
|
92 |
-
foreach ($files as $file) {
|
93 |
-
if (\is_array($file)) {
|
94 |
-
$f[] = self::toAbsolute($file);
|
95 |
-
} else {
|
96 |
-
$f[] = self::$tmpDir.\DIRECTORY_SEPARATOR.str_replace('/', \DIRECTORY_SEPARATOR, $file);
|
97 |
-
}
|
98 |
-
}
|
99 |
-
|
100 |
-
return $f;
|
101 |
-
}
|
102 |
-
|
103 |
-
if (\is_string($files)) {
|
104 |
-
return self::$tmpDir.\DIRECTORY_SEPARATOR.str_replace('/', \DIRECTORY_SEPARATOR, $files);
|
105 |
-
}
|
106 |
-
|
107 |
-
return self::$tmpDir;
|
108 |
-
}
|
109 |
-
|
110 |
-
protected static function toAbsoluteFixtures($files)
|
111 |
-
{
|
112 |
-
$f = array();
|
113 |
-
foreach ($files as $file) {
|
114 |
-
$f[] = realpath(__DIR__.\DIRECTORY_SEPARATOR.'..'.\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR.$file);
|
115 |
-
}
|
116 |
-
|
117 |
-
return $f;
|
118 |
-
}
|
119 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php
DELETED
@@ -1,59 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Iterator;
|
13 |
-
|
14 |
-
use Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator;
|
15 |
-
|
16 |
-
class RecursiveDirectoryIteratorTest extends IteratorTestCase
|
17 |
-
{
|
18 |
-
/**
|
19 |
-
* @group network
|
20 |
-
*/
|
21 |
-
public function testRewindOnFtp()
|
22 |
-
{
|
23 |
-
try {
|
24 |
-
$i = new RecursiveDirectoryIterator('ftp://speedtest.tele2.net/', \RecursiveDirectoryIterator::SKIP_DOTS);
|
25 |
-
} catch (\UnexpectedValueException $e) {
|
26 |
-
$this->markTestSkipped('Unsupported stream "ftp".');
|
27 |
-
}
|
28 |
-
|
29 |
-
$i->rewind();
|
30 |
-
|
31 |
-
$this->assertTrue(true);
|
32 |
-
}
|
33 |
-
|
34 |
-
/**
|
35 |
-
* @group network
|
36 |
-
*/
|
37 |
-
public function testSeekOnFtp()
|
38 |
-
{
|
39 |
-
try {
|
40 |
-
$i = new RecursiveDirectoryIterator('ftp://speedtest.tele2.net/', \RecursiveDirectoryIterator::SKIP_DOTS);
|
41 |
-
} catch (\UnexpectedValueException $e) {
|
42 |
-
$this->markTestSkipped('Unsupported stream "ftp".');
|
43 |
-
}
|
44 |
-
|
45 |
-
$contains = array(
|
46 |
-
'ftp://speedtest.tele2.net'.\DIRECTORY_SEPARATOR.'1000GB.zip',
|
47 |
-
'ftp://speedtest.tele2.net'.\DIRECTORY_SEPARATOR.'100GB.zip',
|
48 |
-
);
|
49 |
-
$actual = array();
|
50 |
-
|
51 |
-
$i->seek(0);
|
52 |
-
$actual[] = $i->getPathname();
|
53 |
-
|
54 |
-
$i->seek(1);
|
55 |
-
$actual[] = $i->getPathname();
|
56 |
-
|
57 |
-
$this->assertEquals($contains, $actual);
|
58 |
-
}
|
59 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Iterator/SizeRangeFilterIteratorTest.php
DELETED
@@ -1,69 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Iterator;
|
13 |
-
|
14 |
-
use Symfony\Component\Finder\Comparator\NumberComparator;
|
15 |
-
use Symfony\Component\Finder\Iterator\SizeRangeFilterIterator;
|
16 |
-
|
17 |
-
class SizeRangeFilterIteratorTest extends RealIteratorTestCase
|
18 |
-
{
|
19 |
-
/**
|
20 |
-
* @dataProvider getAcceptData
|
21 |
-
*/
|
22 |
-
public function testAccept($size, $expected)
|
23 |
-
{
|
24 |
-
$inner = new InnerSizeIterator(self::$files);
|
25 |
-
|
26 |
-
$iterator = new SizeRangeFilterIterator($inner, $size);
|
27 |
-
|
28 |
-
$this->assertIterator($expected, $iterator);
|
29 |
-
}
|
30 |
-
|
31 |
-
public function getAcceptData()
|
32 |
-
{
|
33 |
-
$lessThan1KGreaterThan05K = array(
|
34 |
-
'.foo',
|
35 |
-
'.git',
|
36 |
-
'foo',
|
37 |
-
'test.php',
|
38 |
-
'toto',
|
39 |
-
'toto/.git',
|
40 |
-
);
|
41 |
-
|
42 |
-
return array(
|
43 |
-
array(array(new NumberComparator('< 1K'), new NumberComparator('> 0.5K')), $this->toAbsolute($lessThan1KGreaterThan05K)),
|
44 |
-
);
|
45 |
-
}
|
46 |
-
}
|
47 |
-
|
48 |
-
class InnerSizeIterator extends \ArrayIterator
|
49 |
-
{
|
50 |
-
public function current()
|
51 |
-
{
|
52 |
-
return new \SplFileInfo(parent::current());
|
53 |
-
}
|
54 |
-
|
55 |
-
public function getFilename()
|
56 |
-
{
|
57 |
-
return parent::current();
|
58 |
-
}
|
59 |
-
|
60 |
-
public function isFile()
|
61 |
-
{
|
62 |
-
return $this->current()->isFile();
|
63 |
-
}
|
64 |
-
|
65 |
-
public function getSize()
|
66 |
-
{
|
67 |
-
return $this->current()->getSize();
|
68 |
-
}
|
69 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Iterator/SortableIteratorTest.php
DELETED
@@ -1,183 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Iterator;
|
13 |
-
|
14 |
-
use Symfony\Component\Finder\Iterator\SortableIterator;
|
15 |
-
|
16 |
-
class SortableIteratorTest extends RealIteratorTestCase
|
17 |
-
{
|
18 |
-
public function testConstructor()
|
19 |
-
{
|
20 |
-
try {
|
21 |
-
new SortableIterator(new Iterator(array()), 'foobar');
|
22 |
-
$this->fail('__construct() throws an \InvalidArgumentException exception if the mode is not valid');
|
23 |
-
} catch (\Exception $e) {
|
24 |
-
$this->assertInstanceOf('InvalidArgumentException', $e, '__construct() throws an \InvalidArgumentException exception if the mode is not valid');
|
25 |
-
}
|
26 |
-
}
|
27 |
-
|
28 |
-
/**
|
29 |
-
* @dataProvider getAcceptData
|
30 |
-
*/
|
31 |
-
public function testAccept($mode, $expected)
|
32 |
-
{
|
33 |
-
if (!\is_callable($mode)) {
|
34 |
-
switch ($mode) {
|
35 |
-
case SortableIterator::SORT_BY_ACCESSED_TIME:
|
36 |
-
if ('\\' === \DIRECTORY_SEPARATOR) {
|
37 |
-
touch(self::toAbsolute('.git'));
|
38 |
-
} else {
|
39 |
-
file_get_contents(self::toAbsolute('.git'));
|
40 |
-
}
|
41 |
-
sleep(1);
|
42 |
-
file_get_contents(self::toAbsolute('.bar'));
|
43 |
-
break;
|
44 |
-
case SortableIterator::SORT_BY_CHANGED_TIME:
|
45 |
-
file_put_contents(self::toAbsolute('test.php'), 'foo');
|
46 |
-
sleep(1);
|
47 |
-
file_put_contents(self::toAbsolute('test.py'), 'foo');
|
48 |
-
break;
|
49 |
-
case SortableIterator::SORT_BY_MODIFIED_TIME:
|
50 |
-
file_put_contents(self::toAbsolute('test.php'), 'foo');
|
51 |
-
sleep(1);
|
52 |
-
file_put_contents(self::toAbsolute('test.py'), 'foo');
|
53 |
-
break;
|
54 |
-
}
|
55 |
-
}
|
56 |
-
|
57 |
-
$inner = new Iterator(self::$files);
|
58 |
-
|
59 |
-
$iterator = new SortableIterator($inner, $mode);
|
60 |
-
|
61 |
-
if (SortableIterator::SORT_BY_ACCESSED_TIME === $mode
|
62 |
-
|| SortableIterator::SORT_BY_CHANGED_TIME === $mode
|
63 |
-
|| SortableIterator::SORT_BY_MODIFIED_TIME === $mode
|
64 |
-
) {
|
65 |
-
if ('\\' === \DIRECTORY_SEPARATOR && SortableIterator::SORT_BY_MODIFIED_TIME !== $mode) {
|
66 |
-
$this->markTestSkipped('Sorting by atime or ctime is not supported on Windows');
|
67 |
-
}
|
68 |
-
$this->assertOrderedIteratorForGroups($expected, $iterator);
|
69 |
-
} else {
|
70 |
-
$this->assertOrderedIterator($expected, $iterator);
|
71 |
-
}
|
72 |
-
}
|
73 |
-
|
74 |
-
public function getAcceptData()
|
75 |
-
{
|
76 |
-
$sortByName = array(
|
77 |
-
'.bar',
|
78 |
-
'.foo',
|
79 |
-
'.foo/.bar',
|
80 |
-
'.foo/bar',
|
81 |
-
'.git',
|
82 |
-
'foo',
|
83 |
-
'foo bar',
|
84 |
-
'foo/bar.tmp',
|
85 |
-
'test.php',
|
86 |
-
'test.py',
|
87 |
-
'toto',
|
88 |
-
'toto/.git',
|
89 |
-
);
|
90 |
-
|
91 |
-
$sortByType = array(
|
92 |
-
'.foo',
|
93 |
-
'.git',
|
94 |
-
'foo',
|
95 |
-
'toto',
|
96 |
-
'toto/.git',
|
97 |
-
'.bar',
|
98 |
-
'.foo/.bar',
|
99 |
-
'.foo/bar',
|
100 |
-
'foo bar',
|
101 |
-
'foo/bar.tmp',
|
102 |
-
'test.php',
|
103 |
-
'test.py',
|
104 |
-
);
|
105 |
-
|
106 |
-
$customComparison = array(
|
107 |
-
'.bar',
|
108 |
-
'.foo',
|
109 |
-
'.foo/.bar',
|
110 |
-
'.foo/bar',
|
111 |
-
'.git',
|
112 |
-
'foo',
|
113 |
-
'foo bar',
|
114 |
-
'foo/bar.tmp',
|
115 |
-
'test.php',
|
116 |
-
'test.py',
|
117 |
-
'toto',
|
118 |
-
'toto/.git',
|
119 |
-
);
|
120 |
-
|
121 |
-
$sortByAccessedTime = array(
|
122 |
-
// For these two files the access time was set to 2005-10-15
|
123 |
-
array('foo/bar.tmp', 'test.php'),
|
124 |
-
// These files were created more or less at the same time
|
125 |
-
array(
|
126 |
-
'.git',
|
127 |
-
'.foo',
|
128 |
-
'.foo/.bar',
|
129 |
-
'.foo/bar',
|
130 |
-
'test.py',
|
131 |
-
'foo',
|
132 |
-
'toto',
|
133 |
-
'toto/.git',
|
134 |
-
'foo bar',
|
135 |
-
),
|
136 |
-
// This file was accessed after sleeping for 1 sec
|
137 |
-
array('.bar'),
|
138 |
-
);
|
139 |
-
|
140 |
-
$sortByChangedTime = array(
|
141 |
-
array(
|
142 |
-
'.git',
|
143 |
-
'.foo',
|
144 |
-
'.foo/.bar',
|
145 |
-
'.foo/bar',
|
146 |
-
'.bar',
|
147 |
-
'foo',
|
148 |
-
'foo/bar.tmp',
|
149 |
-
'toto',
|
150 |
-
'toto/.git',
|
151 |
-
'foo bar',
|
152 |
-
),
|
153 |
-
array('test.php'),
|
154 |
-
array('test.py'),
|
155 |
-
);
|
156 |
-
|
157 |
-
$sortByModifiedTime = array(
|
158 |
-
array(
|
159 |
-
'.git',
|
160 |
-
'.foo',
|
161 |
-
'.foo/.bar',
|
162 |
-
'.foo/bar',
|
163 |
-
'.bar',
|
164 |
-
'foo',
|
165 |
-
'foo/bar.tmp',
|
166 |
-
'toto',
|
167 |
-
'toto/.git',
|
168 |
-
'foo bar',
|
169 |
-
),
|
170 |
-
array('test.php'),
|
171 |
-
array('test.py'),
|
172 |
-
);
|
173 |
-
|
174 |
-
return array(
|
175 |
-
array(SortableIterator::SORT_BY_NAME, $this->toAbsolute($sortByName)),
|
176 |
-
array(SortableIterator::SORT_BY_TYPE, $this->toAbsolute($sortByType)),
|
177 |
-
array(SortableIterator::SORT_BY_ACCESSED_TIME, $this->toAbsolute($sortByAccessedTime)),
|
178 |
-
array(SortableIterator::SORT_BY_CHANGED_TIME, $this->toAbsolute($sortByChangedTime)),
|
179 |
-
array(SortableIterator::SORT_BY_MODIFIED_TIME, $this->toAbsolute($sortByModifiedTime)),
|
180 |
-
array(function (\SplFileInfo $a, \SplFileInfo $b) { return strcmp($a->getRealPath(), $b->getRealPath()); }, $this->toAbsolute($customComparison)),
|
181 |
-
);
|
182 |
-
}
|
183 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/PhpFinderTest.php
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests;
|
13 |
-
|
14 |
-
use Symfony\Component\Finder\Adapter\PhpAdapter;
|
15 |
-
use Symfony\Component\Finder\Finder;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* @group legacy
|
19 |
-
*/
|
20 |
-
class PhpFinderTest extends FinderTest
|
21 |
-
{
|
22 |
-
public function testImplementationsAreSynchronized()
|
23 |
-
{
|
24 |
-
$adapterReflector = new \ReflectionMethod('Symfony\Component\Finder\Adapter\PhpAdapter', 'searchInDirectory');
|
25 |
-
$finderReflector = new \ReflectionMethod('Symfony\Component\Finder\Finder', 'searchInDirectory');
|
26 |
-
|
27 |
-
$adapterSource = \array_slice(file($adapterReflector->getFileName()), $adapterReflector->getStartLine() + 1, $adapterReflector->getEndLine() - $adapterReflector->getStartLine() - 1);
|
28 |
-
$adapterSource = implode('', $adapterSource);
|
29 |
-
$adapterSource = str_replace(array('$this->minDepth', '$this->maxDepth'), array('$minDepth', '$maxDepth'), $adapterSource);
|
30 |
-
|
31 |
-
$finderSource = \array_slice(file($finderReflector->getFileName()), $finderReflector->getStartLine() + 1, $finderReflector->getEndLine() - $finderReflector->getStartLine() - 1);
|
32 |
-
$finderSource = implode('', $finderSource);
|
33 |
-
|
34 |
-
$this->assertStringEndsWith($adapterSource, $finderSource);
|
35 |
-
}
|
36 |
-
|
37 |
-
protected function buildFinder()
|
38 |
-
{
|
39 |
-
$adapter = new PhpAdapter();
|
40 |
-
|
41 |
-
return Finder::create()
|
42 |
-
->removeAdapters()
|
43 |
-
->addAdapter($adapter);
|
44 |
-
}
|
45 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/symfony/finder/Tests/Shell/CommandTest.php
DELETED
@@ -1,166 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Symfony package.
|
5 |
-
*
|
6 |
-
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Symfony\Component\Finder\Tests\Shell;
|
13 |
-
|
14 |
-
use PHPUnit\Framework\TestCase;
|
15 |
-
use Symfony\Component\Finder\Shell\Command;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* @group legacy
|
19 |
-
*/
|
20 |
-
class CommandTest extends TestCase
|
21 |
-
{
|
22 |
-
public function testCreate()
|
23 |
-
{
|
24 |
-
$this->assertInstanceOf('Symfony\Component\Finder\Shell\Command', Command::create());
|
25 |
-
}
|
26 |
-
|
27 |
-
public function testAdd()
|
28 |
-
{
|
29 |
-
$cmd = Command::create()->add('--force');
|
30 |
-
$this->assertSame('--force', $cmd->join());
|
31 |
-
}
|
32 |
-
|
33 |
-
public function testAddAsFirst()
|
34 |
-
{
|
35 |
-
$cmd = Command::create()->add('--force');
|
36 |
-
|
37 |
-
$cmd->addAtIndex(Command::create()->add('-F'), 0);
|
38 |
-
$this->assertSame('-F --force', $cmd->join());
|
39 |
-
}
|
40 |
-
|
41 |
-
public function testAddAsLast()
|
42 |
-
{
|
43 |
-
$cmd = Command::create()->add('--force');
|
44 |
-
|
45 |
-
$cmd->addAtIndex(Command::create()->add('-F'), 1);
|
46 |
-
$this->assertSame('--force -F', $cmd->join());
|
47 |
-
}
|
48 |
-
|
49 |
-
public function testAddInBetween()
|
50 |
-
{
|
51 |
-
$cmd = Command::create()->add('--force');
|
52 |
-
$cmd->addAtIndex(Command::create()->add('-F'), 0);
|
53 |
-
|
54 |
-
$cmd->addAtIndex(Command::create()->add('-X'), 1);
|
55 |
-
$this->assertSame('-F -X --force', $cmd->join());
|
56 |
-
}
|
57 |
-
|
58 |
-
public function testCount()
|
59 |
-
{
|
60 |
-
$cmd = Command::create();
|
61 |
-
$this->assertSame(0, $cmd->length());
|
62 |
-
|
63 |
-
$cmd->add('--force');
|
64 |
-
$this->assertSame(1, $cmd->length());
|
65 |
-
|
66 |
-
$cmd->add('--run');
|
67 |
-
$this->assertSame(2, $cmd->length());
|
68 |
-
}
|
69 |
-
|
70 |
-
public function testTop()
|
71 |
-
{
|
72 |
-
$cmd = Command::create()->add('--force');
|
73 |
-
|
74 |
-
$cmd->top('--run');
|
75 |
-
$this->assertSame('--run --force', $cmd->join());
|
76 |
-
}
|
77 |
-
|
78 |
-
public function testTopLabeled()
|
79 |
-
{
|
80 |
-
$cmd = Command::create()->add('--force');
|
81 |
-
|
82 |
-
$cmd->top('--run');
|
83 |
-
$cmd->ins('--something');
|
84 |
-
$cmd->top('--something');
|
85 |
-
$this->assertSame('--something --run --force ', $cmd->join());
|
86 |
-
}
|
87 |
-
|
88 |
-
public function testArg()
|
89 |
-
{
|
90 |
-
$cmd = Command::create()->add('--force');
|
91 |
-
|
92 |
-
$cmd->arg('--run');
|
93 |
-
$this->assertSame('--force '.escapeshellarg('--run'), $cmd->join());
|
94 |
-
}
|
95 |
-
|
96 |
-
public function testCmd()
|
97 |
-
{
|
98 |
-
$cmd = Command::create()->add('--force');
|
99 |
-
|
100 |
-
$cmd->cmd('run');
|
101 |
-
$this->assertSame('--force run', $cmd->join());
|
102 |
-
}
|
103 |
-
|
104 |
-
public function testInsDuplicateLabelException()
|
105 |
-
{
|
106 |
-
$cmd = Command::create()->add('--force');
|
107 |
-
|
108 |
-
$cmd->ins('label');
|
109 |
-
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('RuntimeException');
|
110 |
-
$cmd->ins('label');
|
111 |
-
}
|
112 |
-
|
113 |
-
public function testEnd()
|
114 |
-
{
|
115 |
-
$parent = Command::create();
|
116 |
-
$cmd = Command::create($parent);
|
117 |
-
|
118 |
-
$this->assertSame($parent, $cmd->end());
|
119 |
-
}
|
120 |
-
|
121 |
-
public function testEndNoParentException()
|
122 |
-
{
|
123 |
-
$cmd = Command::create();
|
124 |
-
|
125 |
-
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('RuntimeException');
|
126 |
-
$cmd->end();
|
127 |
-
}
|
128 |
-
|
129 |
-
public function testGetMissingLabelException()
|
130 |
-
{
|
131 |
-
$cmd = Command::create();
|
132 |
-
|
133 |
-
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('RuntimeException');
|
134 |
-
$cmd->get('invalid');
|
135 |
-
}
|
136 |
-
|
137 |
-
public function testErrorHandler()
|
138 |
-
{
|
139 |
-
$cmd = Command::create();
|
140 |
-
$handler = function () { return 'error-handler'; };
|
141 |
-
$cmd->setErrorHandler($handler);
|
142 |
-
|
143 |
-
$this->assertSame($handler, $cmd->getErrorHandler());
|
144 |
-
}
|
145 |
-
|
146 |
-
public function testExecute()
|
147 |
-
{
|
148 |
-
$cmd = Command::create();
|
149 |
-
$cmd->add('php');
|
150 |
-
$cmd->add('--version');
|
151 |
-
$result = $cmd->execute();
|
152 |
-
|
153 |
-
$this->assertInternalType('array', $result);
|
154 |
-
$this->assertNotEmpty($result);
|
155 |
-
$this->assertRegExp('/PHP|HipHop/', $result[0]);
|
156 |
-
}
|
157 |
-
|
158 |
-
public function testCastToString()
|
159 |
-
{
|
160 |
-
$cmd = Command::create();
|
161 |
-
$cmd->add('--force');
|
162 |
-
$cmd->add('--run');
|
163 |
-
|
164 |
-
$this->assertSame('--force --run', (string) $cmd);
|
165 |
-
}
|
166 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|