Skip to content

Commit

Permalink
switch from scrutinizer-ci to travis-ci
Browse files Browse the repository at this point in the history
add basic test
  • Loading branch information
arosenhagen committed Jan 4, 2015
1 parent 566781d commit 8b0dc39
Show file tree
Hide file tree
Showing 14 changed files with 223 additions and 12 deletions.
4 changes: 0 additions & 4 deletions .scrutinizer.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
language: php

php:
- 5.3
- 5.4
- 5.5

sudo: false

env:
- MAGENTO_VERSION="1.5.0.1"
- MAGENTO_VERSION="1.6.0.0"
- MAGENTO_VERSION="1.6.1.0"
- MAGENTO_VERSION="1.6.2.0"
- MAGENTO_VERSION="1.7.0.0"
- MAGENTO_VERSION="1.7.0.1"
- MAGENTO_VERSION="1.7.0.2"
- MAGENTO_VERSION="1.8.0.0"
- MAGENTO_VERSION="1.8.1.0"
- MAGENTO_VERSION="1.9.0.0"
- MAGENTO_VERSION="1.9.0.1"
- MAGENTO_VERSION="1.9.1.0"

before_script:
- mkdir magento/
- git clone https://github.com/netz98/n98-magerun ./n98-magerun/
- git clone git://github.com/EcomDev/MageCI.git ./mageci/
- ./mageci/bin/mage-ci install magento $MAGENTO_VERSION magento_test -c -t -r http://mage-ci.ecomdev.org
- composer update
- git clone git://github.com/EcomDev/EcomDev_PHPUnit.git -b dev ./phpunit/
- CURR_DIR=$(pwd)
- wget https://raw.githubusercontent.com/colinmollenhour/modman/master/modman -O ./mageci/bin/modman
- chmod +x ./mageci/bin/modman
- ./mageci/bin/mage-ci install-module magento $CURR_DIR/phpunit
- ./mageci/bin/mage-ci install-module magento $CURR_DIR
- composer install --dev
- cd magento

