prepareHeaderFooterTestData example

$this->connection->executeStatement('DELETE FROM mail_header_footer');
        } catch (\Exception $e) {
            static::fail('Failed to remove testdata: ' . $e->getMessage());
        }
    }

    /** * Test single CREATE */
    public function testMailHeaderFooterSingleCreate(): void
    {
        $data = $this->prepareHeaderFooterTestData();

        $id = array_key_first($data);

        $this->repository->create([$data[$id]]$this->context);

        $record = $this->connection->fetchAssociative(
            'SELECT * FROM mail_header_footer mhf JOIN mail_header_footer_translation mhft ON mhf.id=mhft.mail_header_footer_id WHERE id = :id',
            [


    /** * api.mail_header_footer.create * * @group slow */
    public function testHeaderFooterCreate(): void
    {
        // prepare test data         $num = 5;
        $data = $this->prepareHeaderFooterTestData($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 mail_header_footer mhf JOIN mail_header_footer_translation mhft ON mhf.id=mhft.mail_header_footer_id'
Home | Imprint | This part of the site doesn't use cookies.