Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M3: Plugin bundle upgrade #8128

Merged
merged 58 commits into from Dec 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
05d47a7
Remove deprecated methods
hluchas Nov 14, 2019
fef2552
Remove deprecated \Mautic\PluginBundle\Integration\AbstractIntegratio…
hluchas Nov 14, 2019
092fcaa
Remove support for deprecated 3rd party plugins in \Mautic\PluginBund…
hluchas Nov 14, 2019
df02bdf
Revert "Remove deprecated \Mautic\PluginBundle\Integration\AbstractIn…
hluchas Nov 14, 2019
3311573
Remove MauticFactory from \Mautic\PluginBundle\Integration\AbstractIn…
hluchas Nov 14, 2019
117af72
Fix DynamicsApiTest dependencies
hluchas Nov 14, 2019
e384991
Fix ZohoIntegrationTest dependencies
hluchas Nov 14, 2019
b67a962
Fix DynamicsIntegrationTest dependencies
hluchas Nov 15, 2019
a49c9de
Refactor integration tests
hluchas Nov 15, 2019
abcf2c7
Simplify mock object names
hluchas Nov 15, 2019
4718870
Fix SalesforceIntegrationTest
hluchas Nov 15, 2019
89dae06
Replace deprecate setDefaultOptions in forms
hluchas Nov 15, 2019
ea9eb36
Use class constants in form types
hluchas Nov 15, 2019
ff4e446
Rename deprecated getName method in forms
hluchas Nov 15, 2019
443c287
Fix DNC remove test
hluchas Nov 26, 2019
bf18e51
Fix method visibility
hluchas Nov 26, 2019
81b045a
Merge branch 'm2-to-m3' into plugin-bundle-upgrade
hluchas Nov 29, 2019
25ae509
Fix \MauticCrmBundle\Api\DynamicsApiTest::setUp() method visibility
hluchas Nov 29, 2019
e067267
Fix DynamicsIntegrationTest::setUp() method visibility
hluchas Nov 29, 2019
2d6d8a8
Fix PHPUnit setUp() method visibility in project
hluchas Nov 29, 2019
9923890
Fix DNC test again
hluchas Nov 29, 2019
32974d2
Replace form types
hluchas Nov 29, 2019
de8a378
Replace getNameMethod in form
hluchas Nov 29, 2019
fd2ff93
Fix form configs
hluchas Nov 29, 2019
7601e7a
Add type describing comment
hluchas Dec 2, 2019
bb716d7
Fix integration dependencies
hluchas Dec 2, 2019
a288c62
Fix integration dependencies
hluchas Dec 2, 2019
cea53f0
Fix available services build in integration helper
hluchas Dec 2, 2019
3ff0bdd
Fix form type usage in integration settings
hluchas Dec 2, 2019
3b853e4
Add Pipedrive integration config
hluchas Dec 2, 2019
4b92c6c
Use FQCN for form types in \Mautic\PluginBundle\Controller\AjaxContro…
hluchas Dec 3, 2019
b16a76c
Use FQCN of \Mautic\PluginBundle\Form\Type\FieldsType in other types
hluchas Dec 3, 2019
5f6dd85
Use FQCN of IntegrationConfigType in \Mautic\PluginBundle\Controller…
hluchas Dec 3, 2019
a05c8c2
Use FQCN of IntegrationsListType in subscribers
hluchas Dec 3, 2019
349ce80
Use FQCN for callback in PointSubscriber
hluchas Dec 3, 2019
8407036
Remove setDefaultOptions from \Mautic\PluginBundle\Form\Type\DetailsType
hluchas Dec 3, 2019
9ba690b
Use FQCN of IntegrationCampaignsType in \Mautic\PluginBundle\Controll…
hluchas Dec 3, 2019
a9ad8d2
Use repository FQCN in entity
hluchas Dec 3, 2019
2b77687
Remove setters logic used in IntegrationPass and now used directly in…
hluchas Dec 3, 2019
6c7f7db
Remove IntegrationPass from CoreBundle as it is not needed to set dep…
hluchas Dec 3, 2019
3bbf717
Revert back ChoiceType field settings for mautic fields
hluchas Dec 3, 2019
829d596
Fix custom Pipedrive integration deps
hluchas Dec 3, 2019
a94dae3
Fix tests
hluchas Dec 3, 2019
76ed75a
Fix tests
hluchas Dec 3, 2019
a6fa4f8
Remove MauticFactory from dependencies
hluchas Dec 3, 2019
b102df3
Fix attributes in PipedriveIntegration
hluchas Dec 3, 2019
d8d5f61
Remove MauticFactory from EventHelper
hluchas Dec 4, 2019
73a02ed
Remove MauticFactory from IntegrationHelper and fix docblocks
hluchas Dec 4, 2019
9ec7011
Remove MauticFactory from PushLeadActivityCommand
hluchas Dec 4, 2019
9d73f3d
Revert "Remove MauticFactory from EventHelper"
hluchas Dec 4, 2019
ae18bb1
Flip $mauticFields in FieldsTypeTrait
hluchas Dec 4, 2019
2ddb00c
Remove unused methods from AjaxController
hluchas Dec 6, 2019
e5055aa
Revert "Remove unused methods from AjaxController"
hluchas Dec 6, 2019
096322e
Fix class import and docblock
hluchas Dec 9, 2019
08cb77d
Merge branch 'm2-to-m3' into plugin-bundle-upgrade
hluchas Dec 10, 2019
a07e240
Update plugins/MauticSocialBundle/Integration/SocialIntegration.php
hluchas Dec 10, 2019
bee11c5
Fix interface requirements in constructor
hluchas Dec 10, 2019
8cee6ea
Fix interface requirements in constructor
hluchas Dec 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -39,7 +39,7 @@ class AbstractCampaignCommand extends MauticMysqlTestCase
/**
* @throws \Exception
*/
public function setUp()
protected function setUp()
{
// Everything needs to happen anonymously
$this->defaultClientServer = $this->clientServer;
Expand Down
Expand Up @@ -13,7 +13,7 @@

class TriggerCampaignCommandTest extends AbstractCampaignCommand
{
public function setUp()
protected function setUp()
{
parent::setUp();

Expand Down
Expand Up @@ -31,7 +31,7 @@ class AdderTest extends \PHPUnit_Framework_TestCase
*/
private $leadEventLogRepository;

public function setUp()
protected function setUp()
{
$this->leadRepository = $this->createMock(LeadRepository::class);
$this->leadEventLogRepository = $this->createMock(LeadEventLogRepository::class);
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion app/bundles/CoreBundle/MauticCoreBundle.php
Expand Up @@ -26,6 +26,5 @@ public function build(ContainerBuilder $container)
$container->addCompilerPass(new Compiler\TemplatingPass());
$container->addCompilerPass(new Compiler\TranslationsPass());
$container->addCompilerPass(new Compiler\ModelPass());
$container->addCompilerPass(new Compiler\IntegrationPass());
}
}
2 changes: 1 addition & 1 deletion app/bundles/CoreBundle/Test/AbstractMauticTestCase.php
Expand Up @@ -45,7 +45,7 @@ abstract class AbstractMauticTestCase extends WebTestCase
'PHP_AUTH_PW' => 'mautic',
];

public function setUp()
protected function setUp()
{
\Mautic\CoreBundle\ErrorHandler\ErrorHandler::register('prod');

Expand Down
Expand Up @@ -27,7 +27,7 @@ class MaintenanceSubscriberTest extends \PHPUnit_Framework_TestCase
*/
private $subscriber;

public function setUp()
protected function setUp()
{
$connection = $this->createMock(Connection::class);
$userTokenRepository = $this->createMock(UserTokenRepositoryInterface::class);
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/CoreBundle/Test/MauticMysqlTestCase.php
Expand Up @@ -12,7 +12,7 @@ abstract class MauticMysqlTestCase extends AbstractMauticTestCase
/**
* @throws \Exception
*/
public function setUp()
protected function setUp()
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion app/bundles/CoreBundle/Test/MauticSqliteTestCase.php
Expand Up @@ -8,7 +8,7 @@

abstract class MauticSqliteTestCase extends AbstractMauticTestCase
{
public function setUp()
protected function setUp()
{
parent::setUp();

Expand Down
3 changes: 1 addition & 2 deletions app/bundles/CoreBundle/Test/MauticWebTestCase.php
Expand Up @@ -15,7 +15,6 @@

use Doctrine\Common\DataFixtures\ReferenceRepository;
use Liip\FunctionalTestBundle\Test\WebTestCase;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Finder\Finder;
use Symfony\Component\HttpFoundation\Request;
Expand Down Expand Up @@ -202,7 +201,7 @@ protected function assertNoError($response, $crawler, $fullOutput = false)
/**
* {@inheritdoc}
*/
public function setUp()
protected function setUp()
{
static::$kernel = static::createKernel();
static::$kernel->boot();
Expand Down
Expand Up @@ -28,7 +28,7 @@ public function __construct($name = null, array $data = [], $dataName = '')
parent::__construct($name, $data, $dataName);
}

public function setUp()
protected function setUp()
{
defined('MAUTIC_ENV') or define('MAUTIC_ENV', 'test');
}
Expand Down
Expand Up @@ -25,7 +25,7 @@ class MaxmindLookupTest extends \PHPUnit_Framework_TestCase
{
protected $mockHttp;

public function setUp()
protected function setUp()
{
// Mock http connector
$this->mockHttp = $this->getMockBuilder('Joomla\Http\Http')
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/EmailBundle/Tests/Helper/MailHelperTest.php
Expand Up @@ -56,7 +56,7 @@ class MailHelperTest extends \PHPUnit_Framework_TestCase
],
];

public function setUp()
protected function setUp()
{
defined('MAUTIC_ENV') or define('MAUTIC_ENV', 'test');
}
Expand Down
Expand Up @@ -32,7 +32,7 @@ class AmazonTransportTest extends \PHPUnit_Framework_TestCase
*/
private $translator;

public function setUp()
protected function setUp()
{
$this->logger = $this->getMockBuilder(Logger::class)
->disableOriginalConstructor()
Expand Down
Expand Up @@ -24,7 +24,7 @@ class ElasticemailTransportTest extends \PHPUnit_Framework_TestCase
private $transportCallback;
private $logger;

public function setUp()
protected function setUp()
{
$this->translator = $this->getMockBuilder(Translator::class)
->disableOriginalConstructor()
Expand Down
Expand Up @@ -14,7 +14,7 @@ class FormFieldHelperTest extends \PHPUnit_Framework_TestCase
*/
protected $fixture;

public function setUp()
protected function setUp()
{
$translatorMock = $this->getMockBuilder(TranslatorInterface::class)
->disableOriginalConstructor()
Expand Down
Expand Up @@ -198,7 +198,7 @@ public function testBachdDncAddAndRemove()
$clientResponse = $this->client->getResponse();
$response = json_decode($clientResponse->getContent(), true);

$this->assertFalse(isset($response['contacts'][0]['doNotContact'][0]));
$this->assertEmpty($response['contacts'][0]['doNotContact']);
hluchas marked this conversation as resolved.
Show resolved Hide resolved

// Remove contact
$this->client->request('DELETE', "/api/contacts/$contactId/delete");
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/LeadBundle/Tests/Helper/TokenHelperTest.php
Expand Up @@ -28,7 +28,7 @@ class TokenHelperTest extends \PHPUnit_Framework_TestCase
],
];

public function setUp()
protected function setUp()
{
$reflectionProperty = new ReflectionProperty(TokenHelper::class, 'parameters');
$reflectionProperty->setAccessible(true);
Expand Down
Expand Up @@ -25,7 +25,7 @@ class CompanyReportDataTest extends \PHPUnit_Framework_TestCase
*/
private $translator;

public function setUp()
protected function setUp()
{
$this->translator = $this->getMockBuilder(Translator::class)
->disableOriginalConstructor()
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/LeadBundle/Tests/Model/LeadListModelTest.php
Expand Up @@ -10,7 +10,7 @@ class LeadListModelTest extends \PHPUnit_Framework_TestCase
{
protected $fixture;

public function setUp()
protected function setUp()
{
$mockListModel = $this->getMockBuilder(ListModel::class)
->disableOriginalConstructor()
Expand Down
Expand Up @@ -17,7 +17,7 @@

class BaseDecoratorTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
protected function setUp()
{
parent::setUp();
defined('MAUTIC_TABLE_PREFIX') or define('MAUTIC_TABLE_PREFIX', '');
Expand Down
Expand Up @@ -18,7 +18,7 @@

class CustomMappedDecoratorTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
protected function setUp()
{
parent::setUp();
defined('MAUTIC_TABLE_PREFIX') or define('MAUTIC_TABLE_PREFIX', '');
Expand Down
Expand Up @@ -22,7 +22,7 @@

class DecoratorFactoryTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
protected function setUp()
{
parent::setUp();
defined('MAUTIC_TABLE_PREFIX') or define('MAUTIC_TABLE_PREFIX', '');
Expand Down
Expand Up @@ -80,7 +80,7 @@ class ContactTrackerTest extends \PHPUnit_Framework_TestCase
*/
private $leadFieldModelMock;

public function setUp()
protected function setUp()
{
$this->leadRepositoryMock = $this->getMockBuilder(LeadRepository::class)
->disableOriginalConstructor()
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/LeadBundle/Tests/Tracker/DeviceTrackerTest.php
Expand Up @@ -46,7 +46,7 @@ class DeviceTrackerTest extends \PHPUnit_Framework_TestCase
*/
private $userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36';

public function setUp()
protected function setUp()
{
$this->deviceCreatorService = new DeviceCreatorService();

Expand Down
19 changes: 18 additions & 1 deletion app/bundles/NotificationBundle/Config/config.php
Expand Up @@ -158,7 +158,24 @@
],
'integrations' => [
'mautic.integration.onesignal' => [
'class' => \Mautic\NotificationBundle\Integration\OneSignalIntegration::class,
'class' => \Mautic\NotificationBundle\Integration\OneSignalIntegration::class,
'arguments' => [
'event_dispatcher',
'mautic.helper.cache_storage',
'doctrine.orm.entity_manager',
'session',
'request_stack',
'router',
'translator',
'logger',
'mautic.helper.encryption',
'mautic.lead.model.lead',
'mautic.lead.model.company',
'mautic.helper.paths',
'mautic.core.model.notification',
'mautic.lead.model.field',
'mautic.plugin.model.integration_entity',
],
],
],
],
Expand Down
Expand Up @@ -22,7 +22,7 @@ class PageControllerTest extends MauticMysqlTestCase
/**
* @throws \Exception
*/
public function setUp()
protected function setUp()
{
parent::setUp();
$this->db = $this->container->get('doctrine.dbal.default_connection');
Expand Down
10 changes: 4 additions & 6 deletions app/bundles/PluginBundle/Command/PushLeadActivityCommand.php
Expand Up @@ -11,6 +11,7 @@

namespace Mautic\PluginBundle\Command;

use Mautic\PluginBundle\Helper\IntegrationHelper;
use Mautic\PluginBundle\Integration\AbstractIntegration;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -67,10 +68,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
{
$container = $this->getContainer();

/** @var \Mautic\CoreBundle\Factory\MauticFactory $factory */
$factory = $container->get('mautic.factory');

$translator = $factory->getTranslator();
$translator = $container->get('translator');
$integration = $input->getOption('integration');
$startDate = $input->getOption('start-date');
$endDate = $input->getOption('end-date');
Expand All @@ -88,8 +86,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

if ($integration && $startDate && $endDate) {
/** @var \Mautic\PluginBundle\Helper\IntegrationHelper $integrationHelper */
$integrationHelper = $factory->getHelper('integration');
/** @var IntegrationHelper $integrationHelper */
$integrationHelper = $container->get('mautic.helper.integration');

/** @var AbstractIntegration $integrationObject */
$integrationObject = $integrationHelper->getIntegrationObject($integration);
Expand Down