@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | |
23 | 23 | class AllTests { |
24 | 24 | public static function main() { |
25 | - PHPUnit_TextUI_TestRunner::run(self::suite()); |
|
25 | + PHPUnit_TextUI_TestRunner::run(self::suite()); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | public static function suite() { |
29 | - $suite = new PHPUnit_Framework_TestSuite('PRADO PHP Framework'); |
|
29 | + $suite = new PHPUnit_Framework_TestSuite('PRADO PHP Framework'); |
|
30 | 30 | |
31 | 31 | $suite->addTest(Xml_AllTests::suite()); |
32 | 32 | $suite->addTest(IO_AllTests::suite()); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | $suite->addTestSuite('TComponentTest'); |
45 | 45 | |
46 | - return $suite; |
|
46 | + return $suite; |
|
47 | 47 | } |
48 | 48 | } |
49 | 49 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(!defined('PHPUnit_MAIN_METHOD')) { |
|
3 | +if (!defined('PHPUnit_MAIN_METHOD')) { |
|
4 | 4 | define('PHPUnit_MAIN_METHOD', 'AllTests::main'); |
5 | 5 | } |
6 | 6 | |
@@ -47,6 +47,6 @@ discard block |
||
47 | 47 | } |
48 | 48 | } |
49 | 49 | |
50 | -if(PHPUnit_MAIN_METHOD == 'AllTests::main') { |
|
50 | +if (PHPUnit_MAIN_METHOD == 'AllTests::main') { |
|
51 | 51 | AllTests::main(); |
52 | 52 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once(dirname(__FILE__).'/BaseGatewayTest.php'); |
|
3 | +require_once(dirname(__FILE__) . '/BaseGatewayTest.php'); |
|
4 | 4 | |
5 | 5 | class TestFindByPk extends BaseGatewayTest |
6 | 6 | { |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | { |
27 | 27 | $gateway = $this->getGateway2(); |
28 | 28 | |
29 | - $result = $gateway->findByPk(1,1); |
|
29 | + $result = $gateway->findByPk(1, 1); |
|
30 | 30 | $expect = array("department_id" => 1, "section_id" => 1, "order" => 0); |
31 | 31 | $this->assertEqual($expect, $result); |
32 | 32 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | $gateway = $this->getGateway2(); |
37 | 37 | |
38 | - $result = $gateway->findAllByPks(array(1,1), array(3,13))->readAll(); |
|
38 | + $result = $gateway->findAllByPks(array(1, 1), array(3, 13))->readAll(); |
|
39 | 39 | |
40 | 40 | $expect = array( |
41 | 41 | array("department_id" => 1, "section_id" => 1, "order" => 0), |
@@ -12,9 +12,9 @@ discard block |
||
12 | 12 | */ |
13 | 13 | function getGateway() |
14 | 14 | { |
15 | - if($this->gateway1===null) |
|
15 | + if ($this->gateway1 === null) |
|
16 | 16 | { |
17 | - $conn = new TDbConnection('pgsql:host=localhost;dbname=test', 'test','test'); |
|
17 | + $conn = new TDbConnection('pgsql:host=localhost;dbname=test', 'test', 'test'); |
|
18 | 18 | $this->gateway1 = new TTableGateway('address', $conn); |
19 | 19 | } |
20 | 20 | return $this->gateway1; |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | */ |
26 | 26 | function getGateway2() |
27 | 27 | { |
28 | - if($this->gateway2===null) |
|
28 | + if ($this->gateway2 === null) |
|
29 | 29 | { |
30 | - $conn = new TDbConnection('pgsql:host=localhost;dbname=test', 'test','test'); |
|
30 | + $conn = new TDbConnection('pgsql:host=localhost;dbname=test', 'test', 'test'); |
|
31 | 31 | $this->gateway2 = new TTableGateway('department_sections', $conn); |
32 | 32 | } |
33 | 33 | return $this->gateway2; |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once(dirname(__FILE__).'/BaseGatewayTest.php'); |
|
3 | +require_once(dirname(__FILE__) . '/BaseGatewayTest.php'); |
|
4 | 4 | |
5 | 5 | class CountTest extends BaseGatewayTest |
6 | 6 | { |
7 | 7 | function test_simple_count() |
8 | 8 | { |
9 | 9 | $result = $this->getGateway2()->count(); |
10 | - $this->assertEqual(44,$result); |
|
10 | + $this->assertEqual(44, $result); |
|
11 | 11 | |
12 | 12 | $result = $this->getGateway2()->count('department_id = ?', 1); |
13 | 13 | $this->assertEqual(4, $result); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once(dirname(__FILE__).'/BaseGatewayTest.php'); |
|
3 | +require_once(dirname(__FILE__) . '/BaseGatewayTest.php'); |
|
4 | 4 | |
5 | 5 | class DeleteByPkTest extends BaseGatewayTest |
6 | 6 | { |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | include_once '../test_tools/unit_tests.php'; |
4 | -$test_cases = dirname(__FILE__)."/"; |
|
4 | +$test_cases = dirname(__FILE__) . "/"; |
|
5 | 5 | |
6 | 6 | $tester = new PradoUnitTester($test_cases); |
7 | 7 | $tester->run(new HtmlReporter()); |
@@ -9,12 +9,12 @@ |
||
9 | 9 | $manager = new TSqlMapManager(); |
10 | 10 | try |
11 | 11 | { |
12 | - $manager->configureXml(dirname(__FILE__).'/sqlmap.xml'); |
|
12 | + $manager->configureXml(dirname(__FILE__) . '/sqlmap.xml'); |
|
13 | 13 | $this->fail(); |
14 | - }catch(TSqlMapConfigurationException $e) |
|
14 | + } catch (TSqlMapConfigurationException $e) |
|
15 | 15 | { |
16 | 16 | $expect = 'Invalid property \'parametrClass\' for class \'TSqlMapStatement\' for tag \'<statement id="findNotVisitedWatchedTopicList"'; |
17 | - $this->assertEqual(strpos($e->getMessage(),$expect),0); |
|
17 | + $this->assertEqual(strpos($e->getMessage(), $expect), 0); |
|
18 | 18 | } |
19 | 19 | } |
20 | 20 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | { |
12 | 12 | $manager->configureXml(dirname(__FILE__).'/sqlmap.xml'); |
13 | 13 | $this->fail(); |
14 | - }catch(TSqlMapConfigurationException $e) |
|
14 | + } catch(TSqlMapConfigurationException $e) |
|
15 | 15 | { |
16 | 16 | $expect = 'Invalid property \'parametrClass\' for class \'TSqlMapStatement\' for tag \'<statement id="findNotVisitedWatchedTopicList"'; |
17 | 17 | $this->assertEqual(strpos($e->getMessage(),$expect),0); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | function setup() |
9 | 9 | { |
10 | 10 | $config = new TSqlMapConfig(); |
11 | - $config->ConfigFile = dirname(__FILE__).'/maps/tests.xml'; |
|
11 | + $config->ConfigFile = dirname(__FILE__) . '/maps/tests.xml'; |
|
12 | 12 | $this->sqlmap = $config->getClient(); |
13 | 13 | } |
14 | 14 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -require_once(dirname(__FILE__).'/BaseCase.php'); |
|
2 | +require_once(dirname(__FILE__) . '/BaseCase.php'); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * @package System.DataAccess.SQLMap |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | function testBooleanWithoutResultClass() |
28 | 28 | { |
29 | - $bit = (boolean)$this->sqlmap->queryForObject("GetBooleanWithoutResultClass", 1); |
|
29 | + $bit = (boolean) $this->sqlmap->queryForObject("GetBooleanWithoutResultClass", 1); |
|
30 | 30 | $this->assertIdentical(true, $bit); |
31 | 31 | } |
32 | 32 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | function testByte() |
37 | 37 | { |
38 | 38 | $letter = $this->sqlmap->queryForObject("GetByte", 1); |
39 | - $this->assertIdentical(155, (int)$letter); |
|
39 | + $this->assertIdentical(155, (int) $letter); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | function testByteWithoutResultClass() |
46 | 46 | { |
47 | 47 | $letter = $this->sqlmap->queryForObject("GetByteWithoutResultClass", 1); |
48 | - $this->assertIdentical(155, (int)$letter); |
|
48 | + $this->assertIdentical(155, (int) $letter); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | function testDecimalWithoutResultClass() |
105 | 105 | { |
106 | 106 | $price = $this->sqlmap->queryForObject("GetDecimalWithoutResultClass", 1); |
107 | - $this->assertIdentical(1.56, (float)$price); |
|
107 | + $this->assertIdentical(1.56, (float) $price); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | function testDoubleWithoutResultClass() |
123 | 123 | { |
124 | 124 | $price = $this->sqlmap->queryForObject("GetDoubleWithoutResultClass", 1); |
125 | - $this->assertIdentical(99.5, (float)$price); |
|
125 | + $this->assertIdentical(99.5, (float) $price); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | function testInt16WithoutResultClass() |
169 | 169 | { |
170 | 170 | $integer = $this->sqlmap->queryForObject("GetInt16WithoutResultClass", 1); |
171 | - $this->assertIdentical(32111, (int)$integer); |
|
171 | + $this->assertIdentical(32111, (int) $integer); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | function testInt32WithoutResultClass() |
187 | 187 | { |
188 | 188 | $integer = $this->sqlmap->queryForObject("GetInt32WithoutResultClass", 1); |
189 | - $this->assertIdentical(999999, (int)$integer); |
|
189 | + $this->assertIdentical(999999, (int) $integer); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | /** |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | function testInt64WithoutResultClass() |
205 | 205 | { |
206 | 206 | $bigInt = $this->sqlmap->queryForObject("GetInt64WithoutResultClass", 1); |
207 | - $this->assertIdentical(9223372036854775800, (double)$bigInt); |
|
207 | + $this->assertIdentical(9223372036854775800, (double) $bigInt); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | /** |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | */ |
213 | 213 | function testSingle() |
214 | 214 | { |
215 | - $price = (float)$this->sqlmap->queryForObject("GetSingle", 1); |
|
215 | + $price = (float) $this->sqlmap->queryForObject("GetSingle", 1); |
|
216 | 216 | $this->assertIdentical(92233.5, $price); |
217 | 217 | } |
218 | 218 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | function testSingleWithoutResultClass() |
223 | 223 | { |
224 | 224 | $price = $this->sqlmap->queryForObject("GetSingleWithoutResultClass", 1); |
225 | - $this->assertIdentical(92233.5, (float)$price); |
|
225 | + $this->assertIdentical(92233.5, (float) $price); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | /** |