* The TYPO3 project - inspiring people to share!
*/
-use TYPO3\CMS\Core\Tests\UnitTestCase;
use TYPO3\CMS\Form\Mvc\Configuration\Exception\CycleInheritancesException;
use TYPO3\CMS\Form\Mvc\Configuration\InheritancesResolverService;
/**
* Test case
*/
-class InheritancesResolverServiceTest extends UnitTestCase
+class InheritancesResolverServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
{
/**
* @var InheritancesResolverService
$this->subject = new InheritancesResolverService();
}
+ /**
+ * @test
+ * Test for the explicit example in service class comment
+ */
+ public function getDocExampleInheritance()
+ {
+ $input = [
+ 'Form' => [
+ 'part1' => [
+ 'key1' => 'value1',
+ 'key2' => 'value2',
+ 'key3' => 'value3',
+ ],
+ 'part2' => [
+ '__inheritances' => [
+ 10 => 'Form.part1',
+ ],
+ 'key2' => 'another_value'
+ ],
+ ],
+ ];
+
+ $expected = [
+ 'Form' => [
+ 'part1' => [
+ 'key1' => 'value1',
+ 'key2' => 'value2',
+ 'key3' => 'value3',
+ ],
+ 'part2' => [
+ 'key1' => 'value1',
+ 'key2' => 'another_value',
+ 'key3' => 'value3'
+ ],
+ ],
+ ];
+
+ $this->assertSame($expected, $this->subject->reset()->setReferenceConfiguration($input)->getResolvedConfiguration($input));
+ }
+
/**
* @test
*/