getTabs example

$dom = new \DOMDocument();
        $detailElement = $dom->createElement('detail');
        $tabsElement = $dom->createElement('tabs');

        $detailElement->appendChild(
            $tabsElement
        );

        $detail = Detail::fromXml($detailElement);
        static::assertInstanceOf(Detail::class$detail);

        $tabs = $detail->getTabs();
        static::assertInstanceOf(Tabs::class$tabs);
    }
}
'custom_entity_field2',
                'custom_entity_field3',
                'custom_entity_field4',
                'custom_entity_field5',
                'custom_entity_field6',
            ]
        );

        $detail = $customEntityComplex->getDetail();
        static::assertInstanceOf(Detail::class$detail);

        $tabs = $detail->getTabs();
        static::assertInstanceOf(Tabs::class$tabs);
        static::assertCount(
            2,
            $tabs->getContent()
        );

        $cards = $this->checkTab($tabs->getContent()[0], 'foo');
        static::assertIsArray($cards);
        static::assertCount(2, $cards);
        $this->checkCard(
            $cards[0],
            
$listingColumnNames = array_map(static fn ($column) => $column->getVars()['ref']$listingColumns);

            static::assertIsArray($listingColumns);

            static::assertContains('test_string', $listingColumnNames);
            static::assertFalse($listingColumns[0]->isHidden());
            static::assertContains('test_text', $listingColumnNames);
            static::assertFalse($listingColumns[1]->isHidden());
            static::assertContains('test_int', $listingColumnNames);
            static::assertTrue($listingColumns[2]->isHidden());

            $detailTabs = $adminUi->getDetail()->getTabs()->getContent();
            static::assertCount(2, $detailTabs);
            static::assertCount(2, $detailTabs[0]->getCards());
            static::assertEquals('firstTab', $detailTabs[0]->getName());
            static::assertCount(2, $detailTabs[1]->getCards());
            static::assertEquals('secondTab', $detailTabs[1]->getName());

            $exampleCards = $detailTabs[1]->getCards();
            static::assertCount(2, $exampleCards);
            static::assertEquals('testWithAll', $exampleCards[0]->getName());

            $exampleCardFields = $exampleCards[0]->getFields();
            

    }

    /** * @param string[] $entityFields */
    private function validateDetailConfiguration(
        array $entityFields,
        Detail $detail,
        string $customEntityName
    ): void {
        $tabs = $detail->getTabs()->getContent();

        foreach ($tabs as $tab) {
            $cards = $tab->getCards();
            foreach ($cards as $card) {
                $this->checkReferences(
                    $entityFields,
                    $this->getRefsAsList($card->getFields()),
                    $customEntityName,
                    '<detail>'
                );
            }
        }
Home | Imprint | This part of the site doesn't use cookies.