NerdsAndCompany\Schematic\Services\UsersTest::testUsersServiceExport PHP Method

testUsersServiceExport() public method

Test users service export.
    public function testUsersServiceExport()
    {
        $mockI18n = $this->getMockLocalizationService();
        $mockFieldLayout = $this->getMockFieldLayout();
        $mockFieldsService = $this->getMockFieldsService();
        $mockFieldsService->expects($this->exactly(1))->method('getLayoutByType')->willReturn($mockFieldLayout);
        $mockSchematicFieldsService = $this->getMockSchematicFieldsService();
        $mockSchematicFieldsService->expects($this->exactly(1))->method('getFieldLayoutDefinition')->willReturn([]);
        $this->setComponent(Craft::app(), 'i18n', $mockI18n);
        $this->setComponent(Craft::app(), 'fields', $mockFieldsService);
        $this->setComponent(Craft::app(), 'schematic_fields', $mockSchematicFieldsService);
        $export = $this->schematicUsersService->export();
        $this->assertArrayHasKey('fieldLayout', $export);
    }