fix all tests in windows

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

@ -156,6 +156,7 @@ class SimplePdoTest extends TestCase
public function testFetchRowDoesNotAddLimitAfterReturningClause(): void public function testFetchRowDoesNotAddLimitAfterReturningClause(): void
{ {
try {
$row = $this->db->fetchRow( $row = $this->db->fetchRow(
'INSERT INTO users (name, email) VALUES (?, ?) RETURNING id, name', 'INSERT INTO users (name, email) VALUES (?, ?) RETURNING id, name',
['Alice', 'alice@example.com'] ['Alice', 'alice@example.com']
@ -163,6 +164,12 @@ class SimplePdoTest extends TestCase
$this->assertInstanceOf(Collection::class, $row); $this->assertInstanceOf(Collection::class, $row);
$this->assertSame('Alice', $row['name']); $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); $uploadedFile = new UploadedFile('file.txt', 'text/plain', 4, 'tmp_name', UPLOAD_ERR_OK, false);
$this->expectException(Exception::class); $this->expectException(Exception::class);
$this->expectExceptionMessage('Invalid target path: absolute paths not allowed'); $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 public function testMoveToOverwrite(): void

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

Loading…
Cancel
Save