File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -339,7 +339,7 @@ public function fetch(
339339 $ cursor_orientation = \PDO ::FETCH_ORI_NEXT ,
340340 $ cursor_offset = 0
341341 ) {
342- if ($ fetch_style === -123 || $ fetch_style === \PDO ::FETCH_DEFAULT ) {
342+ if ($ fetch_style === -123 || ( defined ( ' PDO::FETCH_DEFAULT ' ) && $ fetch_style === \PDO ::FETCH_DEFAULT ) ) {
343343 $ fetch_style = $ this ->fetchMode ;
344344 }
345345
@@ -415,7 +415,7 @@ public function fetchColumn($column = 0)
415415 */
416416 public function universalFetchAll (int $ fetch_style = -123 , ...$ args ) : array
417417 {
418- if ($ fetch_style === -123 || $ fetch_style === \PDO ::FETCH_DEFAULT ) {
418+ if ($ fetch_style === -123 || ( defined ( ' PDO::FETCH_DEFAULT ' ) && $ fetch_style === \PDO ::FETCH_DEFAULT ) ) {
419419 $ fetch_style = $ this ->fetchMode ;
420420 $ fetch_argument = $ this ->fetchArgument ;
421421 $ ctor_args = $ this ->fetchConstructorArgs ;
Original file line number Diff line number Diff line change @@ -54,6 +54,10 @@ public function testSelectWithDefaultFetchAssoc()
5454
5555 public function testSelectFetchDefault ()
5656 {
57+ if (!defined ('PDO::FETCH_DEFAULT ' )) {
58+ $ this ->markTestSkipped ('PHP version does not support PDO::FETCH_DEFAULT ' );
59+ }
60+
5761 $ pdo = self ::getConnectionToFullDB ();
5862
5963 $ query = $ pdo ->prepare ("SELECT id FROM `video_game_characters` WHERE `id` > :id ORDER BY `id` ASC " );
You can’t perform that action at this time.
0 commit comments