source: trunk/server/www/vendors/simpletest/test/socket_test.php @ 6

Last change on this file since 6 was 6, checked in by sander, 12 years ago

Added SimpleTest? test framework

File size: 781 bytes
Line 
1<?php
2// $Id: socket_test.php 1509 2007-05-08 22:11:49Z lastcraft $
3require_once(dirname(__FILE__) . '/../autorun.php');
4require_once(dirname(__FILE__) . '/../socket.php');
5Mock::generate('SimpleSocket');
6
7class TestOfSimpleStickyError extends UnitTestCase {
8   
9    function testSettingError() {
10        $error = new SimpleStickyError();
11        $this->assertFalse($error->isError());
12        $error->_setError('Ouch');
13        $this->assertTrue($error->isError());
14        $this->assertEqual($error->getError(), 'Ouch');
15    }
16   
17    function testClearingError() {
18        $error = new SimpleStickyError();
19        $error->_setError('Ouch');
20        $this->assertTrue($error->isError());
21        $error->_clearError();
22        $this->assertFalse($error->isError());
23    }
24}
25?>
Note: See TracBrowser for help on using the repository browser.