summaryrefslogtreecommitdiff
path: root/demos/sqlmap-sample/tests/PersonTest.php
diff options
context:
space:
mode:
authorwei <>2006-07-14 09:20:45 +0000
committerwei <>2006-07-14 09:20:45 +0000
commit4b78404c20490a615459267426ce9e6737bf4485 (patch)
treebe68ab7a2155980b05e5ab9f454e991e93007563 /demos/sqlmap-sample/tests/PersonTest.php
parent143980b6dab8ad87c44518e5b7befb614fb83b85 (diff)
Moving files.
Diffstat (limited to 'demos/sqlmap-sample/tests/PersonTest.php')
-rw-r--r--demos/sqlmap-sample/tests/PersonTest.php57
1 files changed, 0 insertions, 57 deletions
diff --git a/demos/sqlmap-sample/tests/PersonTest.php b/demos/sqlmap-sample/tests/PersonTest.php
deleted file mode 100644
index c40bffa0..00000000
--- a/demos/sqlmap-sample/tests/PersonTest.php
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-
-class PersonTest extends UnitTestCase
-{
- function testPersonList()
- {
- //try it
- $people = TMapper::instance()->queryForList("SelectAll");
-
- //test it
- $this->assertNotNull($people, "Person list is not returned");
- $this->assertTrue(count($people) > 0, "Person list is empty");
- $person = $people[0];
- $this->assertNotNull($person, "Person not returned");
- }
-
- function testPersonUpdate()
- {
- $expect = "wei";
- $edited = "Nah";
-
- //get it;
- $person = TMapper::instance()->queryForObject("Select", 1);
-
- //test it
- $this->assertNotNull($person);
- $this->assertEqual($expect, $person->FirstName);
-
- //change it
- $person->FirstName = $edited;
- TMapper::instance()->update("Update", $person);
-
- //get it again
- $person = TMapper::instance()->queryForObject("Select", 1);
-
- //test it
- $this->assertEqual($edited, $person->FirstName);
-
- //change it back
- $person->FirstName = $expect;
- TMapper::instance()->update("Update", $person);
- }
-
- function testPersonDelete()
- {
- //insert it
- $person = new Person;
- $person->ID = -1;
- TMapper::instance()->insert("Insert", $person);
-
- //delte it
- $count = TMapper::instance()->delete("Delete", -1);
- $this->assertEqual(1, $count);
- }
-}
-
-?> \ No newline at end of file