public function testCanCreateMysqlDumper() { $app = $this->getApp(); $provider = new LaravelServiceProvider($app); $provider->register(); $dumperConfig = ['host' => 'bucket', 'port' => 3306, 'username' => 'username', 'password' => 'password', 'database' => 'database', 'filePath' => 'filePath']; $this->assertInstanceOf('McCool\\DatabaseBackup\\Dumpers\\MysqlDumper', $app->make('databasebackup.dumpers.mysqldumper', $dumperConfig)); }
private function getApp() { $app = $this->getContainer(); // mock out laravel environment configuration $app['files'] = m::mock(); $app['files']->shouldReceive('isDirectory'); $app['events'] = m::mock(); $app['events']->shouldReceive('listen'); $app['config'] = m::mock(); $app['config']->shouldReceive('get'); $app['path'] = "path"; $app['path.storage'] = "storage path"; // register ioc bindings $provider = new LaravelServiceProvider($app); $provider->register(); return $app; }