Skip to content

Commit 8c37893

Browse files
committed
Making appveyor use sqlite for simplicity
1 parent abbe8d9 commit 8c37893

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

appveyor.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ cache:
88
init:
99
- SET PATH=c:\php;%PATH%
1010

11+
environment:
12+
TEST_DATABASE_DSN: sqlite:///c:\projects\maker-bundle\tests\tmp\app.db
13+
1114
install:
1215
- mkdir c:\php && cd c:\php
1316
- appveyor DownloadFile https://github.com/symfony/binary-utils/releases/download/v0.1/php-7.1.3-Win32-VC14-x86.zip
@@ -27,7 +30,7 @@ install:
2730
- echo opcache.enable_cli=1 >> php.ini-max
2831
- echo extension=php_openssl.dll >> php.ini-max
2932
- echo extension=php_apcu.dll >> php.ini-max
30-
- echo extension=php_pdo_mysql.dll >> php.ini-max
33+
- echo extension=php_pdo_sqlite.dll >> php.ini-max
3134
- echo apc.enable_cli=1 >> php.ini-max
3235
- echo extension=php_intl.dll >> php.ini-max
3336
- echo extension=php_mbstring.dll >> php.ini-max

src/Test/MakerTestDetails.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ public function configureDatabase(bool $createSchema = true): self
104104

105105
// this looks silly, but it's the only way to drop the database *for sure*,
106106
// as doctrine:database:drop will error if there is no database
107-
$this->addPreMakeCommand('php bin/console doctrine:database:create --env=test --if-not-exists');
107+
// also, skip for SQLITE, as it does not support --if-not-exists
108+
if (0 !== strpos(getenv('TEST_DATABASE_DSN'), 'sqlite://')) {
109+
$this->addPreMakeCommand('php bin/console doctrine:database:create --env=test --if-not-exists');
110+
}
108111
$this->addPreMakeCommand('php bin/console doctrine:database:drop --env=test --force');
109112

110113
$this->addPreMakeCommand('php bin/console doctrine:database:create --env=test');

0 commit comments

Comments
 (0)