assertColumns example

$this->getContainer()
            ->get(CustomEntityPersister::class)
            ->update($entities->toStorage());

        $this->getContainer()
            ->get(CustomEntitySchemaUpdater::class)
            ->update();

        $schema = $this->getSchema();

        self::assertColumns($schema, 'custom_entity_blog', ['id', 'top_seller_id', 'author_id', 'created_at', 'updated_at', 'position', 'rating']);
        self::assertColumns($schema, 'ce_blog_comment', ['id', 'created_at', 'updated_at']);
        self::assertColumns($schema, 'custom_entity_to_remove', ['id', 'created_at', 'updated_at']);

        $entities = CustomEntityXmlSchema::createFromXmlFile(__DIR__ . '/_fixtures/custom-entity-test/Resources/update.xml');
        $this->getContainer()
            ->get(CustomEntityPersister::class)
            ->update($entities->toStorage());

        $this->getContainer()
            ->get(CustomEntitySchemaUpdater::class)
            ->update();

        
public function testDefaultFields(): void
    {
        $entity = [
            'name' => 'custom_entity_empty_entity',
            'fields' => '[]',
        ];
        $schema = new Schema();

        $updater = new SchemaUpdater();
        $updater->applyCustomEntities($schema[$entity]);

        $this->assertColumns($schema, 'custom_entity_empty_entity', ['id', 'created_at', 'updated_at']);
    }

    public function testShortPrefix(): void
    {
        $entity = [
            'name' => 'ce_empty_entity',
            'fields' => '[]',
        ];
        $schema = new Schema();

        $updater = new SchemaUpdater();
        
Home | Imprint | This part of the site doesn't use cookies.