File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed
Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ protected function setUp()
101101 TEST_FILES_PATH . 'NamespaceCoveragePublicTest.php ' ,
102102 TEST_FILES_PATH . 'NamespaceCoveredClass.php ' ,
103103 TEST_FILES_PATH . 'NotExistingCoveredElementTest.php ' ,
104+ TEST_FILES_PATH . 'function.php ' ,
104105 TEST_FILES_PATH . 'source_with_ignore.php ' ,
105106 TEST_FILES_PATH . 'source_without_ignore.php '
106107 );
Original file line number Diff line number Diff line change @@ -156,6 +156,31 @@ public function testGetClassesInFile()
156156 );
157157 }
158158
159+ /**
160+ * @covers PHP_CodeCoverage_Util::getFunctionsInFile
161+ * @covers PHP_CodeCoverage_Util::parseFile
162+ */
163+ public function testGetFunctionsInFile ()
164+ {
165+ $ this ->assertEquals (
166+ array (
167+ 'foo ' => array (
168+ 'docComment ' => '/**
169+ * @param mixed $bar
170+ */ ' ,
171+ 'signature ' => 'function foo($bar) ' ,
172+ 'startLine ' => 5 ,
173+ 'endLine ' => 8 ,
174+ 'ccn ' => 1
175+ )
176+ ),
177+ PHP_CodeCoverage_Util::getFunctionsInFile (
178+ TEST_FILES_PATH . 'function.php ' ,
179+ FALSE
180+ )
181+ );
182+ }
183+
159184 /**
160185 * @covers PHP_CodeCoverage_Util::getLinesToBeCovered
161186 * @covers PHP_CodeCoverage_Util::resolveCoversToReflectionObjects
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * @param mixed $bar
4+ */
5+ function foo ($ bar )
6+ {
7+ $ baz = function () {};
8+ }
You can’t perform that action at this time.
0 commit comments