mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-25 22:29:55 +09:00
#17528788 : unittest framework added
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6001 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
ea7c87ec0d
commit
7619bce790
99 changed files with 31041 additions and 0 deletions
55
tests/simpletest/test/unit_tester_test.php
Normal file
55
tests/simpletest/test/unit_tester_test.php
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
// $Id: unit_tester_test.php 1509 2007-05-08 22:11:49Z lastcraft $
|
||||
require_once(dirname(__FILE__) . '/../autorun.php');
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue