File tree 3 files changed +49
-1
lines changed
_files/app/code/Magento/SomeModule/etc/source/PhpExt.php
3 files changed +49
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ public function getList($path)
55
55
$ classes = [];
56
56
foreach ($ recursiveIterator as $ fileItem ) {
57
57
/** @var $fileItem \SplFileInfo */
58
- if ($ fileItem ->getExtension () !== 'php ' ) {
58
+ if ($ fileItem ->isDir () || $ fileItem -> getExtension () !== 'php ' ) {
59
59
continue ;
60
60
}
61
61
foreach ($ this ->excludePatterns as $ excludePatterns ) {
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © 2016 Magento. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ namespace Magento \Setup \Test \Unit \Module \Di \Code \Reader ;
7
+
8
+ class ClassesScannerTest extends \PHPUnit_Framework_TestCase
9
+ {
10
+ /**
11
+ * @var \Magento\Setup\Module\Di\Code\Reader\ClassesScanner
12
+ */
13
+ private $ model ;
14
+
15
+ protected function setUp ()
16
+ {
17
+ $ this ->model = new \Magento \Setup \Module \Di \Code \Reader \ClassesScanner ();
18
+ }
19
+
20
+ public function testGetList ()
21
+ {
22
+ $ pathToScan = str_replace ('\\' , '/ ' , realpath (__DIR__ . '/../../ ' ) . '/_files/app/code/Magento/SomeModule ' );
23
+ $ actual = $ this ->model ->getList ($ pathToScan );
24
+ $ this ->assertTrue (is_array ($ actual ));
25
+ $ this ->assertCount (5 , $ actual );
26
+ }
27
+ }
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright © 2016 Magento. All rights reserved.
3
+ * See COPYING.txt for license details.
4
+ */
5
+
6
+ /**
7
+ * This file exists for the sake of \Magento\Setup\Test\Unit\Module\Di\Code\Reader\ClassesScannerTest, in order
8
+ * to verify that PHP files are correctly scanned and things that are not PHP files (like this file and its parent
9
+ * directory) are not scanned.
10
+ */
11
+
12
+ /**
13
+ * True Function
14
+ *
15
+ * @return bool
16
+ */
17
+ public function someTrueFunction()
18
+ {
19
+ return true;
20
+ }
21
+
You can’t perform that action at this time.
0 commit comments