在laravel中运行测试时出现错误:
Illuminate \ Database \ QueryException:找不到驱动程序(SQL:PRAGMA foreign_keys = ON;)
这是测试代码:
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
use App\Book;
class BookReservationTest extends TestCase
{
use RefreshDatabase;
/** @test */
public function a_book_can_be_added_to_the_library()
{
$this->withoutExceptionHandling();
$response = $this->post('/books', [
'title' => 'cool book title',
'author' => 'victor'
]);
$response->assertOk();
$this->assertCount(11, Book::all());
}
}