fix all tests in windows

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

@ -156,13 +156,20 @@ class SimplePdoTest extends TestCase
public function testFetchRowDoesNotAddLimitAfterReturningClause(): void public function testFetchRowDoesNotAddLimitAfterReturningClause(): void
{ {
$row = $this->db->fetchRow( try {
'INSERT INTO users (name, email) VALUES (?, ?) RETURNING id, name', $row = $this->db->fetchRow(
['Alice', 'alice@example.com'] 'INSERT INTO users (name, email) VALUES (?, ?) RETURNING id, name',
); ['Alice', 'alice@example.com']
);
$this->assertInstanceOf(Collection::class, $row);
$this->assertSame('Alice', $row['name']); $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); $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