aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/Unit-tests.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/Unit-tests.html')
-rw-r--r--doc/Unit-tests.html110
1 files changed, 54 insertions, 56 deletions
diff --git a/doc/Unit-tests.html b/doc/Unit-tests.html
index 7934e346..266fd33a 100644
--- a/doc/Unit-tests.html
+++ b/doc/Unit-tests.html
@@ -52,13 +52,13 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
52<div id="local-sidebar"> 52<div id="local-sidebar">
53<ul> 53<ul>
54<li><a href="Home.html">Home</a></li> 54<li><a href="Home.html">Home</a></li>
55<li>Installation 55<li>Setup
56<ul> 56<ul>
57<li><a href="Download.html">Download</a></li> 57<li><a href="Download-and-Installation.html">Download and Installation</a></li>
58<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
58<li><a href="Server-requirements.html">Server requirements</a></li> 59<li><a href="Server-requirements.html">Server requirements</a></li>
59<li><a href="Server-configuration.html">Server configuration</a></li> 60<li><a href="Server-configuration.html">Server configuration</a></li>
60<li><a href="Server-security.html">Server security</a></li> 61<li><a href="Server-security.html">Server security</a></li>
61<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
62<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li> 62<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
63<li><a href="Plugins.html">Plugins</a></li> 63<li><a href="Plugins.html">Plugins</a></li>
64</ul></li> 64</ul></li>
@@ -73,7 +73,6 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
73<li>How To 73<li>How To
74<ul> 74<ul>
75<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li> 75<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
76<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
77<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li> 76<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
78<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li> 77<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
79<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li> 78<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
@@ -97,7 +96,6 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
97<ul> 96<ul>
98<li><a href="FAQ.html">FAQ</a></li> 97<li><a href="FAQ.html">FAQ</a></li>
99<li><a href="Community-&amp;-Related-software.html">Community &amp; Related software</a></li> 98<li><a href="Community-&amp;-Related-software.html">Community &amp; Related software</a></li>
100<li><a href="TODO.html">TODO</a></li>
101</ul></li> 99</ul></li>
102</ul> 100</ul>
103</div> 101</div>
@@ -111,87 +109,87 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
111</ul> 109</ul>
112<h4 id="sample-usage">Sample usage</h4> 110<h4 id="sample-usage">Sample usage</h4>
113<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="co"># system-wide version</span> 111<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="co"># system-wide version</span>
114$ <span class="kw">composer</span> install 112$ <span class="ex">composer</span> install
115$ <span class="kw">composer</span> update 113$ <span class="ex">composer</span> update
116 114
117<span class="co"># local version</span> 115<span class="co"># local version</span>
118$ <span class="kw">php</span> composer.phar self-update 116$ <span class="ex">php</span> composer.phar self-update
119$ <span class="kw">php</span> composer.phar install 117$ <span class="ex">php</span> composer.phar install
120$ <span class="kw">php</span> composer.phar update</code></pre></div> 118$ <span class="ex">php</span> composer.phar update</code></pre></div>
121<h4 id="install-shaarli-dev-dependencies">Install Shaarli dev dependencies</h4> 119<h4 id="install-shaarli-dev-dependencies">Install Shaarli dev dependencies</h4>
122<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">cd</span> /path/to/shaarli 120<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="bu">cd</span> /path/to/shaarli
123$ <span class="kw">composer</span> update</code></pre></div> 121$ <span class="ex">composer</span> update</code></pre></div>
124<h4 id="install-and-enable-xdebug-to-generate-phpunit-coverage-reports">Install and enable Xdebug to generate PHPUnit coverage reports</h4> 122<h4 id="install-and-enable-xdebug-to-generate-phpunit-coverage-reports">Install and enable Xdebug to generate PHPUnit coverage reports</h4>
125<p>For Debian-based distros:</p> 123<p>For Debian-based distros:</p>
126<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">aptitude</span> install php5-xdebug</code></pre></div> 124<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">aptitude</span> install php5-xdebug</code></pre></div>
127<p>For ArchLinux:</p> 125<p>For ArchLinux:</p>
128<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">pacman</span> -S xdebug</code></pre></div> 126<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">pacman</span> -S xdebug</code></pre></div>
129<p>Then add the following line to <code>/etc/php/php.ini</code>:</p> 127<p>Then add the following line to <code>/etc/php/php.ini</code>:</p>
130<div class="sourceCode"><pre class="sourceCode ini"><code class="sourceCode ini"><span class="dt">zend_extension</span><span class="ot">=</span><span class="st">xdebug.so</span></code></pre></div> 128<div class="sourceCode"><pre class="sourceCode ini"><code class="sourceCode ini"><span class="dt">zend_extension</span><span class="ot">=</span><span class="st">xdebug.so</span></code></pre></div>
131<h4 id="run-unit-tests">Run unit tests</h4> 129<h4 id="run-unit-tests">Run unit tests</h4>
132<p>Successful test suite:</p> 130<p>Successful test suite:</p>
133<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">make</span> test 131<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="fu">make</span> test
134 132
135<span class="kw">-------</span> 133<span class="ex">-------</span>
136<span class="kw">PHPUNIT</span> 134<span class="ex">PHPUNIT</span>
137<span class="kw">-------</span> 135<span class="ex">-------</span>
138<span class="kw">PHPUnit</span> 4.6.9 by Sebastian Bergmann and contributors. 136<span class="ex">PHPUnit</span> 4.6.9 by Sebastian Bergmann and contributors.
139 137
140<span class="kw">Configuration</span> read from /home/virtualtam/public_html/shaarli/phpunit.xml 138<span class="ex">Configuration</span> read from /home/virtualtam/public_html/shaarli/phpunit.xml
141 139
142<span class="kw">....................................</span> 140<span class="ex">....................................</span>
143 141
144<span class="kw">Time</span>: 759 ms, Memory: 8.25Mb 142<span class="ex">Time</span>: 759 ms, Memory: 8.25Mb
145 143
146<span class="kw">OK</span> (36 tests, 65 assertions)</code></pre></div> 144<span class="ex">OK</span> (36 tests, 65 assertions)</code></pre></div>
147<p>Test suite with failures and errors:</p> 145<p>Test suite with failures and errors:</p>
148<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">make</span> test 146<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="fu">make</span> test
149<span class="kw">-------</span> 147<span class="ex">-------</span>
150<span class="kw">PHPUNIT</span> 148<span class="ex">PHPUNIT</span>
151<span class="kw">-------</span> 149<span class="ex">-------</span>
152<span class="kw">PHPUnit</span> 4.6.9 by Sebastian Bergmann and contributors. 150<span class="ex">PHPUnit</span> 4.6.9 by Sebastian Bergmann and contributors.
153 151
154<span class="kw">Configuration</span> read from /home/virtualtam/public_html/shaarli/phpunit.xml 152<span class="ex">Configuration</span> read from /home/virtualtam/public_html/shaarli/phpunit.xml
155 153
156<span class="kw">E..FF...............................</span> 154<span class="ex">E..FF...............................</span>
157 155
158<span class="kw">Time</span>: 802 ms, Memory: 8.25Mb 156<span class="ex">Time</span>: 802 ms, Memory: 8.25Mb
159 157
160<span class="kw">There</span> was 1 error: 158<span class="ex">There</span> was 1 error:
161 159
162<span class="kw">1</span>) <span class="kw">LinkDBTest</span>::testConstructLoggedIn 160<span class="ex">1</span>) <span class="ex">LinkDBTest</span>::testConstructLoggedIn
163<span class="kw">Missing</span> argument 2 for LinkDB::__construct(), <span class="kw">called</span> in /home/virtualtam/public_html/shaarli/tests/Link\ 161<span class="ex">Missing</span> argument 2 for LinkDB::__construct(), <span class="ex">called</span> in /home/virtualtam/public_html/shaarli/tests/Link\
164DBTest.php on line 79 and defined 162DBTest.php on line 79 and defined
165 163
166<span class="kw">/home/virtualtam/public_html/shaarli/application</span>/LinkDB.php:<span class="kw">58</span> 164<span class="ex">/home/virtualtam/public_html/shaarli/application</span>/LinkDB.php:<span class="ex">58</span>
167<span class="kw">/home/virtualtam/public_html/shaarli/tests</span>/LinkDBTest.php:<span class="kw">79</span> 165<span class="ex">/home/virtualtam/public_html/shaarli/tests</span>/LinkDBTest.php:<span class="ex">79</span>
168 166
169<span class="kw">--</span> 167<span class="ex">--</span>
170 168
171<span class="kw">There</span> were 2 failures: 169<span class="ex">There</span> were 2 failures:
172 170
173<span class="kw">1</span>) <span class="kw">LinkDBTest</span>::testCheckDBNew 171<span class="ex">1</span>) <span class="ex">LinkDBTest</span>::testCheckDBNew
174<span class="kw">Failed</span> asserting that two strings are equal. 172<span class="ex">Failed</span> asserting that two strings are equal.
175<span class="kw">---</span> Expected 173<span class="ex">---</span> Expected
176<span class="kw">+++</span> Actual 174<span class="ex">+++</span> Actual
177<span class="kw">@@</span> @@ 175<span class="ex">@@</span> @@
178<span class="kw">-</span><span class="st">&#39;e3edea8ea7bb50be4bcb404df53fbb4546a7156e&#39;</span> 176<span class="ex">-</span><span class="st">&#39;e3edea8ea7bb50be4bcb404df53fbb4546a7156e&#39;</span>
179<span class="kw">+</span><span class="st">&#39;85eab0c610d4f68025f6ed6e6b6b5fabd4b55834&#39;</span> 177<span class="ex">+</span><span class="st">&#39;85eab0c610d4f68025f6ed6e6b6b5fabd4b55834&#39;</span>
180 178
181<span class="kw">/home/virtualtam/public_html/shaarli/tests</span>/LinkDBTest.php:<span class="kw">121</span> 179<span class="ex">/home/virtualtam/public_html/shaarli/tests</span>/LinkDBTest.php:<span class="ex">121</span>
182 180
183<span class="kw">2</span>) <span class="kw">LinkDBTest</span>::testCheckDBLoad 181<span class="ex">2</span>) <span class="ex">LinkDBTest</span>::testCheckDBLoad
184<span class="kw">Failed</span> asserting that two strings are equal. 182<span class="ex">Failed</span> asserting that two strings are equal.
185<span class="kw">---</span> Expected 183<span class="ex">---</span> Expected
186<span class="kw">+++</span> Actual 184<span class="ex">+++</span> Actual
187<span class="kw">@@</span> @@ 185<span class="ex">@@</span> @@
188<span class="kw">-</span><span class="st">&#39;e3edea8ea7bb50be4bcb404df53fbb4546a7156e&#39;</span> 186<span class="ex">-</span><span class="st">&#39;e3edea8ea7bb50be4bcb404df53fbb4546a7156e&#39;</span>
189<span class="kw">+</span><span class="st">&#39;85eab0c610d4f68025f6ed6e6b6b5fabd4b55834&#39;</span> 187<span class="ex">+</span><span class="st">&#39;85eab0c610d4f68025f6ed6e6b6b5fabd4b55834&#39;</span>
190 188
191<span class="kw">/home/virtualtam/public_html/shaarli/tests</span>/LinkDBTest.php:<span class="kw">133</span> 189<span class="ex">/home/virtualtam/public_html/shaarli/tests</span>/LinkDBTest.php:<span class="ex">133</span>
192 190
193<span class="kw">FAILURES</span>! 191<span class="ex">FAILURES</span>!
194<span class="kw">Tests</span>: 36, Assertions: 63, Errors: 1, Failures: 2.</code></pre></div> 192<span class="ex">Tests</span>: 36, Assertions: 63, Errors: 1, Failures: 2.</code></pre></div>
195<h4 id="test-results-and-coverage">Test results and coverage</h4> 193<h4 id="test-results-and-coverage">Test results and coverage</h4>
196<p>By default, PHPUnit will run all suitable tests found under the <code>tests</code> directory.</p> 194<p>By default, PHPUnit will run all suitable tests found under the <code>tests</code> directory.</p>
197<p>Each test has 3 possible outcomes:</p> 195<p>Each test has 3 possible outcomes:</p>