diff options
author | ctrlaltca <ctrlaltca@gmail.com> | 2014-08-26 16:59:21 +0200 |
---|---|---|
committer | ctrlaltca <ctrlaltca@gmail.com> | 2014-08-26 16:59:21 +0200 |
commit | 74b31be9515eddfa63005d6760614badfaba9fea (patch) | |
tree | 47c952901dcb5eccd6dd8b7c6ee7e0b6bf176510 /tests/unit/Data | |
parent | 2b11341614ac4a15be697fa8acad07055154ac54 (diff) | |
parent | 0c5026b55cde5c104f10686afd8b441568175d38 (diff) |
Backports for Prado 3.2.4
Diffstat (limited to 'tests/unit/Data')
-rw-r--r-- | tests/unit/Data/DataGateway/AllTests.php | 7 | ||||
-rw-r--r-- | tests/unit/Data/DataGateway/TSqlCriteriaTest.php | 25 | ||||
-rw-r--r-- | tests/unit/Data/SqlMap/AllTests.php | 1 | ||||
-rw-r--r-- | tests/unit/Data/SqlMap/DataMapper/AllTests.php | 3 | ||||
-rw-r--r-- | tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php | 2 | ||||
-rw-r--r-- | tests/unit/Data/SqlMap/DynamicParameterTest.php | 2 | ||||
-rw-r--r-- | tests/unit/Data/TDbCommandTest.php | 6 | ||||
-rw-r--r-- | tests/unit/Data/TDbConnectionTest.php | 6 | ||||
-rw-r--r-- | tests/unit/Data/TDbDataReaderTest.php | 6 | ||||
-rw-r--r-- | tests/unit/Data/TDbTransactionTest.php | 6 | ||||
-rw-r--r-- | tests/unit/Data/runtime/.gitignore | 2 |
11 files changed, 34 insertions, 32 deletions
diff --git a/tests/unit/Data/DataGateway/AllTests.php b/tests/unit/Data/DataGateway/AllTests.php index f9ba1ddc..6007ae70 100644 --- a/tests/unit/Data/DataGateway/AllTests.php +++ b/tests/unit/Data/DataGateway/AllTests.php @@ -12,12 +12,12 @@ class Data_DataGateway_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Data.DataGateway'); - + $suite->addTestSuite('TSqlCriteriaTest'); - + return $suite; } } @@ -25,4 +25,3 @@ class Data_DataGateway_AllTests { if(PHPUnit_MAIN_METHOD == 'Data_DataGateway_AllTests::main') { Data_DataGateway_AllTests::main(); } -?> diff --git a/tests/unit/Data/DataGateway/TSqlCriteriaTest.php b/tests/unit/Data/DataGateway/TSqlCriteriaTest.php index fb9c72b2..ce22ef1d 100644 --- a/tests/unit/Data/DataGateway/TSqlCriteriaTest.php +++ b/tests/unit/Data/DataGateway/TSqlCriteriaTest.php @@ -17,7 +17,7 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { public function testConstruct() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testConditionWithOrderByColumnNames() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references ORDER BY field1 ASC, field2 DESC"; @@ -27,7 +27,7 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { self::assertEquals(true, isset($criteria->OrdersBy['field2'])); self::assertEquals('DESC', $criteria->OrdersBy['field2']); } - + public function testConditionWithOrderByExpression() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references ORDER BY RAND()"; @@ -42,7 +42,7 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { self::assertEquals("SELECT * FROM table_references", $criteria->Condition); self::assertEquals(2, $criteria->Limit); } - + public function testConditionWithOrderByAndLimitAndOffset() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references ORDER BY field1 ASC, field2 DESC LIMIT 3, 2"; @@ -50,7 +50,7 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { self::assertEquals(2, $criteria->Limit); self::assertEquals(3, $criteria->Offset); } - + public function testConditionWithOrderByAndLimitAndOffsetVariant() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references ORDER BY field1 ASC, field2 DESC LIMIT 2 OFFSET 3"; @@ -58,14 +58,14 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { self::assertEquals(2, $criteria->Limit); self::assertEquals(3, $criteria->Offset); } - + public function testConditionWithLimit() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references LIMIT 2"; self::assertEquals("SELECT * FROM table_references", $criteria->Condition); self::assertEquals(2, $criteria->Limit); } - + public function testConditionWithLimitAndOffset() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references LIMIT 3, 2"; @@ -73,7 +73,7 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { self::assertEquals(2, $criteria->Limit); self::assertEquals(3, $criteria->Offset); } - + public function testConditionWithLimitAndOffsetVariant() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references LIMIT 2 OFFSET 3"; @@ -85,27 +85,26 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { public function testParameters() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testIsNamedParameters() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOrdersBy() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testLimit() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOffset() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testToString() { throw new PHPUnit_Framework_IncompleteTestError(); } } -?> diff --git a/tests/unit/Data/SqlMap/AllTests.php b/tests/unit/Data/SqlMap/AllTests.php index 3adaa29c..08870eb3 100644 --- a/tests/unit/Data/SqlMap/AllTests.php +++ b/tests/unit/Data/SqlMap/AllTests.php @@ -27,4 +27,3 @@ class Data_SqlMap_AllTests { if(PHPUnit_MAIN_METHOD == 'Data_SqlMap_AllTests::main') { Data_SqlMap_AllTests::main(); } -?> diff --git a/tests/unit/Data/SqlMap/DataMapper/AllTests.php b/tests/unit/Data/SqlMap/DataMapper/AllTests.php index 47b8522f..d685d474 100644 --- a/tests/unit/Data/SqlMap/DataMapper/AllTests.php +++ b/tests/unit/Data/SqlMap/DataMapper/AllTests.php @@ -24,5 +24,4 @@ class Data_SqlMap_DataMapper_AllTests { if(PHPUnit_MAIN_METHOD == 'Data_SqlMap_DataMapper_AllTests::main') { Data_SqlMap_DataMapper_AllTests::main(); -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php b/tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php index 61747c6b..3f5493c7 100644 --- a/tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php +++ b/tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php @@ -265,5 +265,3 @@ class _PropertyAccessTestHelperDynamicProperties } } } - -?>
\ No newline at end of file diff --git a/tests/unit/Data/SqlMap/DynamicParameterTest.php b/tests/unit/Data/SqlMap/DynamicParameterTest.php index 64f5e35c..136111db 100644 --- a/tests/unit/Data/SqlMap/DynamicParameterTest.php +++ b/tests/unit/Data/SqlMap/DynamicParameterTest.php @@ -105,5 +105,3 @@ class DynamicParameterTest extends PHPUnit_Framework_TestCase } } - -?>
\ No newline at end of file diff --git a/tests/unit/Data/TDbCommandTest.php b/tests/unit/Data/TDbCommandTest.php index a75674bf..87bbbf05 100644 --- a/tests/unit/Data/TDbCommandTest.php +++ b/tests/unit/Data/TDbCommandTest.php @@ -15,6 +15,10 @@ class TDbCommandTest extends PHPUnit_Framework_TestCase public function setUp() { @unlink(TEST_DB_FILE); + + // create application just to provide application mode + new TApplication(__DIR__, false ,TApplication::CONFIG_TYPE_PHP); + $this->_connection=new TDbConnection('sqlite:'.TEST_DB_FILE); $this->_connection->Active=true; $this->_connection->createCommand('CREATE TABLE foo (id INTEGER NOT NULL PRIMARY KEY, name VARCHAR(8))')->execute(); @@ -216,5 +220,3 @@ class TDbCommandTest extends PHPUnit_Framework_TestCase } } } - -?>
\ No newline at end of file diff --git a/tests/unit/Data/TDbConnectionTest.php b/tests/unit/Data/TDbConnectionTest.php index 8f6ff34f..4b32300c 100644 --- a/tests/unit/Data/TDbConnectionTest.php +++ b/tests/unit/Data/TDbConnectionTest.php @@ -19,6 +19,10 @@ class TDbConnectionTest extends PHPUnit_Framework_TestCase { @unlink(TEST_DB_FILE); @unlink(TEST_DB_FILE2); + + // create application just to provide application mode + new TApplication(__DIR__, false ,TApplication::CONFIG_TYPE_PHP); + $this->_connection1=new TDbConnection('sqlite:'.TEST_DB_FILE); $this->_connection1->Active=true; $this->_connection1->createCommand('CREATE TABLE foo (id INTEGER NOT NULL PRIMARY KEY, name VARCHAR(8))')->execute(); @@ -121,5 +125,3 @@ class TDbConnectionTest extends PHPUnit_Framework_TestCase $this->assertEquals(TDbNullConversionMode::NullToEmptyString,$this->_connection1->NullConversion); } } - -?>
\ No newline at end of file diff --git a/tests/unit/Data/TDbDataReaderTest.php b/tests/unit/Data/TDbDataReaderTest.php index 98aa0385..2e31245e 100644 --- a/tests/unit/Data/TDbDataReaderTest.php +++ b/tests/unit/Data/TDbDataReaderTest.php @@ -37,6 +37,10 @@ class TDbDataReaderTest extends PHPUnit_Framework_TestCase public function setUp() { @unlink(TEST_DB_FILE); + + // create application just to provide application mode + new TApplication(__DIR__, false ,TApplication::CONFIG_TYPE_PHP); + $this->_connection=new TDbConnection('sqlite:'.TEST_DB_FILE); $this->_connection->Active=true; $this->_connection->createCommand('CREATE TABLE foo (id INTEGER NOT NULL PRIMARY KEY, name VARCHAR(8))')->execute(); @@ -174,5 +178,3 @@ class TDbDataReaderTest extends PHPUnit_Framework_TestCase $this->assertEquals($name,'my name 2'); } } - -?>
\ No newline at end of file diff --git a/tests/unit/Data/TDbTransactionTest.php b/tests/unit/Data/TDbTransactionTest.php index c608bce1..b51fda04 100644 --- a/tests/unit/Data/TDbTransactionTest.php +++ b/tests/unit/Data/TDbTransactionTest.php @@ -15,6 +15,10 @@ class TDbTransactionTest extends PHPUnit_Framework_TestCase public function setUp() { @unlink(TEST_DB_FILE); + + // create application just to provide application mode + new TApplication(__DIR__, false ,TApplication::CONFIG_TYPE_PHP); + $this->_connection=new TDbConnection('sqlite:'.TEST_DB_FILE); $this->_connection->Active=true; $this->_connection->createCommand('CREATE TABLE foo (id INTEGER NOT NULL PRIMARY KEY, name VARCHAR(8))')->execute(); @@ -68,5 +72,3 @@ class TDbTransactionTest extends PHPUnit_Framework_TestCase $this->assertEquals(count($result),2); } } - -?>
\ No newline at end of file diff --git a/tests/unit/Data/runtime/.gitignore b/tests/unit/Data/runtime/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/tests/unit/Data/runtime/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore |