1--TEST--
2Test function show_source() by calling it with its expected arguments and php output, more test for highlight_file()
3--CREDITS--
4Francesco Fullone ff@ideato.it
5#PHPTestFest Cesena Italia on 2009-06-20
6--FILE--
7<?php
8echo "*** Test by calling method or function with its expected arguments and php output ***\n";
9$foo = 'bar';
10$baz = "something ".$foo."\n";
11
12if ( $foo == 'bar' )
13{
14  $baz = "baz\n";
15}
16
17 /* some code here */
18echo $baz;
19show_source(__FILE__);
20echo $foo;
21?>
22--EXPECT--
23*** Test by calling method or function with its expected arguments and php output ***
24baz
25<pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php
26</span><span style="color: #007700">echo </span><span style="color: #DD0000">"*** Test by calling method or function with its expected arguments and php output ***\n"</span><span style="color: #007700">;
27</span><span style="color: #0000BB">$foo </span><span style="color: #007700">= </span><span style="color: #DD0000">'bar'</span><span style="color: #007700">;
28</span><span style="color: #0000BB">$baz </span><span style="color: #007700">= </span><span style="color: #DD0000">"something "</span><span style="color: #007700">.</span><span style="color: #0000BB">$foo</span><span style="color: #007700">.</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;
29
30if ( </span><span style="color: #0000BB">$foo </span><span style="color: #007700">== </span><span style="color: #DD0000">'bar' </span><span style="color: #007700">)
31{
32  </span><span style="color: #0000BB">$baz </span><span style="color: #007700">= </span><span style="color: #DD0000">"baz\n"</span><span style="color: #007700">;
33}
34
35 </span><span style="color: #FF8000">/* some code here */
36</span><span style="color: #007700">echo </span><span style="color: #0000BB">$baz</span><span style="color: #007700">;
37</span><span style="color: #0000BB">show_source</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">);
38echo </span><span style="color: #0000BB">$foo</span><span style="color: #007700">;
39</span><span style="color: #0000BB">?&gt;
40</span></code></pre>bar
41