Esempio n. 1
0
 public function testBreakpointWithInvalidVersion()
 {
     if (!TESTS_PHINX_DB_ADAPTER_MYSQL_ENABLED) {
         $this->markTestSkipped('Mysql tests disabled. See TESTS_PHINX_DB_ADAPTER_MYSQL_ENABLED constant.');
     }
     $configArray = $this->getConfigArray();
     $adapter = $this->manager->getEnvironment('production')->getAdapter();
     $config = new Config($configArray);
     // ensure the database is empty
     $adapter->dropDatabase(TESTS_PHINX_DB_ADAPTER_MYSQL_DATABASE);
     $adapter->createDatabase(TESTS_PHINX_DB_ADAPTER_MYSQL_DATABASE);
     $adapter->disconnect();
     // migrate to the latest version
     $this->manager->setConfig($config);
     $this->manager->migrate('production');
     $this->manager->getOutput()->setDecorated(false);
     // set breakpoint on most recent migration
     $this->manager->toggleBreakpoint('production', 999);
     rewind($this->manager->getOutput()->getStream());
     $output = stream_get_contents($this->manager->getOutput()->getStream());
     $this->assertContains('is not a valid version', $output);
 }