Skip to content

Commit

Permalink
refactor: combine php specific tests into a single test
Browse files Browse the repository at this point in the history
  • Loading branch information
lavarou committed Dec 17, 2024
1 parent 9807f77 commit 1cc35ad
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 107 deletions.
21 changes: 13 additions & 8 deletions tests/integration/pdo/test_query_1.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

/*SKIPIF
<?php require('skipif_sqlite.inc');
if (version_compare(PHP_VERSION, "8.1", ">=")) {
die("skip: PHP >= 8.1.0 not supported\n");
}
*/

/*INI
Expand Down Expand Up @@ -82,11 +79,19 @@ function test_pdo_query() {
tap_equal(1, $conn->exec("INSERT INTO test VALUES (2, 'two');"), 'insert two');
tap_equal(1, $conn->exec("INSERT INTO test VALUES (3, 'three');"), 'insert three');

$expected = array(
array('id' => '1', 'desc' => 'one'),
array('id' => '2', 'desc' => 'two'),
array('id' => '3', 'desc' => 'three')
);
if (version_compare(PHP_VERSION, "8.1", "<")) {
$expected = array(
array('id' => '1', 'desc' => 'one'),
array('id' => '2', 'desc' => 'two'),
array('id' => '3', 'desc' => 'three')
);
} else {
$expected = array(
array('id' => 1, 'desc' => 'one'),
array('id' => 2, 'desc' => 'two'),
array('id' => 3, 'desc' => 'three')
);
}

$result = $conn->query('SELECT * FROM test;');
$actual = $result->fetchAll(PDO::FETCH_ASSOC);
Expand Down
99 changes: 0 additions & 99 deletions tests/integration/pdo/test_query_1.php81.php

This file was deleted.

0 comments on commit 1cc35ad

Please sign in to comment.