Skip to content

Commit 852c83b

Browse files
committed
Update
1 parent ce9d3e7 commit 852c83b

3 files changed

Lines changed: 60 additions & 13 deletions

File tree

composer.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,17 @@
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
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
use 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
}

script/Test.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
}

0 commit comments

Comments
 (0)