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
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
namespace Doctrine\Tests\DBAL\Driver;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\AbstractSQLAnywhereDriver;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\SQLAnywhere11Platform;
use Doctrine\DBAL\Platforms\SQLAnywhere12Platform;
use Doctrine\DBAL\Platforms\SQLAnywhere16Platform;
use Doctrine\DBAL\Platforms\SQLAnywherePlatform;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\SQLAnywhereSchemaManager;
class AbstractSQLAnywhereDriverTest extends AbstractDriverTest
{
protected function createDriver() : Driver
{
return $this->getMockForAbstractClass(AbstractSQLAnywhereDriver::class);
}
protected function createPlatform() : AbstractPlatform
{
return new SQLAnywhere12Platform();
}
protected function createSchemaManager(Connection $connection) : AbstractSchemaManager
{
return new SQLAnywhereSchemaManager($connection);
}
/**
* {@inheritDoc}
*/
protected function getDatabasePlatformsForVersions() : array
{
return [
['10', SQLAnywherePlatform::class],
['10.0', SQLAnywherePlatform::class],
['10.0.0', SQLAnywherePlatform::class],
['10.0.0.0', SQLAnywherePlatform::class],
['10.1.2.3', SQLAnywherePlatform::class],
['10.9.9.9', SQLAnywherePlatform::class],
['11', SQLAnywhere11Platform::class],
['11.0', SQLAnywhere11Platform::class],
['11.0.0', SQLAnywhere11Platform::class],
['11.0.0.0', SQLAnywhere11Platform::class],
['11.1.2.3', SQLAnywhere11Platform::class],
['11.9.9.9', SQLAnywhere11Platform::class],
['12', SQLAnywhere12Platform::class],
['12.0', SQLAnywhere12Platform::class],
['12.0.0', SQLAnywhere12Platform::class],
['12.0.0.0', SQLAnywhere12Platform::class],
['12.1.2.3', SQLAnywhere12Platform::class],
['12.9.9.9', SQLAnywhere12Platform::class],
['13', SQLAnywhere12Platform::class],
['14', SQLAnywhere12Platform::class],
['15', SQLAnywhere12Platform::class],
['15.9.9.9', SQLAnywhere12Platform::class],
['16', SQLAnywhere16Platform::class],
['16.0', SQLAnywhere16Platform::class],
['16.0.0', SQLAnywhere16Platform::class],
['16.0.0.0', SQLAnywhere16Platform::class],
['16.1.2.3', SQLAnywhere16Platform::class],
['16.9.9.9', SQLAnywhere16Platform::class],
['17', SQLAnywhere16Platform::class],
];
}
/**
* {@inheritDoc}
*/
protected static function getExceptionConversionData() : array
{
return [
self::EXCEPTION_CONNECTION => [
['-100', null, null],
['-103', null, null],
['-832', null, null],
],
self::EXCEPTION_FOREIGN_KEY_CONSTRAINT_VIOLATION => [
['-198', null, null],
],
self::EXCEPTION_INVALID_FIELD_NAME => [
['-143', null, null],
],
self::EXCEPTION_NON_UNIQUE_FIELD_NAME => [
['-144', null, null],
],
self::EXCEPTION_NOT_NULL_CONSTRAINT_VIOLATION => [
['-184', null, null],
['-195', null, null],
],
self::EXCEPTION_SYNTAX_ERROR => [
['-131', null, null],
],
self::EXCEPTION_TABLE_EXISTS => [
['-110', null, null],
],
self::EXCEPTION_TABLE_NOT_FOUND => [
['-141', null, null],
['-1041', null, null],
],
self::EXCEPTION_UNIQUE_CONSTRAINT_VIOLATION => [
['-193', null, null],
['-196', null, null],
],
self::EXCEPTION_DEADLOCK => [
['-306', null, null],
['-307', null, null],
['-684', null, null],
],
self::EXCEPTION_LOCK_WAIT_TIMEOUT => [
['-210', null, null],
['-1175', null, null],
['-1281', null, null],
],
];
}
}