summaryrefslogtreecommitdiff
path: root/demos/sqlmap-sample/tests/PersonTest.php
diff options
context:
space:
mode:
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