Merge branch 'master' into frontend
Conflicts: templates/backOffice/default/folder-edit.html
This commit is contained in:
@@ -250,7 +250,7 @@ class TemplateHelper
|
||||
|
||||
$translation = str_replace("'", "\'", $translations[$key]);
|
||||
|
||||
fwrite($fp, sprintf("\t'%s' => '%s',\n", $text, $translation));
|
||||
fwrite($fp, sprintf(" '%s' => '%s',\n", $text, $translation));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,13 +35,14 @@ use Thelia\Model\ContentFolder;
|
||||
use Thelia\Model\ContentFolderQuery;
|
||||
use Thelia\Model\ContentQuery;
|
||||
use Thelia\Model\FolderQuery;
|
||||
use Thelia\Tests\TestCaseWithURLToolSetup;
|
||||
|
||||
/**
|
||||
* Class ContentTest
|
||||
* @package Thelia\Tests\Action
|
||||
* @author Manuel Raynaud <mraynaud@openstudio.fr>
|
||||
*/
|
||||
class ContentTest extends BaseAction
|
||||
class ContentTest extends TestCaseWithURLToolSetup
|
||||
{
|
||||
|
||||
public function getUpdateEvent(&$content)
|
||||
|
||||
@@ -31,14 +31,45 @@ use Thelia\Core\Event\Folder\FolderToggleVisibilityEvent;
|
||||
use Thelia\Core\Event\Folder\FolderUpdateEvent;
|
||||
use Thelia\Core\Event\UpdatePositionEvent;
|
||||
use Thelia\Model\FolderQuery;
|
||||
use Thelia\Tests\TestCaseWithURLToolSetup;
|
||||
|
||||
/**
|
||||
* Class FolderTest
|
||||
* @package Thelia\Tests\Action\ImageTest
|
||||
* @author Manuel Raynaud <mraynaud@openstudio.fr>
|
||||
*/
|
||||
class FolderTest extends BaseAction
|
||||
class FolderTest extends TestCaseWithURLToolSetup
|
||||
{
|
||||
use RewrittenUrlTestTrait;
|
||||
|
||||
public function getUpdateEvent(&$folder)
|
||||
{
|
||||
if(!$folder instanceof \Thelia\Model\Folder) {
|
||||
$folder = $this->getRandomFolder();
|
||||
}
|
||||
|
||||
$event = new FolderUpdateEvent($folder->getId());
|
||||
$event
|
||||
->setVisible(1)
|
||||
->setLocale($folder->getLocale())
|
||||
->setTitle($folder->getTitle())
|
||||
->setChapo($folder->getChapo())
|
||||
->setDescription($folder->getDescription())
|
||||
->setPostscriptum($folder->getPostscriptum())
|
||||
->setParent($folder->getParent())
|
||||
;
|
||||
|
||||
return $event;
|
||||
}
|
||||
|
||||
public function processUpdateAction($event)
|
||||
{
|
||||
$contentAction = new Folder($this->getContainer());
|
||||
$contentAction->update($event);
|
||||
|
||||
return $event->getFolder();
|
||||
}
|
||||
|
||||
/**
|
||||
* test folder creation
|
||||
* @covers Thelia\Action\Folder::create
|
||||
|
||||
@@ -8,30 +8,17 @@ use Thelia\Model\ConfigQuery;
|
||||
use Thelia\Rewriting\RewritingResolver;
|
||||
use Thelia\Tools\URL;
|
||||
|
||||
/**
|
||||
* Class RewrittenUrlTestTrait
|
||||
* @package Thelia\Tests\Action
|
||||
|
||||
* @author Etienne Roudeix <eroudeix@openstudio.fr>
|
||||
*/
|
||||
trait RewrittenUrlTestTrait
|
||||
{
|
||||
abstract public function getUpdateEvent(&$object);
|
||||
abstract public function processUpdateAction($event);
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
new URL(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Thelia\Form\Exception\FormValidationException
|
||||
* @expectedExceptionCode 100
|
||||
*/
|
||||
public function testUpdateEmptyUrl()
|
||||
{
|
||||
$object = null;
|
||||
$event = $this->getUpdateEvent($object);
|
||||
|
||||
$event->setUrl('');
|
||||
|
||||
$updatedObject = $this->processUpdateAction($event);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Thelia\Form\Exception\FormValidationException
|
||||
* @expectedExceptionCode 100
|
||||
@@ -54,7 +41,7 @@ trait RewrittenUrlTestTrait
|
||||
|
||||
$event->setUrl($existingUrl->getUrl());
|
||||
|
||||
$updatedObject = $this->processUpdateAction($event);
|
||||
$this->processUpdateAction($event);
|
||||
}
|
||||
|
||||
public function testUpdateUrl()
|
||||
|
||||
@@ -30,15 +30,21 @@ namespace Thelia\Tests;
|
||||
*/
|
||||
class TestCaseWithURLToolSetup extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
private $container = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->container = new \Symfony\Component\DependencyInjection\ContainerBuilder();
|
||||
|
||||
$dispatcher = $this->getMock("Symfony\Component\EventDispatcher\EventDispatcherInterface");
|
||||
|
||||
$this->container->set("event_dispatcher", $dispatcher);
|
||||
|
||||
$this->setupURLTool();
|
||||
}
|
||||
|
||||
protected function setupURLTool()
|
||||
{
|
||||
$container = new \Symfony\Component\DependencyInjection\ContainerBuilder();
|
||||
|
||||
$context = new \Symfony\Component\Routing\RequestContext(
|
||||
'/thelia/index.php',
|
||||
'GET',
|
||||
@@ -57,8 +63,13 @@ class TestCaseWithURLToolSetup extends \PHPUnit_Framework_TestCase
|
||||
->method('getContext')
|
||||
->will($this->returnValue($context));
|
||||
|
||||
$container->set("router.admin", $router);
|
||||
$this->container->set("router.admin", $router);
|
||||
|
||||
new \Thelia\Tools\URL($container);
|
||||
new \Thelia\Tools\URL($this->container);
|
||||
}
|
||||
|
||||
public function getContainer()
|
||||
{
|
||||
return $this->container;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,17 +51,12 @@ class URL
|
||||
self::$instance = $this;
|
||||
|
||||
if ($container !== null)
|
||||
$this->requestContext = $this->getContext($container);
|
||||
$this->requestContext = $container->get('router.admin')->getContext();
|
||||
|
||||
$this->retriever = new RewritingRetriever();
|
||||
$this->resolver = new RewritingResolver();
|
||||
}
|
||||
|
||||
public function getContext($container)
|
||||
{
|
||||
return $container->get('router.admin')->getContext();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return this class instance, only once instanciated.
|
||||
*
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -27,7 +27,7 @@
|
||||
{if !$IS_ENABLED}
|
||||
<div class="alert alert-info">
|
||||
<span class="glyphicon glyphicon-question-sign"></span>
|
||||
{intl l='This coupon is disabled, you can enable to the bottom of this form.'}
|
||||
{intl l='This coupon is disabled, you can enable at the bottom of this form.'}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
@@ -119,12 +119,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{include
|
||||
file="includes/inner-form-toolbar.html"
|
||||
hide_flags = true
|
||||
|
||||
close_url="{url path='/admin/folders' folder_id=$folder_id}"
|
||||
}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="control-group">
|
||||
<lablel> </lablel>
|
||||
<div class="controls">
|
||||
<p>{intl l='Folder created on %date_create. Last modification: %date_change' date_create="{format_date date=$CREATE_DATE}" date_change="{format_date date=$UPDATE_DATE}"}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<small>{intl l='Colder created on %date_create. Last modification: %date_change' date_create="{format_date date=$CREATE_DATE}" date_change="{format_date date=$UPDATE_DATE}"}</small>
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
|
||||
|
||||
<p class="title title-without-tabs">{intl l="Image informations"}</p>
|
||||
<p class="title title-without-tabs">{intl l="Image information"}</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<form method="POST" action="{url path='/admin/content/folder/add'}" id="related_content_form">
|
||||
|
||||
<p class="title title-without-tabs">{intl l='Additional Folders'}</p>
|
||||
<p>{intl l='A content could be attached to more than one folder. Select here the additional fodlers for this content.'}
|
||||
<p>{intl l='A content could be attached to more than one folder. Select here the additional folders for this content.'}
|
||||
{loop name="default_folder" type="folder" id=$DEFAULT_FOLDER}
|
||||
{intl l='You can change the default folder (%title) in the "General" tab.' title=$TITLE}
|
||||
{/loop}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
<div class="alert alert-info">
|
||||
<p>{intl l="In order to manges your shop taxes you can manage"} <strong>{intl l="taxes"}</strong> {intl l="and"} <strong>{intl l="tax rules"}</strong>.</p>
|
||||
<p>{intl l="Taxes define the amount of money which is add to a bought product."}</p>
|
||||
<p>{intl l="Taxes define the amount of money which is added to a bought product."}</p>
|
||||
<p>
|
||||
{intl l="Example :"}
|
||||
<ul>
|
||||
|
||||
0
templates/email/default/I18n/en_US.php
Normal file → Executable file
0
templates/email/default/I18n/en_US.php
Normal file → Executable file
0
templates/email/default/I18n/es_ES.php
Normal file → Executable file
0
templates/email/default/I18n/es_ES.php
Normal file → Executable file
0
templates/email/default/I18n/fr_FR.php
Normal file → Executable file
0
templates/email/default/I18n/fr_FR.php
Normal file → Executable file
0
templates/email/default/I18n/it_IT.php
Normal file → Executable file
0
templates/email/default/I18n/it_IT.php
Normal file → Executable file
Reference in New Issue
Block a user