tom-- / yii2-dynamic-ar

An extension to add NoSQL-like documents to Yii 2 Framework's Active Record ORM.
ISC License
57 stars 15 forks source link

unit tests broken #18

Closed tom-- closed 7 years ago

tom-- commented 7 years ago

@tom-- moved one of @gvasilopulos issue from #17

Hello and sorry in advance for the length of this ,unfortunately I could not manage to run the tests. I did edit tests/data/config.php I left only postgres and adjusted db/username/pass . I have to say I've never worked with tests so it is all kind of hazy in my head. running phpunit tests/unit/DynamicActiveRecordPgsqlTest.php get's skipped all together. Running phpunit -c phpunit.xml returns this 123) tests\unit\DynamicActiveRecordTest::testFindLazyVia Exception: driverName is not set for a DatabaseTestCase. on all the failed tests (140 of them and skips another 247) . It probably does not connect to the db but I cannot figure how to do this in the test env. Notice that I cloned the extension, runned composer update, cloned the tests from yii2 master (for some reason they are not getting installed with yii2-dev package) and that is the test enviroment . Let me know if I have to setup an yii basic or advanced app to do this (this is what I suspect).

tom-- commented 7 years ago

Looks like yiisoft reorganized the code so that unit tests are not in the yii2 or yii2-dev composer packages. @cebe is that the case?

tests/unit/bootstrap.php:16 is

Yii::setAlias('@yiiunit', __DIR__ . '/../../vendor/yiisoft/yii2-dev/tests');

How to sort this out?

cebe commented 7 years ago

this could happen if you install with --prefer-dist instead of --prefer-source. This is the second report I get about this. Will revert that change.

cebe commented 7 years ago

Fixed: https://github.com/yiisoft/yii2/commit/a0c5fee93141fd56bdd1b72110718d64de5c6418