Beispiel #1
0
 /**
  * @covers ::execute
  */
 public function test_execute_sql()
 {
     // Given
     $this->dbDropAllTables('SCHEMA1');
     $this->dbLoadFixtures('SCHEMA1', 'bigtable_create.sql');
     $vCfg = vfsStream::newDirectory('cfg')->at($this->vfsRoot);
     $vTmp = vfsStream::newDirectory('tmp')->at($vCfg);
     $vSchema = vfsStream::newFile('schema.sql')->at($vTmp);
     $cfgFile = vfsStream::newFile('db_config.json')->withContent(self::getFixtureRawData('db_config_sql.json'))->at($vCfg)->url();
     $cmd = new CommandTester($this->cmd);
     // When
     $cmd->execute(['command' => $this->cmd->getName(), '--config' => $cfgFile]);
     $expFile = $this->getFixtureRawData('bigtable-schema-dump.sql');
     $gotFile = file_get_contents($vSchema->url());
     // Then
     $this->assertSame($expFile, $gotFile);
 }