Skip to content

Commit

Permalink
updated composer.json, reverted change from 1.0.13, updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
koertho committed Jan 10, 2019
1 parent 1613572 commit 0f42e31
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 32 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,13 @@
# Changelog
All notable changes to this project will be documented in this file.

## [1.2.0] - 2019-01-10

### Changed
- now replaces multi column editor bundle
- reverted change from 1.0.13
- removed symfony 3 dependency

## [1.1.0] - 2018-12-11

### Removed
Expand Down
10 changes: 6 additions & 4 deletions composer.json
Expand Up @@ -16,7 +16,7 @@
{
"name": "Heimrich & Hannot",
"email": "digitales@heimrich-hannot.de",
"homepage": "http://www.heimrich-hannot.de",
"homepage": "https://www.heimrich-hannot.de",
"role": "Developer"
}
],
Expand All @@ -26,19 +26,18 @@
"require": {
"php": "^7.1",
"contao/core-bundle": "^4.4",
"symfony/framework-bundle": "^3.4",
"heimrichhannot/contao-utils-bundle": "^2.0",
"heimrichhannot/contao-ajax-bundle": "^1.0"
},
"require-dev": {
"contao/test-case": "^1.1",
"contao/test-case": "1.1.*",
"contao/manager-plugin": "^2.0",
"friendsofphp/php-cs-fixer": "^2.2",
"phpunit/phpunit": ">=6.0 <6.5",
"php-http/guzzle6-adapter": "^1.1",
"php-http/message-factory": "^1.0.2",
"php-coveralls/php-coveralls": "^2.0",
"symfony/phpunit-bridge": "^3.2"
"symfony/phpunit-bridge": "^4.2"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -68,5 +67,8 @@
},
"suggest": {
"heimrichhannot/contao-encore-bundle": "Provide webpack encore asset support."
},
"replace": {
"heimrichhannot/contao-multi_column_editor": "*"
}
}
2 changes: 1 addition & 1 deletion src/ContaoManager/Plugin.php
@@ -1,7 +1,7 @@
<?php

/*
* Copyright (c) 2018 Heimrich & Hannot GmbH
* Copyright (c) 2019 Heimrich & Hannot GmbH
*
* @license LGPL-3.0-or-later
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/AjaxController.php
@@ -1,7 +1,7 @@
<?php

/*
* Copyright (c) 2018 Heimrich & Hannot GmbH
* Copyright (c) 2019 Heimrich & Hannot GmbH
*
* @license LGPL-3.0-or-later
*/
Expand Down
@@ -1,7 +1,7 @@
<?php

/*
* Copyright (c) 2018 Heimrich & Hannot GmbH
* Copyright (c) 2019 Heimrich & Hannot GmbH
*
* @license LGPL-3.0-or-later
*/
Expand Down
2 changes: 1 addition & 1 deletion src/EventListener/HookListener.php
@@ -1,7 +1,7 @@
<?php

/*
* Copyright (c) 2018 Heimrich & Hannot GmbH
* Copyright (c) 2019 Heimrich & Hannot GmbH
*
* @license LGPL-3.0-or-later
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Form/FormMultiColumnEditor.php
@@ -1,7 +1,7 @@
<?php

/*
* Copyright (c) 2018 Heimrich & Hannot GmbH
* Copyright (c) 2019 Heimrich & Hannot GmbH
*
* @license LGPL-3.0-or-later
*/
Expand Down
2 changes: 1 addition & 1 deletion src/HeimrichHannotContaoMultiColumnEditorBundle.php
@@ -1,7 +1,7 @@
<?php

/*
* Copyright (c) 2018 Heimrich & Hannot GmbH
* Copyright (c) 2019 Heimrich & Hannot GmbH
*
* @license LGPL-3.0-or-later
*/
Expand Down
19 changes: 8 additions & 11 deletions src/Widget/MultiColumnEditor.php
@@ -1,7 +1,7 @@
<?php

/*
* Copyright (c) 2018 Heimrich & Hannot GmbH
* Copyright (c) 2019 Heimrich & Hannot GmbH
*
* @license LGPL-3.0-or-later
*/
Expand All @@ -16,7 +16,7 @@
use Contao\Widget;
use HeimrichHannot\MultiColumnEditorBundle\Controller\AjaxController;

class MultiColumnEditor extends \Contao\Widget
class MultiColumnEditor extends Widget
{
const ACTION_ADD_ROW = 'addRow';
const ACTION_DELETE_ROW = 'deleteRow';
Expand Down Expand Up @@ -86,13 +86,10 @@ public function generate()
}

