setDataSourceName() public method

Sets the DSN to use
public setDataSourceName ( string $DSN ) : void
$DSN string The DSN to use for connecting to the DB
return void
コード例 #1
0
 /**
  * Sets up the APC backend used for testing
  *
  * @return PdoBackend
  */
 protected function setUpBackend()
 {
     $mockCache = $this->getMockBuilder(\Neos\Cache\Frontend\FrontendInterface::class)->disableOriginalConstructor()->getMock();
     $mockCache->expects($this->any())->method('getIdentifier')->will($this->returnValue('TestCache'));
     $mockEnvironmentConfiguration = $this->getMockBuilder(\Neos\Cache\EnvironmentConfiguration::class)->setConstructorArgs([__DIR__ . '~Testing', 'vfs://Foo/', 255])->getMock();
     $backend = new PdoBackend($mockEnvironmentConfiguration);
     $backend->setCache($mockCache);
     $backend->setDataSourceName('sqlite::memory:');
     $backend->initializeObject();
     return $backend;
 }