File: readme.html

package info (click to toggle)
netbeans 8.1%2Bdfsg3-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 816,472 kB
  • ctags: 847,258
  • sloc: java: 5,564,229; xml: 634,273; cpp: 25,695; ansic: 20,104; jsp: 12,621; sh: 10,354; php: 4,204; makefile: 1,456; fortran: 1,200; sql: 1,192; objc: 288; perl: 277; haskell: 120; yacc: 30; awk: 17; lex: 11; asm: 4
file content (305 lines) | stat: -rw-r--r-- 11,337 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
<!--
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

Copyright 2015 Oracle and/or its affiliates. All rights reserved.

Oracle and Java are registered trademarks of Oracle and/or its affiliates.
Other names may be trademarks of their respective owners.

The contents of this file are subject to the terms of either the GNU
General Public License Version 2 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://www.netbeans.org/cddl-gplv2.html
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
specific language governing permissions and limitations under the
License.  When distributing the software, include this License Header
Notice in each file and include the License file at
nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
particular file as subject to the "Classpath" exception as provided
by Oracle in the GPL Version 2 section of the License file that
accompanied this code. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"

If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 2, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 2] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 2 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 2 code and therefore, elected the GPL
Version 2 license, then the option applies only if the new code is
made subject to such option by the copyright holder.

Contributor(s):

Portions Copyrighted 2015 Sun Microsystems, Inc.
-->
<!DOCTYPE html>
<html>
<head>
    <title>Calculator (Codeception) - sample application for NetBeans IDE</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <style type="text/css">
        /** general **/
        * {
            margin: 0;
            padding: 0;
        }
        body {
            font-family: Tahoma, Geneva, sans-serif;
            font-size: 100%;
            line-height: 1em;
            color: #414141;
        }

        h1 {
            margin-bottom: 30px;
        }
        h2 {
            margin-bottom: 20px;
        }
        h3 {
            font-size: 1em;
            color: #4c7cbd;
            margin-bottom: 12px;
        }
        h3 a {
            color: #4c7cbd;
            text-decoration: none;
        }
        h3 a:hover {
            text-decoration: underline;
        }

        p {
            margin: 0;
            padding: 0;
        }
        .p {
            margin-bottom: 14px;
        }

        a {
            color: #414141;
            outline: none;
        }
        a:hover {
            text-decoration: none;
        }

        /** lists **/
        ul {
            list-style: circle;
        }
        li {
            margin-left: 30px;
        }
        ul.list {
            list-style: none;
        }
        .list li {
            width: 100%;
            overflow: hidden;
            vertical-align: bottom;
            padding: 3px 0 20px 0;
            margin-left: 0;
        }
        .list li img {
            float: left;
            margin: -3px 15px 0 0;
            width: 16px;
            height: 16px;
        }
        .list p.description {
            margin-bottom: 5px;
        }
        .list span.label {
            font-weight: bold;
        }


        /** other **/
        .fleft {
            float: left;
        }
        .fright {
            float: right;
        }
        .clear {
            clear: both;
        }

        .wrapper {
            width: 100%;
            overflow: hidden;
        }

        #main {
            width: 1000px;
            margin: 0 auto;
            position: relative;
        }

        #content, #footer {
            font-size: 0.75em;
        }

        .col-1, .col-2, .col-3 {
            float: left;
        }

        #page #content .col-1 {
            width: 250px;
            margin-right: 20px;
        }
        #page #content .col-2 {
            width: 650px;
            min-height: 500px;
        }

        #footer {
            height: 89px;
        }

        /** content **/
        #content {
            padding: 20px 40px 0 40px;
        }
        #content .indent {
            padding: 14px 0 0 9px;
        }
        #content p {
            line-height: 1.17em;
        }

        /** footer **/
        #footer .indent {
            padding: 37px 40px 20px 40px;
        }
        #footer img {
            position: relative; top: -4px;
        }
        #footer a {
            color: #4c7cbd;
        }

    </style>
