ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ComponentInstaller\Test\Process\FilesystemTest Class Reference

Tests Process. More...

+ Inheritance diagram for ComponentInstaller\Test\Process\FilesystemTest:
+ Collaboration diagram for ComponentInstaller\Test\Process\FilesystemTest:

Public Member Functions

 testRecursiveGlobFiles ($expected, $pattern, $flags=0)
 Tests the recursiveGlob function. More...
 
 providerRecursiveGlobFiles ()
 
 testRecursiveGlob ($expected, $pattern, $flags=0)
 Tests the recursiveGlob function. More...
 
 providerRecursiveGlob ()
 

Detailed Description

Tests Process.

Definition at line 19 of file FilesystemTest.php.

Member Function Documentation

◆ providerRecursiveGlob()

ComponentInstaller\Test\Process\FilesystemTest::providerRecursiveGlob ( )

Definition at line 119 of file FilesystemTest.php.

120 {
121 $tests[] = array(
122 array(
123 'tests/ComponentInstaller/Test/Resources/img.jpg',
124 'tests/ComponentInstaller/Test/Resources/img2.jpg',
125 'tests/ComponentInstaller/Test/Resources/test.css',
126 'tests/ComponentInstaller/Test/Resources/test.js',
127 'tests/ComponentInstaller/Test/Resources/test2.css',
128 'tests/ComponentInstaller/Test/Resources/test2.js',
129 'tests/ComponentInstaller/Test/Resources/subdir',
130 ),
131 'tests/ComponentInstaller/Test/Resources/*',
132 );
133
134 $tests[] = array(
135 array(
136 'tests/ComponentInstaller/Test/Resources/test.css',
137 'tests/ComponentInstaller/Test/Resources/test2.css',
138 ),
139 'tests/ComponentInstaller/Test/Resources/*.css',
140 );
141
142 $tests[] = array(
143 array(
144 'tests/ComponentInstaller/Test/Resources/img.jpg',
145 'tests/ComponentInstaller/Test/Resources/img2.jpg',
146 ),
147 'tests/ComponentInstaller/Test/Resources/*.jpg',
148 );
149
150 $tests[] = array(
151 array(
152 'tests/ComponentInstaller/Test/Resources/img.jpg',
153 ),
154 'tests/ComponentInstaller/Test/Resources/img.jpg',
155 );
156
157 $tests[] = array(
158 array(
159 'tests/ComponentInstaller/Test/Resources/subdir/img.jpg',
160 'tests/ComponentInstaller/Test/Resources/subdir/img3.jpg',
161 'tests/ComponentInstaller/Test/Resources/subdir/subdir2/img4.jpg',
162 'tests/ComponentInstaller/Test/Resources/subdir/subdir2',
163 ),
164 'tests/ComponentInstaller/Test/Resources/subdir/**',
165 );
166
167 return $tests;
168 }

◆ providerRecursiveGlobFiles()

ComponentInstaller\Test\Process\FilesystemTest::providerRecursiveGlobFiles ( )

Definition at line 41 of file FilesystemTest.php.

42 {
43 $tests[] = array(
44 array(
45 'tests/ComponentInstaller/Test/Resources/img.jpg',
46 'tests/ComponentInstaller/Test/Resources/img2.jpg',
47 'tests/ComponentInstaller/Test/Resources/test.css',
48 'tests/ComponentInstaller/Test/Resources/test.js',
49 'tests/ComponentInstaller/Test/Resources/test2.css',
50 'tests/ComponentInstaller/Test/Resources/test2.js',
51 ),
52 'tests/ComponentInstaller/Test/Resources/*',
53 );
54
55 $tests[] = array(
56 array(
57 'tests/ComponentInstaller/Test/Resources/test.css',
58 'tests/ComponentInstaller/Test/Resources/test2.css',
59 ),
60 'tests/ComponentInstaller/Test/Resources/*.css',
61 );
62
63 $tests[] = array(
64 array(
65 'tests/ComponentInstaller/Test/Resources/img.jpg',
66 'tests/ComponentInstaller/Test/Resources/img2.jpg',
67 ),
68 'tests/ComponentInstaller/Test/Resources/*.jpg',
69 );
70
71 $tests[] = array(
72 array(
73 'tests/ComponentInstaller/Test/Resources/img.jpg',
74 'tests/ComponentInstaller/Test/Resources/img2.jpg',
75 ),
76 'tests/ComponentInstaller/Test/Resources/*img*',
77 );
78
79 $tests[] = array(
80 array(
81 'tests/ComponentInstaller/Test/Resources/img.jpg',
82 ),
83 'tests/ComponentInstaller/Test/Resources/img.jpg',
84 );
85
86 $tests[] = array(
87 array(
88 'tests/ComponentInstaller/Test/Resources/img.jpg',
89 'tests/ComponentInstaller/Test/Resources/img2.jpg',
90 'tests/ComponentInstaller/Test/Resources/subdir/img.jpg',
91 'tests/ComponentInstaller/Test/Resources/subdir/img3.jpg',
92 'tests/ComponentInstaller/Test/Resources/subdir/subdir2/img4.jpg',
93 ),
94 'tests/ComponentInstaller/Test/Resources/**img*.jpg',
95 );
96
97 return $tests;
98 }

◆ testRecursiveGlob()

ComponentInstaller\Test\Process\FilesystemTest::testRecursiveGlob (   $expected,
  $pattern,
  $flags = 0 
)

Tests the recursiveGlob function.

@dataProvider providerRecursiveGlob

Parameters
array$expected
string$pattern
int$flags

Definition at line 108 of file FilesystemTest.php.

109 {
110 $fs = new Filesystem();
111 $result = $fs->recursiveGlob($pattern, $flags);
112
113 // Sort the arrays so that the indexes don't matter.
114 sort($expected);
115 sort($result);
116 $this->assertEquals($expected, $result);
117 }
$result

References $result.

◆ testRecursiveGlobFiles()

ComponentInstaller\Test\Process\FilesystemTest::testRecursiveGlobFiles (   $expected,
  $pattern,
  $flags = 0 
)

Tests the recursiveGlob function.

@dataProvider providerRecursiveGlobFiles

Parameters
array$expected
string$pattern
int$flags

Definition at line 29 of file FilesystemTest.php.

30 {
31 $fs = new Filesystem();
32 $result = $fs->recursiveGlobFiles($pattern, $flags);
33
34 // Sort the arrays so that the indexes don't matter.
35 sort($expected);
36 sort($result);
37
38 $this->assertEquals($expected, $result);
39 }

References $result.


The documentation for this class was generated from the following file: