Skip to content

Commit 126116f

Browse files
committed
FIX: php 5.3 compatibility
1 parent d4f9687 commit 126116f

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

tests/framework/db/schema/CMssqlCommandBuilderTest.php

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ public function setUp()
1818
*/
1919
$this->db = $this->getMockBuilder('CDbConnection')
2020
->disableOriginalConstructor()
21-
->setMethods(['open', 'getServerVersion', 'getSchema'])
21+
->setMethods(array('open', 'getServerVersion', 'getSchema'))
2222
->getMock();
2323

2424
$schema = $this->getMockBuilder('CMssqlSchema')
25-
->setConstructorArgs([$this->db])
26-
->setMethods(['getTable'])
25+
->setConstructorArgs(array($this->db))
26+
->setMethods(array('getTable'))
2727
->getMock();
2828

2929
$tableMetaData = new CMssqlTableSchema();
@@ -43,69 +43,69 @@ public function testCommandBuilderOldMssql()
4343
{
4444
$this->db->method('getServerVersion')->willReturn('10');
4545

46-
$command = $this->createFindCommand([
46+
$command = $this->createFindCommand(array(
4747
'limit'=>3,
48-
]);
48+
));
4949
$this->assertEquals('SELECT TOP 3 * FROM [dbo].[posts] [t]', $command->text);
5050

51-
$command = $this->createFindCommand([
51+
$command = $this->createFindCommand(array(
5252
'select'=>'id, title',
5353
'order'=>'title',
5454
'limit'=>2,
5555
'offset'=>3
56-
]);
56+
));
5757
$this->assertEquals('SELECT * FROM (SELECT TOP 2 * FROM (SELECT TOP 5 id, title FROM [dbo].[posts] [t] ORDER BY title) as [__inner__] ORDER BY title DESC) as [__outer__] ORDER BY title ASC', $command->text);
5858

59-
$command = $this->createFindCommand([
59+
$command = $this->createFindCommand(array(
6060
'limit'=>2,
6161
'offset'=>3
62-
]);
62+
));
6363
$this->assertEquals('SELECT * FROM (SELECT TOP 2 * FROM (SELECT TOP 5 * FROM [dbo].[posts] [t] ORDER BY id) as [__inner__] ORDER BY id DESC) as [__outer__] ORDER BY id ASC', $command->text);
6464

65-
$command = $this->createFindCommand([
65+
$command = $this->createFindCommand(array(
6666
'select'=>'title',
67-
]);
67+
));
6868
$this->assertEquals('SELECT title FROM [dbo].[posts] [t]', $command->text);
6969
}
7070

7171
public function testCommandBuilderNewMssql()
7272
{
7373
$this->db->method('getServerVersion')->willReturn('11');
7474

75-
$command = $this->createFindCommand([
75+
$command = $this->createFindCommand(array(
7676
'limit'=>3,
77-
]);
77+
));
7878
$this->assertEquals('SELECT TOP 3 * FROM [dbo].[posts] [t]', $command->text);
7979

80-
$command = $this->createFindCommand([
80+
$command = $this->createFindCommand(array(
8181
'select'=>'id, title',
8282
'order'=>'title',
8383
'limit'=>2,
8484
'offset'=>3,
85-
]);
85+
));
8686
$this->assertEquals('SELECT id, title FROM [dbo].[posts] [t] ORDER BY title OFFSET 3 ROWS FETCH NEXT 2 ROWS ONLY', $command->text);
8787

88-
$command = $this->createFindCommand([
88+
$command = $this->createFindCommand(array(
8989
'limit'=>2,
9090
'offset'=>3,
91-
]);
91+
));
9292
$this->assertEquals('SELECT * FROM [dbo].[posts] [t] ORDER BY id OFFSET 3 ROWS FETCH NEXT 2 ROWS ONLY', $command->text);
9393

9494

95-
$command = $this->createFindCommand([
95+
$command = $this->createFindCommand(array(
9696
'select'=>'title',
9797
'offset'=>3,
98-
]);
98+
));
9999
$this->assertEquals('SELECT title FROM [dbo].[posts] [t] ORDER BY id OFFSET 3 ROWS', $command->text);
100100

101-
$command = $this->createFindCommand([
101+
$command = $this->createFindCommand(array(
102102
'offset'=>3,
103-
]);
103+
));
104104
$this->assertEquals('SELECT * FROM [dbo].[posts] [t] ORDER BY id OFFSET 3 ROWS', $command->text);
105105

106-
$command = $this->createFindCommand([
106+
$command = $this->createFindCommand(array(
107107
'select'=>'title',
108-
]);
108+
));
109109
$this->assertEquals('SELECT title FROM [dbo].[posts] [t]', $command->text);
110110
}
111111

0 commit comments

Comments
 (0)