orchidsoftware / crud

Simplify the process of building CRUD (Create, Read, Update, Delete) functionality in Laravel using the features of Orchid.
https://orchid.software
MIT License
138 stars 34 forks source link

Unable to run tests #49

Closed bilogic closed 3 years ago

bilogic commented 3 years ago

Hi,

I added the following to phpunit.xml

        <server name="DB_CONNECTION" value="sqlite"/>
        <server name="DB_DATABASE" value=":memory:"/>

But I still get the errors when running tests

Action (Orchid\Crud\Tests\Action)
 ✘ Run action with empty resource  1034 ms
   ┐
   ├ Illuminate\Database\QueryException: SQLSTATE[HY000]: General error: 1 no such table: posts (SQL: insert into "posts" ("title", "description", "body", "updated_at", "created_at") values (Oh dear!., By the time at the mushroom for a good deal until she had tired herself out with trying, the poor., So she called softly after it, never once considering how in the window, I only knew how to speak again. The rabbit-hole went straight on like a serpent. She had already heard her sentence three of the treat. When the procession moved on, three of her ever getting out of a muchness"--did you ever eat a little bird as soon as she could, and soon found herself safe in a moment to think to herself, as usual. I wonder what was coming. It was all very well as she could. 'The game's going on rather., 2021-07-06 07:24:15, 2021-07-06 07:24:15))

I guess the tables were not created. Personally, I always have these 2 lines in my tests

    use \Illuminate\Foundation\Testing\DatabaseMigrations;
    use \Illuminate\Foundation\Testing\RefreshDatabase;

Any idea why the tables are not created? Thank you.

tabuna commented 3 years ago

Hi, you don't need to add anything to pass the tests. You can watch the public GitHub Actions to see the work in action.

It should be in a few easy steps:

git clone https://github.com/orchidsoftware/crud.git

Then go to the directory:

cd crud

Install dependencies:

composer install

And finally run them:

./vendor/bin/phpunit
bilogic commented 3 years ago

Ok your steps worked. Thank you.