protected function setUp()
 {
     parent::setUp();
     $this->messageReporterFactory = MessageReporterFactory::getInstance();
     $this->tableBuilder = TableBuilder::factory($this->getStore()->getConnection(DB_MASTER));
     $this->stringValidator = $this->testEnvironment->getUtilityFactory()->newValidatorFactory()->newStringValidator();
 }
 public function testTryToConstructOnInvalidTypeThrowsException()
 {
     $connection = $this->getMockBuilder('\\DatabaseBase')->disableOriginalConstructor()->getMockForAbstractClass();
     $connection->expects($this->any())->method('getType')->will($this->returnValue('foo'));
     $this->setExpectedException('RuntimeException');
     TableBuilder::factory($connection);
 }
 /**
  * @since 2.5
  *
  * @return Installer
  */
 public function newInstaller()
 {
     $messageReporter = MessageReporterFactory::getInstance()->newNullMessageReporter();
     $options = $this->store->getOptions();
     $tableBuilder = TableBuilder::factory($this->store->getConnection(DB_MASTER));
     $tableBuilder->setMessageReporter($messageReporter);
     $tableIntegrityExaminer = new TableIntegrityExaminer($this->store);
     $tableSchemaManager = new TableSchemaManager($this->store);
     $installer = new Installer($tableSchemaManager, $tableBuilder, $tableIntegrityExaminer);
     if ($options->has(Installer::OPT_MESSAGEREPORTER)) {
         $installer->setMessageReporter($options->get(Installer::OPT_MESSAGEREPORTER));
     }
     $installer->isFromExtensionSchemaUpdate($options->has('isFromExtensionSchemaUpdate') ? $options->get('isFromExtensionSchemaUpdate') : false);
     return $installer;
 }