File: unit_tester_test.php

package info (click to toggle)
postfixadmin 2.3.5-2%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,200 kB
  • sloc: php: 25,767; xml: 14,485; perl: 964; sh: 664; python: 169; makefile: 84
file content (54 lines) | stat: -rw-r--r-- 1,600 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
    // $Id: unit_tester_test.php,v 1.11 2006/11/06 13:56:37 lastcraft Exp $
    
    class ReferenceForTesting {
    }
    
    class TestOfUnitTester extends UnitTestCase {
        
        function testAssertTrueReturnsAssertionAsBoolean() {
            $this->assertTrue($this->assertTrue(true));
        }
        
        function testAssertFalseReturnsAssertionAsBoolean() {
            $this->assertTrue($this->assertFalse(false));
        }
        
        function testAssertEqualReturnsAssertionAsBoolean() {
            $this->assertTrue($this->assertEqual(5, 5));
        }
        
        function testAssertIdenticalReturnsAssertionAsBoolean() {
            $this->assertTrue($this->assertIdentical(5, 5));
        }
        
        function testCoreAssertionsDoNotThrowErrors() {
            $this->assertIsA($this, 'UnitTestCase');
            $this->assertNotA($this, 'WebTestCase');
        }
        
        function testReferenceAssertionOnObjects() {
            $a = &new ReferenceForTesting();
            $b = &$a;
            $this->assertReference($a, $b);
        }
        
        function testReferenceAssertionOnScalars() {
            $a = 25;
            $b = &$a;
            $this->assertReference($a, $b);
        }
        
        function testCloneOnObjects() {
            $a = &new ReferenceForTesting();
            $b = &new ReferenceForTesting();
            $this->assertClone($a, $b);
        }
        
        function testCloneOnScalars() {
            $a = 25;
            $b = 25;
            $this->assertClone($a, $b);
        }
    }
?>