<?php

namespace Oro\Bundle\TrackingBundle\Tests\Unit\DependencyInjection;

use Oro\Bundle\TrackingBundle\DependencyInjection\OroTrackingExtension;

class OroBundleTrackingExtensionTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var OroTrackingExtension
     */
    protected $extension;

    /**
     * @var \PHPUnit_Framework_MockObject_MockObject
     */
    protected $container;

    protected function setUp()
    {
        $this->container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')
            ->disableOriginalConstructor()
            ->getMock();
        $this->extension = new OroTrackingExtension();
    }

    public function testLoad()
    {
        $this->container->expects($this->once())
            ->method('prependExtensionConfig')
            ->with('oro_tracking', $this->isType('array'));
        $this->extension->load([], $this->container);
    }
}

<?php

namespace Oro\Bundle\TrackingBundle\Tests\Unit\DependencyInjection;

use Oro\Bundle\TrackingBundle\DependencyInjection\OroTrackingExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class OroBundleTrackingExtensionTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var OroTrackingExtension
     */
    protected $extension;

    /**
     * @var ContainerBuilder
     */
    protected $container;

    protected function setUp()
    {
        $this->container = new ContainerBuilder();
        $this->extension = new OroTrackingExtension();
    }

    public function testLoad()
    {
        $this->extension->load([], $this->container);
    }
}

--- 
+++ 
@@ -3,7 +3,6 @@
 namespace Oro\Bundle\TrackingBundle\Tests\Unit\DependencyInjection;
 
 use Oro\Bundle\TrackingBundle\DependencyInjection\OroTrackingExtension;
-use Symfony\Component\DependencyInjection\ContainerBuilder;
 
 class OroBundleTrackingExtensionTest extends \PHPUnit_Framework_TestCase
 {
@@ -13,18 +12,23 @@
     protected $extension;
 
     /**
-     * @var ContainerBuilder
+     * @var \PHPUnit_Framework_MockObject_MockObject
      */
     protected $container;
 
     protected function setUp()
     {
-        $this->container = new ContainerBuilder();
+        $this->container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')
+            ->disableOriginalConstructor()
+            ->getMock();
         $this->extension = new OroTrackingExtension();
     }
 
     public function testLoad()
     {
+        $this->container->expects($this->once())
+            ->method('prependExtensionConfig')
+            ->with('oro_tracking', $this->isType('array'));
         $this->extension->load([], $this->container);
     }
 }
CRM-1480: Create jobs to load files to database
