Skip to content

Commit

Permalink
Add test for upgrade of file field type #2830
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Pollock committed Dec 14, 2018
1 parent 4dcfa69 commit b922996
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/Integration/FunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,28 @@ public function testContainerGetsSetupOnFirstCall(){
$container = caldera_forms_get_v2_container();
$this->assertTrue( is_object( $container->getService( \calderawp\calderaforms\cf2\Services\QueueService::class)));
}

/**
* @since 1.8.0
*
* @covers \caldera_forms_get_v2_container()
*/
public function testUpgradesAdvancedFileFields(){
$id = 'fld1';
$fieldConfig = [
'id' => $id,
'slug' => 'roy',
'type' => 'advanced_file',
'conditions' => [
'type' => 'IS'
]
];
$field = \Caldera_Forms_Field_Util::get_field($id,[
'fields' => [
$id => $fieldConfig
],
'conditional_groups' => []
], true);
$this->assertSame(\calderawp\calderaforms\cf2\Fields\FieldTypes\FileFieldType::getCf1Identifier(), $field['type'] );
}
}

0 comments on commit b922996

Please sign in to comment.