1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
namespace Doctrine\Tests\DBAL\Driver;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Platforms\SQLAnywhere12Platform;
use Doctrine\DBAL\Schema\SQLAnywhereSchemaManager;
class AbstractSQLAnywhereDriverTest extends AbstractDriverTest
{
protected function createDriver()
{
return $this->getMockForAbstractClass('Doctrine\DBAL\Driver\AbstractSQLAnywhereDriver');
}
protected function createPlatform()
{
return new SQLAnywhere12Platform();
}
protected function createSchemaManager(Connection $connection)
{
return new SQLAnywhereSchemaManager($connection);
}
protected function getDatabasePlatformsForVersions()
{
return array(
array('10', 'Doctrine\DBAL\Platforms\SQLAnywherePlatform'),
array('10.0', 'Doctrine\DBAL\Platforms\SQLAnywherePlatform'),
array('10.0.0', 'Doctrine\DBAL\Platforms\SQLAnywherePlatform'),
array('10.0.0.0', 'Doctrine\DBAL\Platforms\SQLAnywherePlatform'),
array('10.1.2.3', 'Doctrine\DBAL\Platforms\SQLAnywherePlatform'),
array('10.9.9.9', 'Doctrine\DBAL\Platforms\SQLAnywherePlatform'),
array('11', 'Doctrine\DBAL\Platforms\SQLAnywhere11Platform'),
array('11.0', 'Doctrine\DBAL\Platforms\SQLAnywhere11Platform'),
array('11.0.0', 'Doctrine\DBAL\Platforms\SQLAnywhere11Platform'),
array('11.0.0.0', 'Doctrine\DBAL\Platforms\SQLAnywhere11Platform'),
array('11.1.2.3', 'Doctrine\DBAL\Platforms\SQLAnywhere11Platform'),
array('11.9.9.9', 'Doctrine\DBAL\Platforms\SQLAnywhere11Platform'),
array('12', 'Doctrine\DBAL\Platforms\SQLAnywhere12Platform'),
array('12.0', 'Doctrine\DBAL\Platforms\SQLAnywhere12Platform'),
array('12.0.0', 'Doctrine\DBAL\Platforms\SQLAnywhere12Platform'),
array('12.0.0.0', 'Doctrine\DBAL\Platforms\SQLAnywhere12Platform'),
array('12.1.2.3', 'Doctrine\DBAL\Platforms\SQLAnywhere12Platform'),
array('12.9.9.9', 'Doctrine\DBAL\Platforms\SQLAnywhere12Platform'),
array('13', 'Doctrine\DBAL\Platforms\SQLAnywhere12Platform'),
array('14', 'Doctrine\DBAL\Platforms\SQLAnywhere12Platform'),
array('15', 'Doctrine\DBAL\Platforms\SQLAnywhere12Platform'),
array('15.9.9.9', 'Doctrine\DBAL\Platforms\SQLAnywhere12Platform'),
array('16', 'Doctrine\DBAL\Platforms\SQLAnywhere16Platform'),
array('16.0', 'Doctrine\DBAL\Platforms\SQLAnywhere16Platform'),
array('16.0.0', 'Doctrine\DBAL\Platforms\SQLAnywhere16Platform'),
array('16.0.0.0', 'Doctrine\DBAL\Platforms\SQLAnywhere16Platform'),
array('16.1.2.3', 'Doctrine\DBAL\Platforms\SQLAnywhere16Platform'),
array('16.9.9.9', 'Doctrine\DBAL\Platforms\SQLAnywhere16Platform'),
array('17', 'Doctrine\DBAL\Platforms\SQLAnywhere16Platform'),
);
}
protected function getExceptionConversionData()
{
return array(
self::EXCEPTION_CONNECTION => array(
array('-100', null, null),
array('-103', null, null),
array('-832', null, null),
),
self::EXCEPTION_FOREIGN_KEY_CONSTRAINT_VIOLATION => array(
array('-198', null, null),
),
self::EXCEPTION_INVALID_FIELD_NAME => array(
array('-143', null, null),
),
self::EXCEPTION_NON_UNIQUE_FIELD_NAME => array(
array('-144', null, null),
),
self::EXCEPTION_NOT_NULL_CONSTRAINT_VIOLATION => array(
array('-184', null, null),
array('-195', null, null),
),
self::EXCEPTION_SYNTAX_ERROR => array(
array('-131', null, null),
),
self::EXCEPTION_TABLE_EXISTS => array(
array('-110', null, null),
),
self::EXCEPTION_TABLE_NOT_FOUND => array(
array('-141', null, null),
array('-1041', null, null),
),
self::EXCEPTION_UNIQUE_CONSTRAINT_VIOLATION => array(
array('-193', null, null),
array('-196', null, null),
),
self::EXCEPTION_DEADLOCK => array(
array('-306', null, null),
array('-307', null, null),
array('-684', null, null),
),
self::EXCEPTION_LOCK_WAIT_TIMEOUT => array(
array('-210', null, null),
array('-1175', null, null),
array('-1281', null, null),
),
);
}
}