I'm not certain if I've installed testbench correctly when trying to run tests I'm getting Access denied for user 'forge'@'localhost' but sqlite should be used.
My test case:
<?php
namespace Dcblogdev\MsGraph\Tests;
use AllowDynamicProperties;
use Dcblogdev\MsGraph\MsGraphServiceProvider;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Orchestra\Testbench\TestCase as Orchestra;
class TestCase extends Orchestra
{
use RefreshDatabase;
protected function getPackageProviders($app)
{
return [
MsGraphServiceProvider::class,
];
}
protected function getEnvironmentSetUp($app)
{
// Setup default database to use sqlite :memory:
$app['config']->set('database.default', 'testing');
$app['config']->set('database.connections.testing', [
'driver' => 'sqlite',
'database' => ':memory:',
'prefix' => '',
]);
}
}
In my service provder I have:
public function boot(Router $router)
{
$this->mergeConfigFrom(__DIR__.'/../config/msgraph.php', 'msgraph');
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
$this->registerMiddleware($router);
if ($this->app->runningInConsole()) {
$this->registerCommands();
$this->configurePublishing();
}
}
Description:
I'm not certain if I've installed testbench correctly when trying to run tests I'm getting
Access denied for user 'forge'@'localhost'
butsqlite
should be used.My test case:
In my service provder I have:
Also in
phpunit.xml
If it helps here's a direct link to my package https://github.com/dcblogdev/laravel-microsoft-graph/blob/master/tests/TestCase.php