Файл: symfony-2.7/src/Symfony/Component/Form/Tests/Extension/DataCollector/DataCollectorExtensionTest.php
Строк: 80
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace SymfonyComponentFormTestsExtensionDataCollector;
use SymfonyComponentFormExtensionDataCollectorDataCollectorExtension;
/**
* @covers SymfonyComponentFormExtensionDataCollectorDataCollectorExtension
*/
class DataCollectorExtensionTest extends PHPUnit_Framework_TestCase
{
/**
* @var DataCollectorExtension
*/
private $extension;
/**
* @var PHPUnit_Framework_MockObject_MockObject
*/
private $dataCollector;
public function setUp()
{
$this->dataCollector = $this->getMock('SymfonyComponentFormExtensionDataCollectorFormDataCollectorInterface');
$this->extension = new DataCollectorExtension($this->dataCollector);
}
public function testLoadTypeExtensions()
{
$typeExtensions = $this->extension->getTypeExtensions('form');
$this->assertInternalType('array', $typeExtensions);
$this->assertCount(1, $typeExtensions);
$this->assertInstanceOf('SymfonyComponentFormExtensionDataCollectorTypeDataCollectorTypeExtension', array_shift($typeExtensions));
}
}