source: trunk/server/www/vendors/simpletest/test/unit_tester_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: 1.4 KB
Line 
1<?php
2// $Id: unit_tester_test.php 1509 2007-05-08 22:11:49Z lastcraft $
3require_once(dirname(__FILE__) . '/../autorun.php');
4
5class ReferenceForTesting {
6}
7
8class TestOfUnitTester extends UnitTestCase {
9   
10    function testAssertTrueReturnsAssertionAsBoolean() {
11        $this->assertTrue($this->assertTrue(true));
12    }
13   
14    function testAssertFalseReturnsAssertionAsBoolean() {
15        $this->assertTrue($this->assertFalse(false));
16    }
17   
18    function testAssertEqualReturnsAssertionAsBoolean() {
19        $this->assertTrue($this->assertEqual(5, 5));
20    }
21   
22    function testAssertIdenticalReturnsAssertionAsBoolean() {
23        $this->assertTrue($this->assertIdentical(5, 5));
24    }
25   
26    function testCoreAssertionsDoNotThrowErrors() {
27        $this->assertIsA($this, 'UnitTestCase');
28        $this->assertNotA($this, 'WebTestCase');
29    }
30   
31    function testReferenceAssertionOnObjects() {
32        $a = &new ReferenceForTesting();
33        $b = &$a;
34        $this->assertReference($a, $b);
35    }
36   
37    function testReferenceAssertionOnScalars() {
38        $a = 25;
39        $b = &$a;
40        $this->assertReference($a, $b);
41    }
42   
43    function testCloneOnObjects() {
44        $a = &new ReferenceForTesting();
45        $b = &new ReferenceForTesting();
46        $this->assertClone($a, $b);
47    }
48   
49    function testCloneOnScalars() {
50        $a = 25;
51        $b = 25;
52        $this->assertClone($a, $b);
53    }
54}
55?>
Note: See TracBrowser for help on using the repository browser.