@@ -13,47 +13,47 @@ class DSNTest extends \unittest\TestCase {
13
13
public function stringRepresentationWithPassword () {
14
14
$ this ->assertEquals (
15
15
'rdbms.DSN@(sybase://sa:********@localhost:1999/CAFFEINE?autoconnect=1) ' ,
16
- create (new DSN ('sybase://sa:password@localhost:1999/CAFFEINE?autoconnect=1 ' ))->toString ()
16
+ (new DSN ('sybase://sa:password@localhost:1999/CAFFEINE?autoconnect=1 ' ))->toString ()
17
17
);
18
18
}
19
19
20
20
#[@test]
21
21
public function stringRepresentationWithoutPassword () {
22
22
$ this ->assertEquals (
23
23
'rdbms.DSN@(mysql://root@localhost/?log=default) ' ,
24
- create (new DSN ('mysql://root@localhost/?log=default ' ))->toString ()
24
+ (new DSN ('mysql://root@localhost/?log=default ' ))->toString ()
25
25
);
26
26
}
27
27
28
28
#[@test]
29
29
public function asStringRemovesPassword () {
30
30
$ this ->assertEquals (
31
31
'mysql://user:********@localhost/?log=default ' ,
32
- create (new DSN ('mysql://user:foobar@localhost/?log=default ' ))->asString ()
32
+ (new DSN ('mysql://user:foobar@localhost/?log=default ' ))->asString ()
33
33
);
34
34
}
35
35
36
36
#[@test]
37
37
public function asStringKeepsPasswordIfRequested () {
38
38
$ this ->assertEquals (
39
39
'mysql://user:foobar@localhost/?log=default ' ,
40
- create (new DSN ('mysql://user:foobar@localhost/?log=default ' ))->asString (true )
40
+ (new DSN ('mysql://user:foobar@localhost/?log=default ' ))->asString (true )
41
41
);
42
42
}
43
43
44
44
#[@test]
45
45
public function asStringSkipsUserEvenWithRaw () {
46
46
$ this ->assertEquals (
47
47
'mysql://localhost/?log=default ' ,
48
- create (new DSN ('mysql://localhost/?log=default ' ))->asString (true )
48
+ (new DSN ('mysql://localhost/?log=default ' ))->asString (true )
49
49
);
50
50
}
51
51
52
52
#[@test]
53
53
public function driver () {
54
54
$ this ->assertEquals (
55
55
'sybase ' ,
56
- create (new DSN ('sybase://TEST/ ' ))->getDriver ()
56
+ (new DSN ('sybase://TEST/ ' ))->getDriver ()
57
57
);
58
58
}
59
59
@@ -66,173 +66,173 @@ public function noDriver() {
66
66
public function host () {
67
67
$ this ->assertEquals (
68
68
'TEST ' ,
69
- create (new DSN ('sybase://TEST/ ' ))->getHost ()
69
+ (new DSN ('sybase://TEST/ ' ))->getHost ()
70
70
);
71
71
}
72
72
73
73
#[@test]
74
74
public function port () {
75
75
$ this ->assertEquals (
76
76
1999 ,
77
- create (new DSN ('sybase://TEST:1999/ ' ))->getPort ()
77
+ (new DSN ('sybase://TEST:1999/ ' ))->getPort ()
78
78
);
79
79
}
80
80
81
81
#[@test]
82
82
public function portDefault () {
83
83
$ this ->assertEquals (
84
84
1999 ,
85
- create (new DSN ('sybase://TEST:1999/ ' ))->getPort (5000 )
85
+ (new DSN ('sybase://TEST:1999/ ' ))->getPort (5000 )
86
86
);
87
87
}
88
88
89
89
#[@test]
90
90
public function noPort () {
91
- $ this ->assertNull (create (new DSN ('sybase://TEST/ ' ))->getPort ());
91
+ $ this ->assertNull ((new DSN ('sybase://TEST/ ' ))->getPort ());
92
92
}
93
93
94
94
#[@test]
95
95
public function noPortDefault () {
96
96
$ this ->assertEquals (
97
97
1999 ,
98
- create (new DSN ('sybase://TEST/ ' ))->getPort (1999 )
98
+ (new DSN ('sybase://TEST/ ' ))->getPort (1999 )
99
99
);
100
100
}
101
101
102
102
#[@test]
103
103
public function database () {
104
104
$ this ->assertEquals (
105
105
'CAFFEINE ' ,
106
- create (new DSN ('sybase://TEST/CAFFEINE ' ))->getDatabase ()
106
+ (new DSN ('sybase://TEST/CAFFEINE ' ))->getDatabase ()
107
107
);
108
108
}
109
109
110
110
#[@test]
111
111
public function databaseDefault () {
112
112
$ this ->assertEquals (
113
113
'CAFFEINE ' ,
114
- create (new DSN ('sybase://TEST/CAFFEINE ' ))->getDatabase ('master ' )
114
+ (new DSN ('sybase://TEST/CAFFEINE ' ))->getDatabase ('master ' )
115
115
);
116
116
}
117
117
118
118
#[@test]
119
119
public function noDatabase () {
120
- $ this ->assertNull (create (new DSN ('mysql://root@localhost ' ))->getDatabase ());
120
+ $ this ->assertNull ((new DSN ('mysql://root@localhost ' ))->getDatabase ());
121
121
}
122
122
123
123
#[@test]
124
124
public function noDatabaseDefault () {
125
125
$ this ->assertEquals (
126
126
'master ' ,
127
- create (new DSN ('mysql://root@localhost ' ))->getDatabase ('master ' )
127
+ (new DSN ('mysql://root@localhost ' ))->getDatabase ('master ' )
128
128
);
129
129
}
130
130
131
131
#[@test]
132
132
public function slashDatabase () {
133
- $ this ->assertNull (create (new DSN ('mysql://root@localhost/ ' ))->getDatabase ());
133
+ $ this ->assertNull ((new DSN ('mysql://root@localhost/ ' ))->getDatabase ());
134
134
}
135
135
136
136
#[@test]
137
137
public function slashDatabaseDefault () {
138
138
$ this ->assertEquals (
139
139
'master ' ,
140
- create (new DSN ('mysql://root@localhost/ ' ))->getDatabase ('master ' )
140
+ (new DSN ('mysql://root@localhost/ ' ))->getDatabase ('master ' )
141
141
);
142
142
}
143
143
144
144
#[@test]
145
145
public function fileDatabase () {
146
146
$ this ->assertEquals (
147
147
'/usr/local/fb/jobs.fdb ' ,
148
- create (new DSN ('ibase://localhost//usr/local/fb/jobs.fdb ' ))->getDatabase ()
148
+ (new DSN ('ibase://localhost//usr/local/fb/jobs.fdb ' ))->getDatabase ()
149
149
);
150
150
}
151
151
152
152
#[@test]
153
153
public function user () {
154
154
$ this ->assertEquals (
155
155
'sa ' ,
156
- create (new DSN ('sybase://sa@TEST ' ))->getUser ()
156
+ (new DSN ('sybase://sa@TEST ' ))->getUser ()
157
157
);
158
158
}
159
159
160
160
#[@test]
161
161
public function userDefault () {
162
162
$ this ->assertEquals (
163
163
'sa ' ,
164
- create (new DSN ('sybase://sa@TEST ' ))->getUser ('reader ' )
164
+ (new DSN ('sybase://sa@TEST ' ))->getUser ('reader ' )
165
165
);
166
166
}
167
167
168
168
#[@test]
169
169
public function noUser () {
170
- $ this ->assertNull (create (new DSN ('sybase://TEST ' ))->getUser ());
170
+ $ this ->assertNull ((new DSN ('sybase://TEST ' ))->getUser ());
171
171
}
172
172
173
173
#[@test]
174
174
public function noUserDefault () {
175
175
$ this ->assertEquals (
176
176
'reader ' ,
177
- create (new DSN ('sybase://TEST ' ))->getUser ('reader ' )
177
+ (new DSN ('sybase://TEST ' ))->getUser ('reader ' )
178
178
);
179
179
}
180
180
181
181
#[@test]
182
182
public function password () {
183
183
$ this ->assertEquals (
184
184
'password ' ,
185
- create (new DSN ('sybase://sa:password@TEST ' ))->getPassword ()
185
+ (new DSN ('sybase://sa:password@TEST ' ))->getPassword ()
186
186
);
187
187
}
188
188
189
189
#[@test]
190
190
public function passwordDefault () {
191
191
$ this ->assertEquals (
192
192
'password ' ,
193
- create (new DSN ('sybase://sa:password@TEST ' ))->getPassword ('secret ' )
193
+ (new DSN ('sybase://sa:password@TEST ' ))->getPassword ('secret ' )
194
194
);
195
195
}
196
196
197
197
#[@test]
198
198
public function noPassword () {
199
- $ this ->assertNull (create (new DSN ('sybase://sa@TEST ' ))->getPassword ());
199
+ $ this ->assertNull ((new DSN ('sybase://sa@TEST ' ))->getPassword ());
200
200
}
201
201
202
202
#[@test]
203
203
public function noPasswordDefault () {
204
204
$ this ->assertEquals (
205
205
'secret ' ,
206
- create (new DSN ('sybase://sa@TEST ' ))->getPassword ('secret ' )
206
+ (new DSN ('sybase://sa@TEST ' ))->getPassword ('secret ' )
207
207
);
208
208
}
209
209
210
210
#[@test]
211
211
public function noFlags () {
212
- $ this ->assertEquals (0 , create (new DSN ('sybase://sa@TEST ' ))->getFlags ());
212
+ $ this ->assertEquals (0 , (new DSN ('sybase://sa@TEST ' ))->getFlags ());
213
213
}
214
214
215
215
#[@test]
216
216
public function definedFlags () {
217
217
$ this ->assertEquals (
218
218
DB_AUTOCONNECT ,
219
- create (new DSN ('sybase://sa@TEST?autoconnect=1 ' ))->getFlags ()
219
+ (new DSN ('sybase://sa@TEST?autoconnect=1 ' ))->getFlags ()
220
220
);
221
221
}
222
222
223
223
#[@test]
224
224
public function stringPropertyValue () {
225
225
$ this ->assertEquals (
226
226
'default ' ,
227
- create (new DSN ('sybase://sa@TEST?log=default ' ))->getProperty ('log ' )
227
+ (new DSN ('sybase://sa@TEST?log=default ' ))->getProperty ('log ' )
228
228
);
229
229
}
230
230
231
231
#[@test]
232
232
public function arrayPropertyValue () {
233
233
$ this ->assertEquals (
234
234
array ('util.log.LogObserver ' => 'default ' ),
235
- create (new DSN ('pgsql://postgres:1433/db?observer[util.log.LogObserver]=default ' ))->getProperty ('observer ' )
235
+ (new DSN ('pgsql://postgres:1433/db?observer[util.log.LogObserver]=default ' ))->getProperty ('observer ' )
236
236
);
237
237
}
238
238
0 commit comments