File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ class TestCleanReport extends WP_UnitTestCase {
3+
4+ private $ wpephpc ;
5+
6+ public function setUp () {
7+ $ root_dir = realpath ( __DIR__ . '/../../ ' );
8+
9+ $ this ->wpephpc = new \WPEPHPCompat ( $ root_dir );
10+ }
11+
12+ public function test_clean_report_time () {
13+ $ report = "Time: 323 \n" ;
14+
15+ $ output = $ this ->wpephpc ->clean_report ( $ report );
16+ $ this ->assertEquals ( '' , $ output );
17+ }
18+
19+ public function test_clean_report_newlines () {
20+ $ report = "\n\n\n\n" ;
21+
22+ $ output = $ this ->wpephpc ->clean_report ( $ report );
23+ $ this ->assertEquals ( '' , $ output );
24+ }
25+
26+ public function test_clean_report_time_and_newlines () {
27+ $ report = "\n\n\nhello \nTime: 323 \n\n\n\n\n" ;
28+
29+ $ output = $ this ->wpephpc ->clean_report ( $ report );
30+ $ this ->assertEquals ( 'hello ' , $ output );
31+ }
32+ }
You can’t perform that action at this time.
0 commit comments