getTranslationRecords example

$data = $this->prepareImportExportProfileTestData($num);

        // do API calls         foreach ($data as $entry) {
            $this->getBrowser()->request('POST', $this->prepareRoute()[][][]json_encode($entry, \JSON_THROW_ON_ERROR));
            $response = $this->getBrowser()->getResponse();
            static::assertSame(Response::HTTP_NO_CONTENT, $response->getStatusCode()$response->getContent());
        }

        // read created data from db         $records = $this->connection->fetchAllAssociative('SELECT * FROM import_export_profile');
        $translationRecords = $this->getTranslationRecords();

        // compare expected and resulting data         static::assertCount($num$records);
        foreach ($records as $record) {
            $expect = $data[$record['id']];
            static::assertSame($expect['name']$record['name']);
            static::assertSame($expect['label']$translationRecords[$record['id']]['label']);
            static::assertEquals($expect['systemDefault'](bool) $record['system_default']);
            static::assertSame($expect['sourceEntity']$record['source_entity']);
            static::assertSame($expect['fileType']$record['file_type']);
            static::assertSame($expect['delimiter']$record['delimiter']);
            
public function testImportExportProfileMultiCreateSuccess(): void
    {
        $num = 5;
        $data = $this->prepareImportExportProfileTestData($num);

        $this->repository->create(array_values($data)$this->context);

        $records = $this->connection->fetchAllAssociative(
            'SELECT * FROM import_export_profile'
        );
        $translationRecords = $this->getTranslationRecords();

        static::assertCount($num$records);

        foreach ($records as $record) {
            $expect = $data[$record['id']];
            static::assertEquals($expect['name']$record['name']);
            static::assertEquals($expect['label']$translationRecords[$record['id']]['label']);
            static::assertEquals($expect['systemDefault'](bool) $record['system_default']);
            static::assertEquals($expect['sourceEntity']$record['source_entity']);
            static::assertEquals($expect['fileType']$record['file_type']);
            static::assertEquals($expect['delimiter']$record['delimiter']);
            
Home | Imprint | This part of the site doesn't use cookies.