-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathreview-1.4.txt
215 lines (173 loc) · 6 KB
/
review-1.4.txt
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
Unique index validator
======================
- The class name ezcDbSchemaNonUniqueIndexNameValidator sounds a bit strange.
I think ezcDbSchemaUniqueIndexNameValidator would fit better, since it
indicates what is validated and not what violates the validation.
- Changed
Table prefixes
==============
- The prefix mechanism simply removes a string with the length of the prefix
from tables when a schema is read from a DB. We should check there if the
actual prefix is used and throw an exception if this is not the case.
- No, we should not. The whole idea is that you can multiple "applications"
in the database, each with a different prefix. Throwing an exception when
another "application" is found would be a real PITA.
- The condition ::
if ( $prefix === '' || $tableName !== $tableNameWithoutPrefix )
(DatabaseSchema/src/handlers/sqlite/reader.php +74)
looks like a tautology. Same for the other handlers.
- Not really, as the table should be scanned both:
- if there is no prefix configured
- if the $tableName has the prefix, in which case it get's stripped out
with $tableNameWithoutPrefix = substr( $tableName, strlen( $prefix ) );,
and thus $tableName and $tableNameWithoutPrefix are different then. If
it does *not* have the prefix, the two variables would have the same
content.
I added a comment to the code about it.
- The fetchSchema() method looks the same for all handlers except for the pure
SQL statement. Those should be moved to a common method in
ezcDbSchemaDbReader.
- Done
- The interface ezcDbSchemaDbWriter was changed in this commit, the method
isQueryAllowed() was added. This looks like a BC break.
- It isn't, as the base class ezcDbSchemaCommonSqlWriter implements
isQueryAllowed.
- The interface ezcDbSchemaDbReader was made an abstract class, which looks
like a BC break.
- Fixed, I think in a non BC-way, but please double check.
General
=======
- 7 test failures with 5.1.6 and 5.2.6 and SQLite in memory DB: ::
Time: 1 second
There were 7 failures:
1) testConstructorAllDefault(ezcDatabaseSchemaFieldTest)
Failed asserting that <boolean:false> matches expected value <integer:0>.
expected integer <0>
difference <0>
got integer < >
/home/dotxp/dev/PHP/actual/ezcomponents/trunk/DatabaseSchema/tests/schema_field_test.php:21
2) testConstructorAllGiven2(ezcDatabaseSchemaFieldTest)
Failed asserting that <boolean:false> matches expected value <integer:0>.
expected integer <0>
difference <0>
got integer < >
/home/dotxp/dev/PHP/actual/ezcomponents/trunk/DatabaseSchema/tests/schema_field_test.php:43
3) testXmlInternal2(ezcDatabaseSchemaSqliteTest)
Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ -14,10 +14,10 @@
[is_shadow] => ezcDbSchemaField Object
(
- [type] => boolean
+ [type] => integer
[length] => 0
[notNull] => 1
- [default] => false
+ [default] => 0
[autoIncrement] =>
[unsigned] =>
)
@@ -53,7 +53,7 @@
)
[primary] =>
- [unique] =>
+ [unique] => 1
)
)
/home/dotxp/dev/PHP/actual/ezcomponents/trunk/DatabaseSchema/tests/generic_test.php:227
4) testXmlInternal3(ezcDatabaseSchemaSqliteTest)
Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ -28,7 +28,7 @@
)
[primary] =>
- [unique] =>
+ [unique] => 1
)
)
/home/dotxp/dev/PHP/actual/ezcomponents/trunk/DatabaseSchema/tests/generic_test.php:253
5) testXmlInternal4(ezcDatabaseSchemaSqliteTest)
Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ -6,7 +6,7 @@
(
[type] => text
[length] => 255
- [notNull] => 1
+ [notNull] =>
[default] =>
[autoIncrement] =>
[unsigned] =>
@@ -16,7 +16,7 @@
(
[type] => text
[length] => 2
- [notNull] => 1
+ [notNull] =>
[default] =>
[autoIncrement] =>
[unsigned] =>
@@ -26,7 +26,7 @@
(
[type] => text
[length] => 50
- [notNull] => 1
+ [notNull] =>
[default] =>
[autoIncrement] =>
[unsigned] =>
@@ -46,7 +46,7 @@
(
[type] => integer
[length] => 0
- [notNull] => 1
+ [notNull] =>
[default] => 0
[autoIncrement] =>
[unsigned] =>
@@ -57,7 +57,7 @@
[type] => integer
[length] => 0
[notNull] => 1
- [default] => 0
+ [default] =>
[autoIncrement] => 1
[unsigned] =>
)
/home/dotxp/dev/PHP/actual/ezcomponents/trunk/DatabaseSchema/tests/generic_test.php:293
6) testDatatypes(ezcDatabaseSchemaSqliteTest)
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ -9,8 +9,8 @@
</field>
<field>
<name>test_boolean</name>
- <type>boolean</type>
- <default>true</default>
+ <type>integer</type>
+ <default>1</default>
</field>
<field>
<name>test_clob</name>
/home/dotxp/dev/PHP/actual/ezcomponents/trunk/DatabaseSchema/tests/generic_test.php:338
7) testApply1(ezcDatabaseSchemaSqliteDiffTest)
Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ -55,7 +55,7 @@
[type] => integer
[length] => 0
[notNull] => 1
- [default] =>
+ [default] => 0
[autoIncrement] =>
[unsigned] =>
)
/home/dotxp/dev/PHP/actual/ezcomponents/trunk/DatabaseSchema/tests/generic_diff_test.php:196
FAILURES!
Tests: 104, Failures: 7.
Generating code coverage report, this may take a moment.