File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4141 "phpunit/phpunit" : " *"
4242 },
4343 "scripts" : {
44- "clean" : [
45- " CodeMommy\\ ConfigPHP\\ Script\\ CleanReport::start"
46- ],
47- "test" : [
48- " CodeMommy\\ ConfigPHP\\ Script\\ CleanReport::start" ,
49- " \" vendor/bin/phpunit\" -v" ,
50- " start .report/index.html"
44+ "environment" : [
45+ " composer -V" ,
46+ " php -v" ,
47+ " php -m"
5148 ],
5249 "update-project" : [
5350 " git pull" ,
5451 " composer self-update" ,
5552 " composer update"
56- ]
53+ ],
54+ "test" : " CodeMommy\\ ConfigPHP\\ Script\\ Test::start" ,
55+ "clean" : " CodeMommy\\ ConfigPHP\\ Script\\ Clean::start"
5756 }
5857}
Original file line number Diff line number Diff line change 1111use CodeMommy \TaskPHP \FileSystem ;
1212
1313/**
14- * Class CleanReport
14+ * Class Clean
1515 * @package CodeMommy\ConfigPHP\Script;
1616 */
17- class CleanReport
17+ class Clean
1818{
1919 /**
20- * CleanReport constructor.
20+ * Clean constructor.
2121 */
2222 public function __construct ()
2323 {
@@ -33,9 +33,9 @@ public static function start()
3333 );
3434 $ result = FileSystem::remove ($ removeList );
3535 if ($ result ) {
36- Console::printLine ('Clean Report Finished. ' , 'success ' );
36+ Console::printLine ('Clean Finished. ' , 'success ' );
3737 } else {
38- Console::printLine ('Error. ' , 'error ' );
38+ Console::printLine ('Clean Error. ' , 'error ' );
3939 }
4040 }
4141}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /**
4+ * CodeMommy ConfigPHP
5+ * @author Candison November <www.kandisheng.com>
6+ */
7+
8+ namespace CodeMommy \ConfigPHP \Script ;
9+
10+ use CodeMommy \TaskPHP \Console ;
11+ use CodeMommy \TaskPHP \FileSystem ;
12+
13+ /**
14+ * Class Test
15+ * @package CodeMommy\ConfigPHP\Script;
16+ */
17+ class Test
18+ {
19+ /**
20+ * Test constructor.
21+ */
22+ public function __construct ()
23+ {
24+ }
25+
26+ /**
27+ * Start
28+ */
29+ public static function start ()
30+ {
31+ $ removeList = array (
32+ '.report '
33+ );
34+ $ result = FileSystem::remove ($ removeList );
35+ if ($ result ) {
36+ Console::printLine ('Clean Report Finished. ' , 'success ' );
37+ } else {
38+ Console::printLine ('Clean Report Error. ' , 'error ' );
39+ }
40+ system ('"vendor/bin/phpunit" -v ' );
41+ $ reportFile = '.report/index.html ' ;
42+ if (is_file ($ reportFile )) {
43+ system (sprintf ('start %s ' , $ reportFile ));
44+ } else {
45+ Console::printLine ('No Report. ' , 'information ' );
46+ }
47+ }
48+ }
You can’t perform that action at this time.
0 commit comments