Skip to content

Commit

Permalink
modified a failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
yitam committed Mar 9, 2017
1 parent 497797e commit a10fe30
Showing 1 changed file with 41 additions and 21 deletions.
62 changes: 41 additions & 21 deletions test/pdo_sqlsrv/pdo_stored_proc_fetch_datatypes.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ function ProcFetch_BigInt($conn)
$stmt->bindParam(3, $outValue, PDO::PARAM_STR, 300);
$stmt->execute();

if (strncasecmp($outValue, "23456789", 8))
$expected = "23456789";
$outValue = trim($outValue);
if (strncasecmp($outValue, $expected, strlen($expected)))
{
echo "Output value $outValue is unexpected!\n";
echo "Output value $outValue is unexpected! Expected $expected\n";
}

$stmt = null;
Expand All @@ -49,9 +51,11 @@ function ProcFetch_Decimal($conn)
$stmt->bindParam(3, $outValue, PDO::PARAM_STR, 300);
$stmt->execute();

if (strncasecmp($outValue, "7", 1))
$expected = "7";
$outValue = trim($outValue);
if (strncasecmp($outValue, $expected, strlen($expected)))
{
echo "Output value $outValue is unexpected!\n";
echo "Output value $outValue is unexpected! Expected $expected\n";
}

$stmt = null;
Expand All @@ -74,9 +78,11 @@ function ProcFetch_Float($conn)
$stmt->bindParam(3, $outValue, PDO::PARAM_STR, 300);
$stmt->execute();

if (strncasecmp($outValue, "7.75", 4))
$expected = "7.75";
$outValue = trim($outValue);
if (strncasecmp($outValue, $expected, strlen($expected)))
{
echo "Output value $outValue is unexpected!\n";
echo "Output value $outValue is unexpected! Expected $expected\n";
}

$stmt = null;
Expand All @@ -99,9 +105,11 @@ function ProcFetch_Int($conn)
$stmt->bindParam(3, $outValue, PDO::PARAM_STR, 300);
$stmt->execute();

if (strncasecmp($outValue, "6912", 4))
$expected = "6912";
$outValue = trim($outValue);
if (strncasecmp($outValue, $expected, strlen($expected)))
{
echo "Output value $outValue is unexpected!\n";
echo "Output value $outValue is unexpected! Expected $expected\n";
}

$stmt = null;
Expand All @@ -124,9 +132,11 @@ function ProcFetch_Money($conn)
$stmt->bindParam(3, $outValue, PDO::PARAM_STR, 300);
$stmt->execute();

if (strncasecmp($outValue, "38.40", 5))
$expected = "38.40";
$outValue = trim($outValue);
if (strncasecmp($outValue, $expected, strlen($expected)))
{
echo "Output value $outValue is unexpected!\n";
echo "Output value $outValue is unexpected! Expected $expected\n";
}

$stmt = null;
Expand All @@ -149,9 +159,11 @@ function ProcFetch_Numeric($conn)
$stmt->bindParam(3, $outValue, PDO::PARAM_STR, 300);
$stmt->execute();

if (strncasecmp($outValue, "8", 1))
$expected = "8";
$outValue = trim($outValue);
if (strncasecmp($outValue, $expected, strlen($expected)))
{
echo "Output value $outValue is unexpected!\n";
echo "Output value $outValue is unexpected! Expected $expected\n";
}

$stmt = null;
Expand All @@ -174,9 +186,11 @@ function ProcFetch_Real($conn)
$stmt->bindParam(3, $outValue, PDO::PARAM_STR, 300);
$stmt->execute();

if (strncasecmp($outValue, "10", 2))
$expected = "10";
$outValue = trim($outValue);
if (strncasecmp($outValue, $expected, strlen($expected)))
{
echo "Output value $outValue is unexpected!\n";
echo "Output value $outValue is unexpected! Expected $expected\n";
}

$stmt = null;
Expand All @@ -199,9 +213,11 @@ function ProcFetch_SmallInt($conn)
$stmt->bindParam(3, $outValue, PDO::PARAM_STR, 300);
$stmt->execute();

if (strncasecmp($outValue, "90", 2))
$expected = "90";
$outValue = trim($outValue);
if (strncasecmp($outValue, $expected, strlen($expected)))
{
echo "Output value $outValue is unexpected!\n";
echo "Output value $outValue is unexpected! Expected $expected\n";
}

$stmt = null;
Expand All @@ -224,11 +240,13 @@ function ProcFetch_SmallMoney($conn)
$stmt->bindParam(3, $outValue, PDO::PARAM_STR, 300);
$stmt->execute();

if (strncasecmp($outValue, "21.70", 5))
$expected = "21.70";
$outValue = trim($outValue);
if (strncasecmp($outValue, $expected, strlen($expected)))
{
echo "Output value $outValue is unexpected!\n";
echo "Output value $outValue is unexpected! Expected $expected\n";
}

$stmt = null;
}

Expand All @@ -249,9 +267,11 @@ function ProcFetch_TinyInt($conn)
$stmt->bindParam(3, $outValue, PDO::PARAM_STR, 300);
$stmt->execute();

if (strncasecmp($outValue, "23", 2))
$expected = "23";
$outValue = trim($outValue);
if (strncasecmp($outValue, $expected, strlen($expected)))
{
echo "Output value $outValue is unexpected!\n";
echo "Output value $outValue is unexpected! Expected $expected\n";
}

$stmt = null;
Expand Down

0 comments on commit a10fe30

Please sign in to comment.