script:
- ../vendor/bin/phpunit --group EM_DeleteOrder
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
EM_DeleteOrder
==============
[![Code Quality](https://scrutinizer-ci.com/g/ffuenf/EM_DeleteOrder/badges/quality-score.png?b=php5.5-compat)][scrutinizer]
[![GitHub tag](http://img.shields.io/github/tag/ffuenf/EM_DeleteOrder.svg)][tag]
[![Build Status](http://img.shields.io/travis/ffuenf/EM_DeleteOrder.svg)][travis]

[scrutinizer]: https://scrutinizer-ci.com/g/ffuenf/EM_DeleteOrder/?b=php5.5-compat
[tag]: https://github.com/ffuenf/EM_DeleteOrder
[travis]: https://travis-ci.org/ffuenf/EM_DeleteOrder

Enhance Magento feature with ability to delete orders

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ class EM_DeleteOrder_Block_Adminhtml_Sales_Order_Grid extends Mage_Adminhtml_Blo
*/
protected function _prepareMassaction() {
$retValue = parent::_prepareMassaction();
$this->getMassactionBlock()->addItem('delete_order', array(
'label'=> Mage::helper('sales')->__('Delete order'),
'url' => $this->getUrl('*/sales_order/deleteorder'),
));
if (Mage::getStoreConfig('system/em_deleteorder/enable')) {
$this->getMassactionBlock()->addItem('delete_order', array(
'label'=> Mage::helper('sales')->__('Delete order'),
'url' => $this->getUrl('*/sales_order/deleteorder'),
));
}
return $retValue;
}
}
28 changes: 28 additions & 0 deletions app/code/community/EM/DeleteOrder/Helper/Data.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
class Em_DeleteOrder_Helper_Data extends Mage_Core_Helper_Abstract
{
/**
* Path for the config for extension active status
*/
const CONFIG_EXTENSION_ACTIVE = 'system/em_deleteorder/enable';

/**
* Variable for if the extension is active
*
* @var bool
*/
protected $bExtensionActive;

/**
* Check to see if the extension is active
*
* @return bool
*/
public function isExtensionActive()
{
if ($this->bExtensionActive === null) {
$this->bExtensionActive = Mage::getStoreConfigFlag(self::CONFIG_EXTENSION_ACTIVE);
}
return $this->bExtensionActive;
}
}
24 changes: 24 additions & 0 deletions app/code/community/EM/DeleteOrder/Test/Helper/Data.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

/**
* Test for class EM_DeleteOrder_Helper_Data
*
* @category EM
* @package EM_DeleteOrder
*/
class EM_DeleteOrder_Test_Helper_Data extends EcomDev_PHPUnit_Test_Case
{
/**
* Tests is extension active
*
* @test
* @loadFixture
*/
public function testIsExtensionActive()
{
$this->assertTrue(
Mage::helper('em_deleteorder')->isExtensionActive(),
'Extension is not active please check config'
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config:
default/system/em_deleteorder/enable: 1
60 changes: 60 additions & 0 deletions app/code/community/EM/DeleteOrder/etc/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0"?>
<config>
<modules>
<EM_DeleteOrder>
<version>1.0.0</version>
</EM_DeleteOrder>
</modules>
<global>
<helpers>
<em_deleteorder>
<class>EM_DeleteOrder_Helper</class>
</em_deleteorder>
</helpers>
<rewrite>
<em_emadmin_adminhtml_sales_order>
<from><![CDATA[#/admin/sales_order/#]]></from>
<to>/emadmin/adminhtml_sales_order/</to>
</em_emadmin_adminhtml_sales_order>
</rewrite>
<blocks>
<adminhtml>
<rewrite>
<sales_order_grid>EM_DeleteOrder_Block_Adminhtml_Sales_Order_Grid</sales_order_grid>
</rewrite>
</adminhtml>
</blocks>
</global>
<admin>
<routers>
<em_deleteorder>
<use>admin</use>
<args>
<module>EM_DeleteOrder</module>
<frontName>emadmin</frontName>
</args>
</em_deleteorder>
<adminhtml>
<args>
<modules>
<EM_DeleteOrder_Adminhtml before="Mage_Adminhtml">EM_DeleteOrder_Adminhtml</EM_DeleteOrder_Adminhtml>
</modules>
</args>
</adminhtml>
</routers>
</admin>
<default>
<system>
<em_deleteorder>
<enable>0</enable>
</em_deleteorder>
</system>
</default>
<phpunit>
<suite>
<modules>
<EM_DeleteOrder/>
</modules>
</suite>
</phpunit>
</config>
29 changes: 29 additions & 0 deletions app/code/community/EM/DeleteOrder/etc/system.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<config>
<sections>
<system>
<groups>
<em_deleteorder translate="label" module="em_deleteorder">
<label>EM_DeleteOrder</label>
<frontend_type>text</frontend_type>
<sort_order>900</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<fields>
<enable translate="label,comment">
<label>Enable EM_DeleteOrder</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<comment><![CDATA[Enable or disable extension.]]></comment>
</enable>
</fields>
</em_deleteorder>
</groups>
</system>
</sections>
</config>
7 changes: 7 additions & 0 deletions EM/DeleteOrder/etc/config.xml → app/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,11 @@
</adminhtml>
</routers>
</admin>
<phpunit>
<suite>
<modules>
<EM_DeleteOrder/>
</modules>
</suite>
</phpunit>
</config>
File renamed without changes.
21 changes: 21 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "ffuenf/EM_DeleteOrder",
"license": "OSL-3.0",
"type": "magento-module",
"require": {
"magento-hackathon/magento-composer-installer": "*",
"colinmollenhour/modman": "*"
},
"require-dev": {
"phpunit/phpunit": "3.7.*"
},
"repositories": [
{
"type": "composer",
"url": "http://packages.firegento.com"
}
],
"extra": {
"magento-root-dir": "./magento/"
}
}
4 changes: 2 additions & 2 deletions modman
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
EM/DeleteOrder app/code/community/EM/DeleteOrder
modules/EM_DeleteOrder.xml app/etc/modules/EM_DeleteOrder.xml
app/code/community/EM/DeleteOrder app/code/community/EM/DeleteOrder
app/etc/modules/EM_DeleteOrder.xml app/etc/modules/EM_DeleteOrder.xml

0 comments on commit 8b0dc39

Please sign in to comment.