Skip to content
This repository has been archived by the owner on May 30, 2019. It is now read-only.

Commit

Permalink
Added Bridge for Visithor Bundle
Browse files Browse the repository at this point in the history
* Added initial visithor configuration file
* Added visithor test to travis with green result
* Added default carrier ranges to cover basic scenario
* Fixed routes to make visithor pass
* Moved phpunit.xml.dist to the root
* Fixed workflow product test
  • Loading branch information
mmoreram committed May 7, 2015
1 parent 945db4e commit c101c6c
Show file tree
Hide file tree
Showing 19 changed files with 514 additions and 112 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -41,7 +41,8 @@ services:

script:
- bin/behat -fprogress --tags="~javascript"
- bin/phpunit -c app
- bin/phpunit
- php app/console visithor:go --format=pretty --env=test

notifications:
email: false
Expand Down
3 changes: 3 additions & 0 deletions app/AppKernel.php
Expand Up @@ -169,6 +169,9 @@ public function registerBundles()
$bundles[] = new Elcodi\Bundle\FixturesBoosterBundle\ElcodiFixturesBoosterBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();

$bundles[] = new Visithor\Bundle\VisithorBundle();
$bundles[] = new Elcodi\Common\VisithorBridgeBundle\VisithorBridgeBundle();
}

return $bundles;
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -122,7 +122,8 @@
"phpunit/phpunit": "4.5.0",