/**
* @param string $strEditorTemplate
* @param string $strTable
* @param string $strFieldName
* @param mixed $varValue
* @param DataContainer $objDc
* @param array|null $arrDca
* @param array $arrErrors
* @throws \Psr\Cache\InvalidArgumentException
* @throws \Twig_Error_Loader
* @throws \Twig_Error_Runtime
* @throws \Twig_Error_Syntax
*
* @return string
*/
Expand Down Expand Up @@ -209,10 +206,10 @@ public function generateEditorForm(): string
$data['editorFormAction'] = System::getContainer()->get('request_stack')->getMasterRequest()->getRequestUri();
$data['rows'] = $this->generateRows($intRowCount, $arrDca, $strTable, $objDc, $arrValues, $arrErrors, $strFieldName);

return Controller::replaceInsertTags(System::getContainer()->get('twig')->render(
return System::getContainer()->get('twig')->render(
System::getContainer()->get('huh.utils.template')->getTemplate($this->getEditorTemplate()),
$data
));
);
}

/**
Expand Down
20 changes: 14 additions & 6 deletions tests/Controller/AjaxControllerTest.php
@@ -1,7 +1,7 @@
<?php

/*
* Copyright (c) 2018 Heimrich & Hannot GmbH
* Copyright (c) 2019 Heimrich & Hannot GmbH
*
* @license LGPL-3.0-or-later
*/
Expand Down Expand Up @@ -35,6 +35,7 @@
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
use Symfony\Component\HttpKernel\Config\FileLocator;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Routing\RouterInterface;

Expand Down Expand Up @@ -123,18 +124,23 @@ public function setUp(): void

$GLOBALS['TL_FFL']['hidden'] = 'Contao\FormHidden';

$this->container->set('huh.utils.container', new ContainerUtil($this->framework));

$this->kernel = $this->createMock(Kernel::class);
$this->kernel->method('getContainer')->willReturn($this->container);

$fileLocator = new FileLocator($this->kernel);

$backendMatcher = new RequestMatcher('/contao', 'test.com', null, ['192.168.1.0']);
$frontendMatcher = new RequestMatcher('/index', 'test.com', null, ['192.168.1.0']);
$scopeMatcher = new ScopeMatcher($backendMatcher, $frontendMatcher);
$this->container->set('huh.utils.container', new ContainerUtil($this->framework, $fileLocator, $scopeMatcher));

$this->container->set('kernel', $this->kernel);

$this->container->set('huh.ajax.action', new AjaxActionManager());
$this->container->set('huh.ajax', new AjaxManager());
$this->container->set('huh.utils.url', new UrlUtil($this->framework));
$this->container->set('huh.utils.form', new FormUtil($this->framework));
$this->container->set('huh.utils.template', new TemplateUtil($this->framework));
$this->container->set('huh.utils.form', new FormUtil($this->container, $this->framework));
$this->container->set('huh.utils.template', new TemplateUtil($this->framework, $this->kernel));

$twig = $this->createMock('Twig_Environment');

Expand Down Expand Up @@ -167,7 +173,9 @@ public function testCanBeInstantiated()
$this->container->set('request_stack', new RequestStack());
System::setContainer($this->container);

$extension = new AjaxController(new MultiColumnEditor(['strTable' => 'tl_test', 'strField' => 'test']));
$multicolumnMock = $this->createMock(MultiColumnEditor::class);

$extension = new AjaxController($multicolumnMock);
$this->assertInstanceOf('HeimrichHannot\MultiColumnEditorBundle\Controller\AjaxController', $extension);
}

Expand Down
@@ -1,7 +1,7 @@
<?php

/*
* Copyright (c) 2018 Heimrich & Hannot GmbH
* Copyright (c) 2019 Heimrich & Hannot GmbH
*
* @license LGPL-3.0-or-later
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/EventListener/HookListenerTest.php
@@ -1,7 +1,7 @@
<?php

/*
* Copyright (c) 2018 Heimrich & Hannot GmbH
* Copyright (c) 2019 Heimrich & Hannot GmbH
*
* @license LGPL-3.0-or-later
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/HeimrichHannotContaoMultiColumnEditorBundleTest.php
@@ -1,7 +1,7 @@
<?php

/*
* Copyright (c) 2018 Heimrich & Hannot GmbH
* Copyright (c) 2019 Heimrich & Hannot GmbH
*
* @license LGPL-3.0-or-later
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/Plugin/PluginTest.php
@@ -1,7 +1,7 @@
<?php

/*
* Copyright (c) 2018 Heimrich & Hannot GmbH
* Copyright (c) 2019 Heimrich & Hannot GmbH
*
* @license LGPL-3.0-or-later
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.php
@@ -1,7 +1,7 @@
<?php

/*
* Copyright (c) 2018 Heimrich & Hannot GmbH
* Copyright (c) 2019 Heimrich & Hannot GmbH
*
* @license LGPL-3.0-or-later
*/
Expand Down

0 comments on commit 0f42e31

Please sign in to comment.