all() public method

public all ( )
Beispiel #1
0
    public function test_Should_GetAllDbSettings()
    {
        $config = <<<EOF
DB_DRIVER=mysql
DB_HOST=localhost
DB_DATABASE=database
DB_USERNAME=username
DB_PASSWORD=password

EOF;
        $dotenv = vfsStream::newFile('.env')->at($this->rootDir)->setContent($config);
        $dotenvReader = new DotenvReader(new LaravelFilesystem($this->app['files']), vfsStream::url('rootDir/.env'));
        $dotenvWriter = new DotenvWriter(new LaravelFilesystem($this->app['files']), vfsStream::url('rootDir/.env'));
        $configDbSettingRepository = new ConfigDbSetting($dotenvReader, $dotenvWriter);
        $dbSettings = $configDbSettingRepository->all();
        $this->assertEquals('mysql', $dbSettings->getDriver());
        $this->assertEquals('localhost', $dbSettings->getHost());
        $this->assertEquals('database', $dbSettings->getDatabase());
        $this->assertEquals('username', $dbSettings->getUsername());
        $this->assertEquals('password', $dbSettings->getPassword());
    }