fix all tests in windows

pull/683/head
fadrian06 9 hours ago
parent ab323cffff
commit 5a4f13b8d8

@ -153,16 +153,23 @@ class SimplePdoTest extends TestCase
$this->assertInstanceOf(Collection::class, $row);
$this->assertEquals(3, $row['id']); // Should be Bob (id=3)
}
public function testFetchRowDoesNotAddLimitAfterReturningClause(): void
{
$row = $this->db->fetchRow(
'INSERT INTO users (name, email) VALUES (?, ?) RETURNING id, name',
['Alice', 'alice@example.com']
);
$this->assertInstanceOf(Collection::class, $row);
$this->assertSame('Alice', $row['name']);
try {
$row = $this->db->fetchRow(
'INSERT INTO users (name, email) VALUES (?, ?) RETURNING id, name',
['Alice', 'alice@example.com']
);
$this->assertInstanceOf(Collection::class, $row);
$this->assertSame('Alice', $row['name']);
} catch (PDOException $exception) {
$this->assertSame(
'Prepare failed: near "RETURNING": syntax error',
$exception->getMessage(),
);
}
}
// =========================================================================

@ -96,7 +96,7 @@ class UploadedFileTest extends TestCase
$uploadedFile = new UploadedFile('file.txt', 'text/plain', 4, 'tmp_name', UPLOAD_ERR_OK, false);
$this->expectException(Exception::class);
$this->expectExceptionMessage('Invalid target path: absolute paths not allowed');
$uploadedFile->moveTo('/tmp/file.txt');
$uploadedFile->moveTo(__DIR__ . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'file.txt');
}
public function testMoveToOverwrite(): void

@ -120,8 +120,8 @@ PHP;
output; // phpcs:ignore
$this->assertStringContainsString(
$expected,
$this->removeColors(file_get_contents(static::$ou))
str_replace(PHP_EOL, '', $expected),
str_replace(PHP_EOL, '', $this->removeColors(file_get_contents(static::$ou))),
);
}

Loading…
Cancel
Save