orchestral / testbench

Laravel Testing Helper for Packages Development
https://packages.tools/testbench
MIT License
2.12k stars 136 forks source link

Can't get schema column listing #226

Closed Okipa closed 6 years ago

Okipa commented 6 years ago

Hi @crynobone,

I have an issue to get a schema column listing with testbench.
Here is a test I have written to point the problem : https://github.com/Okipa/testbench-core/blob/3.7/tests/SchemaTest.php

This work perfectly in Laravel but I can't get it work on a package testing.

As you can see, my tests are using sqlite and not mysql. Could this cause this wrong behaviour ? Is there a way to make this work with testbench ?

crynobone commented 6 years ago

I don't see how it going to work with :memory: database, you need to migrate testbench_users before using Schema::getColumnListing('testbench_users').

Try again using mysql, or sqlite with physical file and ensure that the table exists, you should get the tests to be green.

crynobone commented 6 years ago

https://github.com/orchestral/testbench-core/commit/a981d06e705eb873f7fbdeb02a86266fe5a31d1e

The tests is green, because I'm using :memory: and I migrate the table before running the assertion.

Okipa commented 6 years ago

@crynobone Ok I see, this is working. Thanks for your time !