cvs: presentations /slides/advanced runtests t_golden.xml t_unit.xml t_unit_phpunit1.xml t_unit_phpunit2.xml t_unit_phpunit3.xml url_parser1.phpt
| From: | Sterling Hughes | Date: | Wed, 14 May 2003 04:04:19 +0000 |
| Subject: | cvs: presentations /slides/advanced runtests t_golden.xml t_unit.xml t_unit_phpunit1.xml t_unit_phpunit2.xml t_unit_phpunit3.xml url_parser1.phpt | ||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-722@lists.php.net to get a copy of this message | ||
sterling Wed May 14 00:04:19 2003 EDT
Added files:
/presentations/slides/advanced runtests t_unit_phpunit3.xml
url_parser1.phpt
Modified files:
/presentations/slides/advanced t_golden.xml t_unit.xml
t_unit_phpunit1.xml
t_unit_phpunit2.xml
Log:
more unit stuff
Index: presentations/slides/advanced/t_golden.xml
diff -u presentations/slides/advanced/t_golden.xml:1.2
presentations/slides/advanced/t_golden.xml:1.3
--- presentations/slides/advanced/t_golden.xml:1.2 Tue May 13 13:15:30 2003
+++ presentations/slides/advanced/t_golden.xml Wed May 14 00:04:19 2003
@@ -1,7 +1,7 @@
<slide title="The Golden Rule">
<image filename="testing.jpg" align="right"/>
-<break lines="5"/>
-<image align="right" filename="pie_gates.jpg"
marginright="4.0em"/>
+<break lines="6"/>
+<image align="right" filename="pie_gates.jpg" marginright="3.0em"
marginleft="2.0em"/>
<break lines="3"/>
<blurb fontsize="5.0em" align="center"
marginright="1.0em">~Nobody Cares If It Works For You.~</blurb>
</slide>
Index: presentations/slides/advanced/t_unit.xml
diff -u presentations/slides/advanced/t_unit.xml:1.2 presentations/slides/advanced/t_unit.xml:1.3
--- presentations/slides/advanced/t_unit.xml:1.2 Tue May 13 13:15:30 2003
+++ presentations/slides/advanced/t_unit.xml Wed May 14 00:04:19 2003
@@ -1,6 +1,6 @@
<slide title="Unit Testing">
<image filename="testing.jpg" align="right"/>
-<break lines="4"/>
+<break lines="6"/>
<list>
<bullet>Testing Small Portions (~Units~) of Code</bullet>
<bullet>Make Sure Nothing Breaks (~Regression Tests~)</bullet>
Index: presentations/slides/advanced/t_unit_phpunit1.xml
diff -u presentations/slides/advanced/t_unit_phpunit1.xml:1.4
presentations/slides/advanced/t_unit_phpunit1.xml:1.5
--- presentations/slides/advanced/t_unit_phpunit1.xml:1.4 Tue May 13 23:13:27 2003
+++ presentations/slides/advanced/t_unit_phpunit1.xml Wed May 14 00:04:19 2003
@@ -1,7 +1,7 @@
<slide title="Using PHPUnit">
<image filename="testing.jpg" align="right"/>
-<break lines="2"/>
+<break/>
<blurb fontsize="3.0em">Remember, Tests First!</blurb>
-<break lines="2"/>
-<example filename="url_parser.phpt" result="1"
fontsize="1.5em"/>
+<break/>
+<example title="url_parser.phpt" filename="url_parser.phpt"
result="1" fontsize="1.5em"/>
</slide>
Index: presentations/slides/advanced/t_unit_phpunit2.xml
diff -u presentations/slides/advanced/t_unit_phpunit2.xml:1.3
presentations/slides/advanced/t_unit_phpunit2.xml:1.4
--- presentations/slides/advanced/t_unit_phpunit2.xml:1.3 Tue May 13 23:20:00 2003
+++ presentations/slides/advanced/t_unit_phpunit2.xml Wed May 14 00:04:19 2003
@@ -1,6 +1,7 @@
<slide title="url_parser">
<image filename="testing.jpg" align="right"/>
-<break lines="1"/>
+<break/>
<blurb>Can you spot the error(~s~) in this code?</blurb>
+<break/>
<example filename="url_parser.php" fontsize="1.7em"/>
</slide>
Index: presentations/slides/advanced/t_unit_phpunit3.xml
+++ presentations/slides/advanced/t_unit_phpunit3.xml
<slide title="Broken Tests">
<image filename="testing.jpg" align="right"/>
<break/>
<blurb>Let's add our test!</blurb>
<break/>
<example title="url_parser1.phpt" filename="url_parser1.phpt"
fontsize="1.5em" result="1"/>
</slide>
Index: presentations/slides/advanced/url_parser1.phpt
+++ presentations/slides/advanced/url_parser1.phpt
<?php
require_once('PHPUnit.php');
require_once('url_parser.php');
class url_parser_t extends PHPUnit_TestCase {
private $data = 'This is some sample data with
a <a title=">" href="http://www.google.com/">link</a>
or <a href="http://www.alltheweb.com/">two</a>.';
function test_link_list() {
$u = new url_parser;
$u->search_document($this->data);
self::assertEquals('http://www.google.com/',
$u->url_list[0]);
}
}
$suite = new PHPUnit_TestSuite();
$suite->addTest(new url_parser_t('test_link_list'));
$result = PHPUnit::run($suite);
echo nl2br($result->toString());
?>