Skip to content

Instantly share code, notes, and snippets.

@jreinke
Last active December 29, 2015 08:29
Show Gist options
  • Save jreinke/7644088 to your computer and use it in GitHub Desktop.
Save jreinke/7644088 to your computer and use it in GitHub Desktop.
Testing a simple Magento 2 module installation
<?xml version="1.0"?>
<!-- app/code/Namespace/Test/etc/di.xml -->
<config>
<type name="Magento\Module\Updater\SetupFactory">
<param name="resourceTypes">
<value>
<test_setup>Magento\Core\Model\Resource\Setup</test_setup>
</value>
</param>
</type>
</config>
<?php
// app/code/Namespace/Test/sql/test_setup/install-2.0.0.0.php
/* @var $installer \Magento\Core\Model\Resource\Setup */
$installer = $this;
$installer->startSetup();
var_dump("come on!");exit;
$installer->endSetup();
<?xml version="1.0"?>
<!-- app/code/Namespace/Test/etc/module.xml -->
<config>
<module name="Namespace_Test" version="2.0.0.0" active="true">
<sequence>
<module name="Magento_Core"/>
</sequence>
<depends>
<module name="Magento_Core"/>
</depends>
</module>
</config>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment