Skip to content

Commit 1544bea

Browse files
committed
Modify tests
1 parent c49e32a commit 1544bea

38 files changed

+7089
-15
lines changed

phpunit.xml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,34 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
4-
bootstrap="tests/bootstrap.php"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnFailure="false">
2+
<phpunit
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
cacheTokens="false"
6+
bootstrap="tests/bootstrap.php"
7+
colors="true"
8+
convertErrorsToExceptions="true"
9+
convertNoticesToExceptions="true"
10+
convertWarningsToExceptions="true"
11+
forceCoversAnnotation="false"
12+
processIsolation="false"
13+
stopOnError="false"
14+
stopOnFailure="false"
15+
stopOnIncomplete="false"
16+
stopOnSkipped="false"
17+
strict="false"
18+
verbose="false"
19+
>
1120
<testsuites>
1221
<testsuite name="Application Test Suite">
1322
<directory suffix="Test.php">./tests/Cases</directory>
1423
</testsuite>
1524
</testsuites>
25+
<logging>
26+
<log type="coverage-html" target="./tests/codeCoverage" charset="UTF-8"/>
27+
</logging>
1628
<filter>
17-
<whitelist processUncoveredFilesFromWhitelist="true">
29+
<whitelist>
1830
<directory suffix=".php">./src</directory>
1931
</whitelist>
20-
<blacklist>
21-
<directory>./vendor</directory>
22-
<directory>./config</directory>
23-
<directory>./tests</directory>
24-
</blacklist>
2532
</filter>
2633
<php>
2734
<env name="APP_ENV" value="testing"/>

tests/codeCoverage/Commands/InitiateDatabaseTable.php.html

Lines changed: 234 additions & 0 deletions
Large diffs are not rendered by default.

tests/codeCoverage/Commands/MakeModule.php.html

