cvs: presentations /slides/advanced Test_EmailAddress.php

From: Date: Tue, 13 May 2003 03:53:12 +0000
Subject: cvs: presentations /slides/advanced Test_EmailAddress.php
Groups: php.pres 
Request: Send a blank email to pres+get-710@lists.php.net to get a copy of this message
sterling Mon May 12 23:53:12 2003 EDT Modified files: /presentations/slides/advanced Test_EmailAddress.php Log: fixes Index: presentations/slides/advanced/Test_EmailAddress.php diff -u presentations/slides/advanced/Test_EmailAddress.php:1.1 presentations/slides/advanced/Test_EmailAddress.php:1.2 --- presentations/slides/advanced/Test_EmailAddress.php:1.1 Mon May 12 23:32:26 2003 +++ presentations/slides/advanced/Test_EmailAddress.php Mon May 12 23:53:12 2003 @@ -3,14 +3,19 @@ require_once('EmailAddress.php'); class Test_EmailAddress extends PHPUnit_TestCase { + private $address = 'sterling@php.net'; + function Test_UserPart() { - $email = new EmailAddress('sterling@php.net'); - self::assertTrue($email->user == 'sterling'); + $email = new EmailAddress($this->address); + self::assertTrue( + $email->user == 'sterling', + "{$email->host} != {$this->address}\n" + ); } function Test_ServerPart() { - $email = new EmailAddress('sterling@php.net'); - self::assertTrue($email->host == 'php.net'); + $email = new EmailAddress($this->address); + self::assertEquals($email->host, 'php.net'); } } @@ -21,5 +26,5 @@ ); $result = PHPUnit::run($suite); -echo $result->toString(); +echo nl2br($result->toString()); ?>

« previous php.pres (#710) next »