"mmoreram/php-formatter": "1.0.4",
"fabpot/php-cs-fixer": "1.4.2"
"fabpot/php-cs-fixer": "1.4.2",
"visithor/visithor-bundle": "~0.1, >=0.1.7"
},
"scripts": {
"post-install-cmd": [
Expand Down
1 change: 0 additions & 1 deletion features/store/category.feature
Expand Up @@ -8,7 +8,6 @@ Feature: Store category
Given I am on "category/women-shirts/1"
Then I should see more than 0 products

@haha
Scenario: Category redirection
Given I am on "category/women-shirts-false/1"
Then I should be on "category/women-shirts/1"
2 changes: 1 addition & 1 deletion features/workflow/product.feature
Expand Up @@ -18,7 +18,7 @@ Feature: Product engine
And I check "elcodi_admin_product_form_type_product_enabled"
And I press "submit-save"
And I am on "/admin/product/19/variant/new"
And I wait "1" seconds
And I wait "3" seconds
And I select "1" from "select-Size"
And I select "4" from "select-Color"
And I fill in the following:
Expand Down
10 changes: 5 additions & 5 deletions app/phpunit.xml.dist → phpunit.xml.dist
Expand Up @@ -11,20 +11,20 @@
processIsolation = "false"
stopOnFailure = "false"
syntaxCheck = "false"
bootstrap = "bootstrap.php.cache" >
bootstrap = "app/bootstrap.php.cache" >

<testsuites>
<testsuite name="Bamboo Test Suite">
<directory>../src/Elcodi/*/*Bundle/Tests</directory>
<directory>src/Elcodi/*/*Bundle/Tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>../src</directory>
<directory>src</directory>
<exclude>
<directory>../src/Elcodi/*/*Bundle/Resources</directory>
<directory>../src/Elcodi/*/*Bundle/Tests</directory>
<directory>src/Elcodi/*/*Bundle/Resources</directory>
<directory>src/Elcodi/*/*Bundle/Tests</directory>
</exclude>
</whitelist>
</filter>
Expand Down
Expand Up @@ -21,7 +21,6 @@

use Elcodi\Bundle\CoreBundle\DataFixtures\ORM\Abstracts\AbstractFixture;
use Elcodi\Component\Core\Services\ObjectDirector;
use Elcodi\Component\Currency\Factory\CurrencyFactory;

/**
* Class CurrencyEuroData
Expand Down
Expand Up @@ -17,7 +17,6 @@

namespace Elcodi\Admin\ProductBundle\Controller;

use Elcodi\Component\Media\Entity\Interfaces\ImageInterface;
use Mmoreram\ControllerExtraBundle\Annotation\Entity as EntityAnnotation;
use Mmoreram\ControllerExtraBundle\Annotation\Form as FormAnnotation;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
Expand All @@ -29,6 +28,7 @@

use Elcodi\Admin\CoreBundle\Controller\Abstracts\AbstractAdminController;
use Elcodi\Component\Core\Entity\Interfaces\EnabledInterface;
use Elcodi\Component\Media\Entity\Interfaces\ImageInterface;
use Elcodi\Component\Product\Entity\Interfaces\ManufacturerInterface;

/**
Expand Down
Expand Up @@ -17,7 +17,6 @@

namespace Elcodi\Admin\ProductBundle\Controller;

use Elcodi\Component\Media\Entity\Interfaces\ImageInterface;
use Mmoreram\ControllerExtraBundle\Annotation\Entity as EntityAnnotation;
use Mmoreram\ControllerExtraBundle\Annotation\Form as FormAnnotation;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
Expand All @@ -29,6 +28,7 @@

use Elcodi\Admin\CoreBundle\Controller\Abstracts\AbstractAdminController;
use Elcodi\Component\Core\Entity\Interfaces\EnabledInterface;
use Elcodi\Component\Media\Entity\Interfaces\ImageInterface;
use Elcodi\Component\Product\Entity\Interfaces\ProductInterface;

/**
Expand Down
Expand Up @@ -17,7 +17,6 @@

namespace Elcodi\Admin\ProductBundle\Controller;

use Elcodi\Component\Media\Entity\Interfaces\ImageInterface;
use Mmoreram\ControllerExtraBundle\Annotation\Entity as EntityAnnotation;
use Mmoreram\ControllerExtraBundle\Annotation\Form as FormAnnotation;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
Expand All @@ -31,6 +30,7 @@
use Elcodi\Component\Attribute\Entity\Interfaces\AttributeInterface;
use Elcodi\Component\Attribute\Entity\Interfaces\ValueInterface;
use Elcodi\Component\Core\Entity\Interfaces\EnabledInterface;
use Elcodi\Component\Media\Entity\Interfaces\ImageInterface;
use Elcodi\Component\Product\Entity\Interfaces\ProductInterface;
use Elcodi\Component\Product\Entity\Interfaces\VariantInterface;

Expand Down

This file was deleted.

Expand Up @@ -31,10 +31,12 @@

{% block header_actions %}

<a href="{{ url('admin_customer_order_list', { customerId: customer.id }) }}" type="button" class="button-primary">
<i class="icon-shopping-cart"></i>
<span>{{ 'admin.order.from_user'|trans({ '%name%': customer.firstname }) }}</span>
</a>
{% if customer.id %}
<a href="{{ url('admin_customer_order_list', { customerId: customer.id }) }}" type="button" class="button-primary">
<i class="icon-shopping-cart"></i>
<span>{{ 'admin.order.from_user'|trans({ '%name%': customer.firstname }) }}</span>
</a>
{% endif %}

{% endblock header_actions %}

Expand Down
@@ -0,0 +1,81 @@
<?php

/*
* This file is part of the Elcodi package.
*
* Copyright (c) 2014-2015 Elcodi.com
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Feel free to edit as you please, and have fun.
*
* @author Marc Morera <yuhu@mmoreram.com>
* @author Aldo Chiecchia <zimage@tiscali.it>
* @author Elcodi Team <tech@elcodi.com>
*/

namespace Elcodi\Common\VisithorBridgeBundle\DependencyInjection;

use Elcodi\Bundle\CoreBundle\DependencyInjection\Abstracts\AbstractExtension;

/**
* Class VisithorBridgeExtension
*/
class VisithorBridgeExtension extends AbstractExtension
{
/**
* @var string
*
* Extension name
*/
const EXTENSION_NAME = 'visithor_bridge';

/**
* Get the Config file location
*
* @return string Config file location
*/
public function getConfigFilesLocation()
{
return __DIR__ . '/../Resources/config';
}

/**
* Config files to load
*
* Each array position can be a simple file name if must be loaded always,
* or an array, with the filename in the first position, and a boolean in
* the second one.
*
* As a parameter, this method receives all loaded configuration, to allow
* setting this boolean value from a configuration value.
*
* return array(
* 'file1.yml',
* 'file2.yml',
* ['file3.yml', $config['my_boolean'],
* ...
* );
*
* @param array $config Config definitions
*
* @return array Config files
*/
protected function getConfigFiles(array $config)
{
return [
'visithor',
];
}

/**
* Returns the extension alias, same value as extension name
*
* @return string The alias
*/
public function getAlias()
{
return self::EXTENSION_NAME;
}
}

0 comments on commit c101c6c

Please sign in to comment.