Lines changed: 346 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 291 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,291 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Dashboard for /Users/muhannad/Projects/laravel-modules/src/Commands</title>
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<link href="../css/bootstrap.min.css" rel="stylesheet">
8+
<link href="../css/nv.d3.min.css" rel="stylesheet">
9+
<link href="../css/style.css" rel="stylesheet">
10+
<!--[if lt IE 9]>
11+
<script src="../js/html5shiv.min.js"></script>
12+
<script src="../js/respond.min.js"></script>
13+
<![endif]-->
14+
</head>
15+
<body>
16+
<header>
17+
<div class="container">
18+
<div class="row">
19+
<div class="col-md-12">
20+
<ol class="breadcrumb">
21+
<li><a href="../index.html">/Users/muhannad/Projects/laravel-modules/src</a></li>
22+
<li><a href="index.html">Commands</a></li>
23+
<li class="active">(Dashboard)</li>
24+
25+
</ol>
26+
</div>
27+
</div>
28+
</div>
29+
</header>
30+
<div class="container">
31+
<div class="row">
32+
<div class="col-md-12">
33+
<h2>Classes</h2>
34+
</div>
35+
</div>
36+
<div class="row">
37+
<div class="col-md-6">
38+
<h3>Coverage Distribution</h3>
39+
<div id="classCoverageDistribution" style="height: 300px;">
40+
<svg></svg>
41+
</div>
42+
</div>
43+
<div class="col-md-6">
44+
<h3>Complexity</h3>
45+
<div id="classComplexity" style="height: 300px;">
46+
<svg></svg>
47+
</div>
48+
</div>
49+
</div>
50+
<div class="row">
51+
<div class="col-md-6">
52+
<h3>Insufficient Coverage</h3>
53+
<div class="scrollbox">
54+
<table class="table">
55+
<thead>
56+
<tr>
57+
<th>Class</th>
58+
<th class="text-right">Coverage</th>
59+
</tr>
60+
</thead>
61+
<tbody>
62+
<tr><td><a href="InitiateDatabaseTable.php.html#9">InitiateDatabaseTable</a></td><td class="text-right">80%</td></tr>
63+
64+
</tbody>
65+
</table>
66+
</div>
67+
</div>
68+
<div class="col-md-6">
69+
<h3>Project Risks</h3>
70+
<div class="scrollbox">
71+
<table class="table">
72+
<thead>
73+
<tr>
74+
<th>Class</th>
75+
<th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
76+
</tr>
77+
</thead>
78+
<tbody>
79+
<tr><td><a href="InitiateDatabaseTable.php.html#9">InitiateDatabaseTable</a></td><td class="text-right">4</td></tr>
80+
81+
</tbody>
82+
</table>
83+
</div>
84+
</div>
85+
</div>
86+
<div class="row">
87+
<div class="col-md-12">
88+
<h2>Methods</h2>
89+
</div>
90+
</div>
91+
<div class="row">
92+
<div class="col-md-6">
93+
<h3>Coverage Distribution</h3>
94+
<div id="methodCoverageDistribution" style="height: 300px;">
95+
<svg></svg>
96+
</div>
97+
</div>
98+
<div class="col-md-6">
99+
<h3>Complexity</h3>
100+
<div id="methodComplexity" style="height: 300px;">
101+
<svg></svg>
102+
</div>
103+
</div>
104+
</div>
105+
<div class="row">
106+
<div class="col-md-6">
107+
<h3>Insufficient Coverage</h3>
108+
<div class="scrollbox">
109+
<table class="table">
110+
<thead>
111+
<tr>
112+
<th>Method</th>
113+
<th class="text-right">Coverage</th>
114+
</tr>
115+
</thead>
116+
<tbody>
117+
<tr><td><a href="InitiateDatabaseTable.php.html#28"><abbr title="InitiateDatabaseTable::handle">handle</abbr></a></td><td class="text-right">75%</td></tr>
118+
119+
</tbody>
120+
</table>
121+
</div>
122+
</div>
123+
<div class="col-md-6">
124+
<h3>Project Risks</h3>
125+
<div class="scrollbox">
126+
<table class="table">
127+
<thead>
128+
<tr>
129+
<th>Method</th>
130+
<th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
131+
</tr>
132+
</thead>
133+
<tbody>
134+
<tr><td><a href="InitiateDatabaseTable.php.html#28"><abbr title="InitiateDatabaseTable::handle">handle</abbr></a></td><td class="text-right">3</td></tr>
135+
136+
</tbody>
137+
</table>
138+
</div>
139+
</div>
140+
</div>
141+
<footer>
142+
<hr/>
143+
<p>
144+
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 4.0.7</a> using <a href="https://secure.php.net/" target="_top">PHP 5.6.29</a> with <a href="https://xdebug.org/">Xdebug 2.2.5</a> and <a href="https://phpunit.de/">PHPUnit 5.7.16</a> at Sat Mar 25 14:45:58 UTC 2017.</small>
145+
</p>
146+
</footer>
147+
</div>
148+
<script src="../js/jquery.min.js" type="text/javascript"></script>
149+
<script src="../js/bootstrap.min.js" type="text/javascript"></script>
150+
<script src="../js/holder.min.js" type="text/javascript"></script>
151+
<script src="../js/d3.min.js" type="text/javascript"></script>
152+
<script src="../js/nv.d3.min.js" type="text/javascript"></script>
153+
<script type="text/javascript">
154+
$(document).ready(function() {
155+
nv.addGraph(function() {
156+
var chart = nv.models.multiBarChart();
157+
chart.tooltips(false)
158+
.showControls(false)
159+
.showLegend(false)
160+
.reduceXTicks(false)
161+
.staggerLabels(true)
162+
.yAxis.tickFormat(d3.format('d'));
163+
164+
d3.select('#classCoverageDistribution svg')
165+
.datum(getCoverageDistributionData([0,0,0,0,0,0,0,0,0,1,1,0], "Class Coverage"))
166+
.transition().duration(500).call(chart);
167+
168+
nv.utils.windowResize(chart.update);
169+
170+
return chart;
171+
});
172+
173+
nv.addGraph(function() {
174+
var chart = nv.models.multiBarChart();
175+
chart.tooltips(false)
176+
.showControls(false)
177+
.showLegend(false)
178+
.reduceXTicks(false)
179+
.staggerLabels(true)
180+
.yAxis.tickFormat(d3.format('d'));
181+
182+
d3.select('#methodCoverageDistribution svg')
183+
.datum(getCoverageDistributionData([0,0,0,0,0,0,0,0,1,0,0,6], "Method Coverage"))
184+
.transition().duration(500).call(chart);
185+
186+
nv.utils.windowResize(chart.update);
187+
188+
return chart;
189+
});
190+
191+
function getCoverageDistributionData(data, label) {
192+
var labels = [
193+
'0%',
194+
'0-10%',
195+
'10-20%',
196+
'20-30%',
197+
'30-40%',
198+
'40-50%',
199+
'50-60%',
200+
'60-70%',
201+
'70-80%',
202+
'80-90%',
203+
'90-100%',
204+
'100%'
205+
];
206+
var values = [];
207+
$.each(labels, function(key) {
208+
values.push({x: labels[key], y: data[key]});
209+
});
210+
211+
return [
212+
{
213+
key: label,
214+
values: values,
215+
color: "#4572A7"
216+
}
217+
];
218+
}
219+
nv.addGraph(function() {
220+
var chart = nv.models.scatterChart()
221+
.showDistX(true)
222+
.showDistY(true)
223+
.showLegend(false)
224+
.forceX([0, 100]);
225+
chart.tooltipContent(function(graph) {
226+
return '<p>' + graph.point.class + '</p>';
227+
});
228+
229+
chart.xAxis.axisLabel('Code Coverage (in percent)');
230+
chart.yAxis.axisLabel('Cyclomatic Complexity');
231+
232+
d3.select('#classComplexity svg')
233+
.datum(getComplexityData([[80,4,"<a href=\"InitiateDatabaseTable.php.html#9\">InitiateDatabaseTable<\/a>"],[94.594594594595,8,"<a href=\"MakeModule.php.html#8\">MakeModule<\/a>"]], 'Class Complexity'))
234+
.transition()
235+
.duration(500)
236+
.call(chart);
237+
238+
nv.utils.windowResize(chart.update);
239+
240+
return chart;
241+
});
242+
243+
nv.addGraph(function() {
244+
var chart = nv.models.scatterChart()
245+
.showDistX(true)
246+
.showDistY(true)
247+
.showLegend(false)
248+
.forceX([0, 100]);
249+
chart.tooltipContent(function(graph) {
250+
return '<p>' + graph.point.class + '</p>';
251+
});
252+
253+
chart.xAxis.axisLabel('Code Coverage (in percent)');
254+
chart.yAxis.axisLabel('Method Complexity');
255+
256+
d3.select('#methodComplexity svg')
257+
.datum(getComplexityData([[100,1,"<a href=\"InitiateDatabaseTable.php.html#18\">InitiateDatabaseTable::__construct<\/a>"],[75,3,"<a href=\"InitiateDatabaseTable.php.html#28\">InitiateDatabaseTable::handle<\/a>"],[100,1,"<a href=\"MakeModule.php.html#27\">MakeModule::__construct<\/a>"],[100,2,"<a href=\"MakeModule.php.html#38\">MakeModule::handle<\/a>"],[100,2,"<a href=\"MakeModule.php.html#72\">MakeModule::makeDirectory<\/a>"],[100,2,"<a href=\"MakeModule.php.html#79\">MakeModule::copyStub<\/a>"],[100,1,"<a href=\"MakeModule.php.html#82\">MakeModule::anonymous function<\/a>"]], 'Method Complexity'))
258+
.transition()
259+
.duration(500)
260+
.call(chart);
261+
262+
nv.utils.windowResize(chart.update);
263+
264+
return chart;
265+
});
266+
267+
function getComplexityData(data, label) {
268+
var values = [];
269+
$.each(data, function(key) {
270+
var value = Math.round(data[key][0]*100) / 100;
271+
values.push({
272+
x: value,
273+
y: data[key][1],
274+
class: data[key][2],
275+
size: 0.05,
276+
shape: 'diamond'
277+
});
278+
});
279+
280+
return [
281+
{
282+
key: label,
283+
values: values,
284+
color: "#4572A7"
285+
}
286+
];
287+
}
288+
});
289+
</script>
290+
</body>
291+
</html>

0 commit comments

Comments
 (0)