diff options
author | wei <> | 2006-07-14 09:20:45 +0000 |
---|---|---|
committer | wei <> | 2006-07-14 09:20:45 +0000 |
commit | 4b78404c20490a615459267426ce9e6737bf4485 (patch) | |
tree | be68ab7a2155980b05e5ab9f454e991e93007563 /demos/sqlmap-sample/tests | |
parent | 143980b6dab8ad87c44518e5b7befb614fb83b85 (diff) |
Moving files.
Diffstat (limited to 'demos/sqlmap-sample/tests')
-rw-r--r-- | demos/sqlmap-sample/tests/PersonTest.php | 57 | ||||
-rw-r--r-- | demos/sqlmap-sample/tests/readme.txt | 1 | ||||
-rw-r--r-- | demos/sqlmap-sample/tests/run_tests.php | 33 | ||||
-rw-r--r-- | demos/sqlmap-sample/tests/sqlmap.xml | 13 |
4 files changed, 0 insertions, 104 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 diff --git a/demos/sqlmap-sample/tests/readme.txt b/demos/sqlmap-sample/tests/readme.txt deleted file mode 100644 index c0d0afdb..00000000 --- a/demos/sqlmap-sample/tests/readme.txt +++ /dev/null @@ -1 +0,0 @@ -The ''Data'' directory and ''Data/test.db'' must be writable by PHP for SQLite database to work.
\ No newline at end of file diff --git a/demos/sqlmap-sample/tests/run_tests.php b/demos/sqlmap-sample/tests/run_tests.php deleted file mode 100644 index 843d0a79..00000000 --- a/demos/sqlmap-sample/tests/run_tests.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php
-
-//define simple test location
-define('SIMPLE_TEST', realpath('../../../tests/UnitTests/simpletest'));
-
-//define prado framework location
-define('PRADO', realpath('../../../framework'));
-
-//define directory that contains business objects
-define('MY_MODELS', realpath('../protected/business-objects'));
-
-require_once(SIMPLE_TEST.'/unit_tester.php');
-require_once(SIMPLE_TEST.'/reporter.php');
-require_once(PRADO.'/prado.php');
-require_once(MY_MODELS.'/Person.php');
-
-//supress strict warnings
-error_reporting(E_ALL);
-
-//import Data mapper
-Prado::using('System.DataAccess.SQLMap.TMapper');
-
-//Add tests
-$test = new GroupTest('SQLMap Tutorial tests');
-$test->addTestFile('PersonTest.php');
-if(SimpleReporter::inCli())
- $reporter = new TextReporter();
-else
- $reporter = new HtmlReporter();
-$test->run($reporter);
-
-
-?>
\ No newline at end of file diff --git a/demos/sqlmap-sample/tests/sqlmap.xml b/demos/sqlmap-sample/tests/sqlmap.xml deleted file mode 100644 index 3968fab4..00000000 --- a/demos/sqlmap-sample/tests/sqlmap.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?>
-<sqlMapConfig>
-
- <provider class="TAdodbProvider">
- <datasource driver="sqlite" host="../protected/person-db/test.db" />
- </provider>
-
- <sqlMaps>
- <sqlMap resource="../protected/person-db/person.xml"/>
- <sqlMap resource="../protected/person-db/personHelper.xml"/>
- </sqlMaps>
-
-</sqlMapConfig>
\ No newline at end of file |