Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Oct 7, 2021
1 parent eb6e275 commit 259b112
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ jobs:
if [ -n "$LOG_COVERAGE" ]; then
cp tools/CoverageUtil.php demos
mkdir coverage
vendor/bin/phpunit --exclude-group none --coverage-text -v
fi
vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
if [ -n "$LOG_COVERAGE" ]; then
ls -l coverage | wc -l && mv coverage/* build/logs
else
vendor/bin/phpunit --exclude-group none --no-coverage -v
fi
- name: "Run tests: MySQL (only for Phpunit)"
Expand All @@ -163,13 +163,16 @@ jobs:
DB_DSN: "mysql:dbname=atk4_test__ui;host=mysql"
DB_USER: atk4_test
DB_PASSWD: atk4_pass

run: |
php demos/_demo-data/create-db.php
vendor/bin/phpunit --exclude-group none --no-coverage -v
- name: "Run tests: MSSQL (only for Phpunit)"
if: startsWith(matrix.type, 'Phpunit')
env:
DB_DSN: "sqlsrv:Server=mssql;Database=master"
DB_USER: sa
DB_PASSWD: atk4_pass
run: |
php demos/_demo-data/create-db.php
vendor/bin/phpunit --exclude-group none --no-coverage -v
Expand Down
3 changes: 0 additions & 3 deletions demos/_demo-data/create-db.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
use Atk4\Data\Model;
use Atk4\Data\Schema\Migration;

var_dump(file_get_contents(__DIR__ . '/../db.default.php'));
var_dump(getenv('DB_DSN'));

require_once __DIR__ . '/../init-autoloader.php';

$sqliteFile = __DIR__ . '/db.sqlite';
Expand Down
1 change: 0 additions & 1 deletion demos/init-db.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
? __DIR__ . '/db.php'
: __DIR__ . '/db.default.php';
} catch (\PDOException $e) {
echo $e;
// do not pass $e unless you can secure DSN!
throw (new \Atk4\Ui\Exception('This demo requires access to the database. See "demos/init-db.php"'))
->addMoreInfo('PDO error', $e->getMessage());
Expand Down

0 comments on commit 259b112

Please sign in to comment.