</head>
<body id="page">
    <div id="main">
        <!-- content -->
        <div id="content">
            <div class="wrapper">
                <div class="col-2">
                    <div class="indent">

                        <h1>Calculator (Codeception)</h1>
                        <h2>NetBeans PHP Sample Application</h2>

                        <h3>What is Calculator?</h3>
                        <p class="p">Calculator is a simple calculator that supports basic arithmetical operations.
                            This PHP application is created to highlight PHP features supported by NetBeans IDE.
                        </p>
                        <p class="p">
                            <b>This sample is not intented to be used in a production environment without any changes.</b>
                        </p>

                        <h3>This sample demonstrates the following features:</h3>
                        <ul class="p">
                            <li>unit testing using Codeception</li>
                            <li>creating unit tests using <code>codecept generate:test command</code></li>
                            <li>code coverage of project files</li>
                        </ul>

                        <h3>Requirements</h3>
                        Follow these before you run the sample:
                        <ul class="p">
                            <li>Install NetBeans IDE with PHP support</li>
                            <li>Install and configure PHP Runtime</li>
                            <li>Install all dependencies using <a href="https://getcomposer.org/">Composer</a>
                                (click on project and invoke <i>Composer</i> &gt; <i>Install (dev)</i>)<br>
                                <i>Note:</i> Codeception can also be installed <a href="http://codeception.com/install" target="_blank">globally as PHAR file</a></li>
                            <li>For debugging and code coverage, <a href="http://www.xdebug.org/">Xdebug</a> PHP extension is required</li>

                        </ul>

                        <h3>What is included?</h3>
                        <ul class="p">
                            <li>NetBeans <i>PHP Application</i> Project</li>
                        </ul>

                        <h3>Before the start</h3>
                        <ul class="p">
                            <li>If you want to try the sample out, follow <a href="#getting_started">Getting Started</a> guidelines.</li>
                            <li>In case if you want to try debugging features of the NetBeans IDE,
                                follow the <a href="#debugging">Debugging</a> guidelines.</li>
                        </ul>

                        <h3 id="getting_started">Getting Started</h3>
                        <ol class="p">
                            <li>
                                For the very first run, Codeception must be installed via Composer globally (see Requirements).
                            </li>
                            <li>
                                To initialize Codeception, Right-click the project node and select <i>Codeception &gt; Bootstrap</i>.
                            </li>
                            <li>
                                Now, create a unit test for CalculatorEx class - open it in the editor
                                and select <i>Tools &gt; Create/Update Tests</i>.
                                Then, select <i>test</i> command and <i>unit</i> suite in the Create Test dialog.
                            </li>
                            <li>
                                Add test cases for CalculatorEx class to the test class like CalculatorTest class.
                            </li>
                            <li>
                                To enable coverage put the below code in the unit suite configuration file <i>tests/unit.suite.yml</i>.
                                <pre><code>
coverage:
    enabled: true
    include:
        - src/*
                                </code></pre>
                            </li>
                            <li>
                                Simply test the project. Right-click the project node and select <i>Test</i>.
                                IDE will inform you about the test results (window with test results can be opened manually).
                            </li>
                            <li>
                                For code coverage, open its report (right-click the project node and select <i>Code Coverage &gt; Show Report...</i>)
                                and <i>Run All Tests</i> if there are no data available yet. Open <i>Calculator.php</i> file from the list of the files
                                to see which lines are and which lines are not tested.
                            </li>
                            <li>Play futher with the sample :)</li>
                        </ol>

                        <h3 id="debugging">Debugging</h3>
                        <p class="p">
                            These steps should enable you the debugging option at the sample project,
                            <a href="http://wiki.netbeans.org/HowToConfigureXDebug" target="_blank">if you already have PHP debugger (Xdebug)
                            installed and configured</a>.<br>
                            For demonstrating the PHP debugger in NetBeans, try the following:
                        </p>
                        <ol class="p">
                            <li>Open source class <i>Calculator.php</i> or <i>CalculatorTest.php</i> in the editor.</li>
                            <li>Put breakpoint on some line with PHP code.</li>
                            <li>To debug, right-click <i>CalculatorTest.php</i> and select <i>Debug</i>.</li>
                        </ol>

                    </div>
                </div>
            </div>
        </div>
        <!-- footer -->
        <div id="footer">
            <div class="indent">
                <div class="fleft"><a href="https://blogs.oracle.com/netbeansphp/">NetBeans PHP team</a>, 2015 &copy; Copyright Oracle corp., All rights reserved</div>
            </div>
        </div>
    </div>
</body>
</html>