/** * @test */ public function addDataAddsInlineStatusForSecondLevelChild() { $input = ['command' => 'edit', 'tableName' => 'bChildTable', 'databaseRow' => ['uid' => 13], 'inlineTopMostParentTableName' => 'aParentTable', 'inlineTopMostParentUid' => 5]; $inlineState = ['aParentTable' => [5 => ['aChildTable' => [23, 42], 'bChildTable' => [13, 66]]]]; $GLOBALS['BE_USER'] = new \stdClass(); $GLOBALS['BE_USER']->uc = ['inlineView' => serialize($inlineState)]; $expected = $input; $expected['inlineExpandCollapseStateArray'] = $inlineState['aParentTable'][5]; $this->assertSame($expected, $this->subject->addData($input)); }
/** * @test * @dataProvider addDataAddsCorrectIsInlineChildExpandedDataProvider * * @param array $input * @param bool $expectedIsInlineChildExpanded */ public function addDataAddsCorrectIsInlineChildExpanded(array $input, $expectedIsInlineChildExpanded) { $expected = $input; $expected['isInlineChildExpanded'] = $expectedIsInlineChildExpanded; $this->assertSame($expected, $this->subject->addData($input)); }